I have been using afni_proc.py example 11 to analyze our resting fMRI data. Due to our own design, in the next step analysis, I need to convert a coordinate from MNI space to each subject’s original space, then use that coordinate in original space as the seed to create a sphere ROI for each subject.
Now I am stuck with the step that converting MNI coordinate to original coordinate. I tried to use Vecwarp as follow:
Vecwarp -apar S0237_SurfVol_ns+tlrc. -input S0237_M1.1D -backward > S0237_M1_orig.1D
It gave this error message: ** FATAL ERROR: -apar: Dataset S0237_SurfVol_ns+tlrc. does not contain warp
I also tried the method described in the ROI-related manual using 3dNwarpCat and 3dNwarpApply, but it’s still not clear to me how to extract the coordinate in original space (or native space).
The transform matrix seems in anat.un.aff.Xat.1D and anat.un.aff.qw_WARP.nii. But how could I use them to inverse the transform?
Suggestions are greatly appreciated!
The analogous command to Vecwarp for dealing with nonlinear warps for specific xyz coordinates instead of just affine warps is 3dNwarpXYZ. There is more information in the help for that command. The transformations follow the same order as those listed in slides 38 and 39 from the class material here:
Great. I will try the 3dNwarpXYZ command.
Thanks so much for the prompt reply!
I tried to use 3dNwarpXYZ to get original coordinates from MNI coordinates, but the results are not right (the location from the ‘original coordinates’ is far from the real location). Please let me know if I did anything wrong here:
This is how one subject’s structural images were standardized:
1), ‘S01_SurfVol_ns+orig’ was standardized by using auto_warp.py as follows:
auto_warp.py -base MNI_caez_N27+tlrc -input S01_SurfVol_ns+orig -skull_strip_input no
2), the standardized images were transformed to AFNI format:
3dbucket -prefix S01_SurfVol_ns awpy/S01_SurfVol_ns.aw.nii*
3), I got the linear and non-linear transform file: anat.un.aff.Xat.1D and anat.un.aff.qw_WARP.nii.
To get the native coordinates for MNI coordinate (-38 -5 58 in S0237_MNI.1D), I used 3dUwarpXYZ as follow:
3dUwarpXYZ -uwarp ‘anat.un.aff.Xat.1D anat.un.aff.qw_WARP.nii’ -iwarp S0237_MNI.1D > S0237_M1_org
I also tried 3dUwarpXYZ -uwarp ‘anat.un.aff.Xat.1D INV(anat.un.aff.qw_WARP.nii)’ -S0237_MNI.1D > S0237_M1_org
3dUwarpXYZ -uwarp ‘INV(anat.un.aff.Xat.1D) INV(anat.un.aff.qw_WARP.nii)’ -S0237_MNI.1D > S0237_M1_org
None of the above worked.
To trouble shoot, I tested if the two transform files can transfer original file (S01_SurfVol_ns+orig) to the standard file (S01_SurfVol_ns) and I used the following command:
3dNwarpApply -nwarp ‘anat.un.aff.Xat.1D anat.un.aff.qw_WARP.nii’ -source S01_SurfVol_ns+orig. -master ~/abin/MNI_caez_N27+tlrc -prefix S01_standard
Indeed, the output file here (S01_standard) is different from the output of auto_warp.py (S01_SurfVol_ns).
Is there anything that I mis-understood? Please let me know if you have any suggestions! Thanks.
I haven’t had a chance to look at that for you. Thanks for posting the update and the link.
How would you go about converting orig coordinates to tlrc coordinates? I have tried switching around the 3dNwarpXYZ command from the attached link in the previous post but I cannot seem to get a correct coordinate.
Not just the order, but the transformations actually have to be inverted too.