-
Notifications
You must be signed in to change notification settings - Fork 44
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
Converting multi-component image to nii #59
Comments
I am not clear about your purpose. Are you trying to store something like FSL warping file? |
The requirement is to have 3 components per pixel - component 1: x-deformation. component 2: y-deformation and component 3: z-deformation. I was able to make progress by converting the DVF matrix to 8-D image as specified in help doc. The next issue is that the image pixel values get converted to uint8. Is there a setting to specify retaining the pixel intensities as float. |
I am not sure, but it sounds like you are not dealing with RGB images, so don't put that into 8th dim. You can simply use the 4th dim to store the x/y/z-deformation component, as FSL warping files do. Although NIfTI specification reserves 4th-dim for time, but no one cares or follows it. I suppose the metadata will be same as or similar to whatever NIfTI you derive the deformation vectors from. |
When I save x/y/z deformation in the 4th dimension, the image written to nii is 4-D. It has 16-element direction cosines (instead of 9 element). Also, NumberOfComponentsPerPixel=1 instead of 3. Perhaps I am missing the metadata required to tell the nii writer to treat the 4th dimension of the image as 3 components per pixel instead of a separate dimension. |
I would like to write deformation vector field (dx,dy,dz volumes) as a multi-component image. Any suggestions on how to organize the input image and other metadata as an input to set_nii_hdr.m and nii_tool.m?
The text was updated successfully, but these errors were encountered: