Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert registered atlas to tiff stack or tiff sequence #24

Open
DJESTRIN opened this issue Jan 24, 2023 · 1 comment
Open

Convert registered atlas to tiff stack or tiff sequence #24

DJESTRIN opened this issue Jan 24, 2023 · 1 comment

Comments

@DJESTRIN
Copy link

Hi,
Thanks for the great code.

I was wondering if anyone might have a suggestion for converting the outputs of map_nonuniform_multiscale_v02_mouse_gauss_newton.m to a tiff stack instead of neuroglancer's precomputed format.

Currently, I am taking the data from downloop_1_labels_to_target_highres.img and converting it to a numpy array via SimpleITK. Then, I am saving the numpy array as an image via cv2. Although this image stack looks pretty good, I am wondering whether it needs to be run through transform_points.m or transform_points.py. Is downloop_1_labels_to_target_highres.img the final registered atlas?

Also, although this atlas image stack contains the same number of z planes as my target image stack, the image dimensions are much smaller (atlas=921x920, target=7210x7059). I am currently thinking of resampling my atlas image stack to match the dimensions of my target image, however, I would appreciate any advice.

Thank you in advance for your help and time!

@tathey1
Copy link
Member

tathey1 commented Jan 25, 2023

You are correct that downloop_1_labels_to_target_highres.img is atlas labels that were transformed to the shape of the target. For me, this file is also at a lower resolution than the target data. It should be (approximately, due to rounding) whichever multiple of the target resolution is above 10microns - which is the resolution of the atlas. It seems that for you (as for me), this is a factor of 8.

What you are describing is also how I would approach the conversion into tif stacks. As long as you can find a package to read the img file, and write tifs. I never have read img's before in python but I have written tifs, usually with skimage.io.imwrite

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants