<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
Hi Siamak,<br class="">
<div>
<div style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">
<div class=""><br class="">
</div>
As far as I can see, the page works with an anatomical file of a certain format, which happens to be *.mri. I don’t see why one would conclude that a file of another format needs to be converted into the *.mri format in order to be able to use the tutorial
 code for their own purpose.
<div class=""><br class="">
</div>
<div class="">Regarding the error you got: the lower level reading routine, based on the freesurfer toolbox, typically catches errors, and thus doesn’t lead to a hard crash if something goes wrong. These errors are indicated by the lines starting with ‘ERROR’
 in your e-mail report. This suggests that something goes wrong with the low-level reading of the data. Perhaps the file is corrupt, or something else is wrong. Either way, this is out of fieldtrip hands.</div>
<div class=""><br class="">
</div>
<div class="">The matlab error message you get, about the dot-indexing can subsequently be interpreted as follows: the tmp variable, which is accessed on said line 409 in ft_read_mri, in order to extract the field called vol, does not allow for dot indexing.
 Thinking a bit further this means that the tmp variable, which is assumed to be a struct (because structs are matlab variables that allow for dot-indexing in order to access the struct’s fields) apparently in your case is not a struct. </div>
<div class=""><br class="">
</div>
<div class="">It is perhaps a bit suboptimal to get this particular error message, so we look forward to a pull request that suggests a more elegant error handling in this case.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
<div class=""><br class="">
<blockquote type="cite" class="">
<div class="">On 24 Jan 2023, at 09:21, Siamak Sorooshyari <<a href="mailto:siamak_sorooshyari@yahoo.com" class="">siamak_sorooshyari@yahoo.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div class="">
<div class="ydp2d34eae4yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;">
<div class=""></div>
<div dir="ltr" data-setdir="false" class=""><br class="">
</div>
<div dir="ltr" data-setdir="false" class="">Thanks so much for your response. To answer your question, this is the page that told me to do this:</div>
<div dir="ltr" data-setdir="false" class=""><a href="https://urldefense.com/v3/__https://www.fieldtriptoolbox.org/tutorial/headmodel_meg/__;!!HJOPV4FYYWzcc1jazlU!_YWDWs51vAwHGcxlNVFhN2v0kKGxiWDWciY9BuJs-UwCRap5VOu1gE3mvgbd4cUbTbS3EtWpuIfpjmVkTd3KLR9ElP3uS6tRCHXCNWNdKQ$" rel="nofollow" target="_blank" class="">https://www.fieldtriptoolbox.org/tutorial/headmodel_meg/</a><br class="">
</div>
<div dir="ltr" data-setdir="false" class="">Notice where they mention the following: </div>
<div dir="ltr" data-setdir="false" class=""><br class="">
</div>
<div dir="ltr" data-setdir="false" class="">
<div class="">
<div class=""><font color="#cd232c" class="">Then, you can read in the mri data. </font></div>
<div class=""><font color="#cd232c" class="">mri = ft_read_mri('Subject01.mri'); </font></div>
</div>
</div>
<div dir="ltr" data-setdir="false" class=""><br class="">
</div>
<div dir="ltr" data-setdir="false" class="">When I give the above command with either<span class=""> .nii or .nii.gz I get an error: </span></div>
<div dir="ltr" data-setdir="false" class=""><span class=""><br class="">
</span></div>
<div dir="ltr" data-setdir="false" class="">
<div class="">
<div class=""><font color="#cd232c" class="">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 11796480</font></div>
<div class=""><font color="#cd232c" class="">ERROR: loading D:\MEG_OMEGA_data\controls\sub-0229_Siamak\ses-01\anat\sub-0229_ses-01_run-1_T1w.nii as analyze</font></div>
<div class=""><font color="#cd232c" class="">Dot indexing is not supported for variables of this type.</font></div>
<div class=""><font color="#cd232c" class=""><br class="">
</font></div>
<div class=""><font color="#cd232c" class="">Error in ft_read_mri (line 409)</font></div>
<div class=""><font color="#cd232c" class="">    ndims = numel(size(tmp.vol));</font></div>
<div class=""><font color="#cd232c" class=""><br class="">
</font></div>
<div class=""><font color="#cd232c" class="">Error in my_process_MEG_via_FT_1 (line 8)</font></div>
<div class=""><font color="#cd232c" class="">mri = ft_read_mri('D:\MEG_OMEGA_data\controls\sub-0229_Siamak\ses-01\anat\sub-0229_ses-01_run-1_T1w.nii');</font></div>
</div>
</div>
<div dir="ltr" data-setdir="false" class=""><br class="">
</div>
<div dir="ltr" data-setdir="false" class="">I am not clear at all what I'm doing wrong or what the best remedy would be? </div>
<div dir="ltr" data-setdir="false" class=""><br class="">
</div>
<div dir="ltr" data-setdir="false" class="">Best,</div>
<div dir="ltr" data-setdir="false" class="">Siamak</div>
<div dir="ltr" data-setdir="false" class=""><br class="">
</div>
<div class=""><br class="">
</div>
</div>
<div id="ydpad2b68f1yahoo_quoted_5520046076" class="ydpad2b68f1yahoo_quoted">
<div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;" class="">
<div class="">On Tuesday, January 24, 2023 at 12:11:47 AM PST, Schoffelen, J.M. (Jan Mathijs) via fieldtrip <<a href="mailto:fieldtrip@science.ru.nl" class="">fieldtrip@science.ru.nl</a>> wrote:
</div>
<div class=""><br class="">
</div>
<div class=""><br class="">
</div>
<div class="">
<div id="ydpad2b68f1yiv2165448142" class="">
<div class="">Hi Siamak,
<div class="ydpad2b68f1yiv2165448142"><br clear="none" class="ydpad2b68f1yiv2165448142">
</div>
<div class="ydpad2b68f1yiv2165448142">Why do you think that you need to convert anything? As far as I can tell, the help documentation of ft_read_mri (<a shape="rect" href="https://urldefense.com/v3/__https://github.com/fieldtrip/fieldtrip/blob/master/fileio/ft_read_mri.m__;!!HJOPV4FYYWzcc1jazlU!7npeRmvEN0Icn0O6P3WP_0hVkGO6DX5oScMzlLeYJvAl0qGUrBEuHvSoEXsHmolWWJ0n0DYUNJ5VRqw0nuH2zkpKMl-Eu_mEt_pQnw$" class="ydpad2b68f1yiv2165448142" rel="nofollow" target="_blank">https://github.com/fieldtrip/fieldtrip/blob/master/fileio/ft_read_mri.m</a>)
 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 of
<a shape="rect" href="https://urldefense.com/v3/__http://fieldtriptoolbox.org__;!!HJOPV4FYYWzcc1jazlU!7npeRmvEN0Icn0O6P3WP_0hVkGO6DX5oScMzlLeYJvAl0qGUrBEuHvSoEXsHmolWWJ0n0DYUNJ5VRqw0nuH2zkpKMl-Eu_lNRaAPnw$" class="ydpad2b68f1yiv2165448142" rel="nofollow" target="_blank">
fieldtriptoolbox.org</a>, please adjust the text accordingly in a pull request on github (<a shape="rect" href="https://urldefense.com/v3/__https://github.com/fieldtrip/website__;!!HJOPV4FYYWzcc1jazlU!7npeRmvEN0Icn0O6P3WP_0hVkGO6DX5oScMzlLeYJvAl0qGUrBEuHvSoEXsHmolWWJ0n0DYUNJ5VRqw0nuH2zkpKMl-Eu_nX0tFnJA$" class="ydpad2b68f1yiv2165448142" rel="nofollow" target="_blank">https://github.com/fieldtrip/website</a>)
 or equivalently press the ‘edit page with github’ link on the relevant page.</div>
<div class="ydpad2b68f1yiv2165448142"><br clear="none" class="ydpad2b68f1yiv2165448142">
</div>
<div class="ydpad2b68f1yiv2165448142">Best wishes,</div>
<div class="ydpad2b68f1yiv2165448142">Jan-Mathijs</div>
<div class="ydpad2b68f1yiv2165448142"><br clear="none" class="ydpad2b68f1yiv2165448142">
<div class=""><br clear="none" class="ydpad2b68f1yiv2165448142">
<blockquote type="cite" class="ydpad2b68f1yiv2165448142">
<div id="ydpad2b68f1yiv2165448142yqt92647" class="ydpad2b68f1yiv2165448142yqt3178493291">
<div class="ydpad2b68f1yiv2165448142">On 24 Jan 2023, at 08:14, Siamak Sorooshyari via fieldtrip <<a shape="rect" href="mailto:fieldtrip@science.ru.nl" class="ydpad2b68f1yiv2165448142" rel="nofollow" target="_blank">fieldtrip@science.ru.nl</a>> wrote:</div>
<br clear="none" class="ydpad2b68f1yiv2165448142Apple-interchange-newline">
<div class="ydpad2b68f1yiv2165448142">
<div class="ydpad2b68f1yiv2165448142">
<div style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:16px;" class="ydpad2b68f1yiv2165448142ydpedc47136yahoo-style-wrap">
<div dir="ltr" class="ydpad2b68f1yiv2165448142">
<div class="ydpad2b68f1yiv2165448142">
<div dir="ltr" class="ydpad2b68f1yiv2165448142"><br clear="none" class="ydpad2b68f1yiv2165448142">
</div>
<div dir="ltr" class="ydpad2b68f1yiv2165448142">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. </div>
<div class="ydpad2b68f1yiv2165448142"><br clear="none" class="ydpad2b68f1yiv2165448142">
</div>
</div>
</div>
</div>
</div>
_______________________________________________<br clear="none" class="ydpad2b68f1yiv2165448142">
fieldtrip mailing list<br clear="none" class="ydpad2b68f1yiv2165448142">
<a shape="rect" href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="ydpad2b68f1yiv2165448142" rel="nofollow" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br clear="none" class="ydpad2b68f1yiv2165448142">
<a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8Zu0-0EWmjs35RiZa4_KQLPCjFq1llUC0eWkKZg1QeNSUq4KR9vZoNlJGh6pjecl0GOWEICJXhM1b678lB9c4zlmK3mIMQpDBPLC9g$" class="">https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!8Zu0-0EWmjs35RiZa4_KQLPCjFq1llUC0eWkKZg1QeNSUq4KR9vZoNlJGh6pjecl0GOWEICJXhM1b678lB9c4zlmK3mIMQpDBPLC9g$</a>
<br clear="none" class="ydpad2b68f1yiv2165448142">
</div>
</div>
</blockquote>
</div>
<br clear="none" class="ydpad2b68f1yiv2165448142">
</div>
</div>
</div>
<div class="ydpad2b68f1yqt3178493291" id="ydpad2b68f1yqt64169">_______________________________________________<br clear="none" class="">
fieldtrip mailing list<br clear="none" class="">
<a shape="rect" href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="nofollow" target="_blank" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br clear="none" class="">
<a shape="rect" href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!_YWDWs51vAwHGcxlNVFhN2v0kKGxiWDWciY9BuJs-UwCRap5VOu1gE3mvgbd4cUbTbS3EtWpuIfpjmVkTd3KLR9ElP3uS6tRCHVk34TVvw$" rel="nofollow" target="_blank" class="">https://doi.org/10.1371/journal.pcbi.1002202</a><br clear="none" class="">
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="">
</div>
</div>
</div>
<br class="">
</body>
</html>