-
Notifications
You must be signed in to change notification settings - Fork 104
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
[ENH, MRG] Add scanner RAS coordinate frame definition #444
Conversation
Here's how it looks in the GitHub rendered markdown https://github.com/alexrockhill/website/blob/scanras/faq/how_are_the_different_head_and_mri_coordinate_systems_defined.md |
Are the axes flipped, or is the order of the voxels in the volume flipped, or both? Flipping both is demonstrated here. Flipping only the axis would keep the |
Am I correct that here you mean the centre of the gradient coil? Since the original bids-standard/bids-specification#747 mentions FreeSurfer, it might be relevant to point out that the FreeSurfer origin is different from the scanner origin. Edit: I am not so sure any more about the correctness and clarity of my previous statement. When writing that, I was thinking about the 256x256x256 FreeSurfer files that have the origin in the center of the volume (in between voxel 128 and 129). But FreeSurfer will also have files that have not been padded yet to 256x256x256. |
The axes are flipped but the voxels are left in their original configuration. |
Correct, I was following the convention to exclude detail on the second instance as in I'm not aware of Freesurfer files that have not been padded to 256 x 256 x 256 yet with the exception of In general, yes, scanner RAS and surface RAS will not have the same origin. |
I carefully reviewed https://dicom.innolitics.com/ciods/mr-image/image-plane/00200037 and https://www.sciencedirect.com/science/article/pii/S0165027016300073, see also fieldtrip/fieldtrip#1869. For bipeds, the DICOM coordinate system has the origin at the center of the gradient coil (not specified as such), the x-axis is increasing to the left hand side of the patient. The y-axis is increasing to the posterior side of the patient. The z-axis is increasing toward the head of the patient. This is now correctly represented in
Comparing this to the FreeSurfer implementation of the DICOM reading functions, I see that FS rotates the coordinate system 180 degrees around the z-axis.
|
figure 1 from https://doi.org/10.1016/j.jneumeth.2016.03.001 clarifies this The That also means that the NIfTI coordinate system and the Scanner RAS (aka The original DICOM coordinate system could in principle be indicated as Edit: corrected that DICOM compares to |
Oh, and to complete the links to documentation elsewhere: on https://brainder.org/2012/09/23/the-nifti-file-format/ it states for NIfTI
|
I have added some text to explain the relation between
|
Wow thanks so much for really digging into this, that is really good info, I really only knew what was going on in the code. Sorry to leave the PR stale--our baby arrived right after I opened it, thanks for finishing it @robertoostenveld! |
congrats! Now that we have established that Edit: corrected that DICOM compares to |
With fieldtrip/fieldtrip#1878 I have now also added support for these coordinate systems to the FieldTrip code. |
- it can be 0=unknown, 1=scanras, 2=aligned, 3=tal, 4=mni - see #444 and fieldtrip/fieldtrip#1878
Related to comment in bids-standard/bids-specification#747