-
Notifications
You must be signed in to change notification settings - Fork 0
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
Transform files: do they represent affine mappings? #2
Comments
I assume you are referring to the _xfm.nii that I included? For example, I find this way of storing non-linear deformations very handy (and John Ashburners spmdef_ routines are using this format). In SPM these are saved as y* or iy*. For Matlab, we have a version of John's routines so they can be called independently of the batch system: I had trouble finding reliable documentation on the _xfm.h5 file format used in templateflow, so I used this more (I think) intuitive and robust way of representing arbitrary non-linear deformations. In the long run, I'd be happy to decide:
Let me know which way you want to go for templateflow.... I personally think the deformation images are a very simple, intuitive and robust way of representing non-linear deformations. Joern |
Then, it should be possible to decompose this into the affine and the nonlinear deformation field (and for clarity, this is not a displacement field but a deformation field). I would either encode this in a single h5 file (encapsulating separately the affine and the deformation field) or encode the affine in the s-form field and the deformation as a NIfTI file. The latter option is perhaps the most appropriate from a theoretical point of view (the s-form is there for exactly this purpose and would allow visualization software to overlay the SUIT template on MNI without resamplings), but at the same time, it is less compatible with the current pipeline development practices. It also has the inconvenience that the s-form goes "from voxel indices to MNI", so we need to modify your affine and prepend the image's affine. Maybe having more feedback would be useful here - wdyt @effigies, @mgxd, @tsalo? |
Yes - I could easily decompose the deformation field into an affine part and a displacement field and encode it into an h5 file. Reading a typical _xfm.h5 file (
P1: Looks like a 4x3 Affine transformation matrix between the two spaces. Which direction?
Here is my guess:
But all these are just guesses on my part.... |
Clarify how the transform files may be applied and upload the necessary items.
If they are affine transformations, then, a "neat" possibility is to write them in the s-form header of the NIfTI volumes (and set the s-from code to 4 "mni"). That will allow viewers to plot it correctly on top of the corresponding MNI template.
The text was updated successfully, but these errors were encountered: