[FieldTrip] convert .nii files to .mri files.

Siamak Sorooshyari siamak_sorooshyari at yahoo.com
Tue Jan 24 09:21:50 CET 2023


 
Thanks so much for your response. To answer your question, this is the page that told me to do this:https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/tutorial/headmodel_meg/__;!!HJOPV4FYYWzcc1jazlU!-qcyro8jKwBn5Xqc8iAFdYa1KfXBec5vExDDbcnuaLuBa3me-OrEGuQ8KJGdykEHe25-1iPCMVhMq5QYf8wd4jNbWyQt0sQ$ 
Notice where they mention the following: 
Then, you can read in the mri data. mri = ft_read_mri('Subject01.mri'); 
When I give the above command with either .nii or .nii.gz I get an error: 
ERROR: D:\MEG_OMEGA_data\controls\sub-0229_Siamak\ses-01\anat\sub-0229_ses-01_run-1_T1w.nii, read in 23592960 voxels, expected 11796480ERROR: loading D:\MEG_OMEGA_data\controls\sub-0229_Siamak\ses-01\anat\sub-0229_ses-01_run-1_T1w.nii as analyzeDot indexing is not supported for variables of this type.
Error in ft_read_mri (line 409)    ndims = numel(size(tmp.vol));
Error in my_process_MEG_via_FT_1 (line 8)mri = ft_read_mri('D:\MEG_OMEGA_data\controls\sub-0229_Siamak\ses-01\anat\sub-0229_ses-01_run-1_T1w.nii');
I am not clear at all what I'm doing wrong or what the best remedy would be? 
Best,Siamak

    On Tuesday, January 24, 2023 at 12:11:47 AM PST, Schoffelen, J.M. (Jan Mathijs) via fieldtrip <fieldtrip at science.ru.nl> wrote:  
 
 Hi Siamak,
Why do you think that you need to convert anything? As far as I can tell, the help documentation of ft_read_mri (https://urldefense.com/v3/__https://github.com/fieldtrip/fieldtrip/blob/master/fileio/ft_read_mri.m__;!!HJOPV4FYYWzcc1jazlU!-qcyro8jKwBn5Xqc8iAFdYa1KfXBec5vExDDbcnuaLuBa3me-OrEGuQ8KJGdykEHe25-1iPCMVhMq5QYf8wd4jNbqROx31U$ ) clearly mentions that it directly supports *.nii and *.nii.gz files. If there’s some other documentation that you came across, which mentions otherwise, and this documentation is one of the subpages offieldtriptoolbox.org, please adjust the text accordingly in a pull request on github (https://urldefense.com/v3/__https://github.com/fieldtrip/website__;!!HJOPV4FYYWzcc1jazlU!-qcyro8jKwBn5Xqc8iAFdYa1KfXBec5vExDDbcnuaLuBa3me-OrEGuQ8KJGdykEHe25-1iPCMVhMq5QYf8wd4jNbLVhM8-U$ ) or equivalently press the ‘edit page with github’ link on the relevant page.
Best wishes,Jan-Mathijs


On 24 Jan 2023, at 08:14, Siamak Sorooshyari via fieldtrip <fieldtrip at science.ru.nl> wrote:

How do you convert .nii (or I guess .nii.gz) files to .mri files. This is because I've been given .nii.gz files by the OMEGA dataset and I want to feed them into FieldTrip via the FieldTrip ft_read_mri() function. I am trying to get anatomical information so I can feed that into the MEG source localization that I'm trying. 
_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8Zu0-0EWmjs35RiZa4_KQLPCjFq1llUC0eWkKZg1QeNSUq4KR9vZoNlJGh6pjecl0GOWEICJXhM1b678lB9c4zlmK3mIMQpDBPLC9g$


_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!-qcyro8jKwBn5Xqc8iAFdYa1KfXBec5vExDDbcnuaLuBa3me-OrEGuQ8KJGdykEHe25-1iPCMVhMq5QYf8wd4jNbcGLCCeo$ 
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20230124/89408ff3/attachment.htm>


More information about the fieldtrip mailing list