-
Notifications
You must be signed in to change notification settings - Fork 712
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
ft_write_mri should use mri.coordsys
when writing data to nifti file
#1879
Comments
I am currently making some improvements to Therefore I will at this moment only implement some feedback on the coordinate system on screen, not assign it to |
it is not added to the output yet, because ft_write_mri does not pass it properly to the low-level FreeSurfer or SPM code, see fieldtrip#1879
Where possible, the
coordsys
should be translated in ansform_code
orqform_code
(0, 1, 2, 3, 4) so that upon reading of the file (with ft_read_mri) the coordinate system can be properly interpreted.The MEG and EEG coordinate systems (such as ctf, neuromag, bti, etc) are based on external anatomical landmarks (nasion, ears) and not supported in the nifti file format. See https://brainder.org/2012/09/23/the-nifti-file-format/ and this table copied from there:
I think that it would be appropriate to write MRI data that is expressed in a known MEG coordinate system with the
aligned_anat
(2) code. Upon reading the nifti file withft_read_mri
, you would still not know whether it is ctf, neuromag, or something else, but it would be slightly more informative than it being unknown.In case the FreeSurfer implementation is used underneath the present
ft_write_mri
code (the default for nifti), it is always written withscanner_anat
(1).In case the SPM12 implementation is used underneath the present
ft_write_mri
code, it seems that it is always written withaligned_anat
(2).These hard-coded assumptions in the SPM12 and FreeSurfer code are not consistent with the information that is available to the FieldTrip user, e.g. after
ft_determine_coordsys
.The text was updated successfully, but these errors were encountered: