<div dir="ltr"><div>Dear Jan-Mathijs</div><div><br></div><div>Thank you for the answer. It worked!</div><div><br></div><div>Best regards</div><div>Mikkel</div><div><br></div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><font size="1"><span style="font-family:arial,helvetica,sans-serif">Mikkel C. Vinding<br>NatMEG, Karolinska Institutet<b><br>
</b>Nobels väg 9<br>
171 77 Stockholm, Sweden<b><br>
</b>Email: <a href="mailto:mikkel.vinding@ki.se" target="_blank">mikkel.vinding@ki.se</a><b><br>
</b></span></font></div></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Dec 4, 2018 at 9:45 PM Schoffelen, J.M. (Jan Mathijs) <<a href="mailto:jan.schoffelen@donders.ru.nl">jan.schoffelen@donders.ru.nl</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">



<div style="word-wrap:break-word">
Dear Mikkel,
<div><br>
</div>
<div>I did not look into it in detail, but from your description it seems that the code takes a wrong turn somewhere, and thinks that the fileformat is of type freesurfer_volume (and for this reason it ends up on a line that tries to use ft_read_mri).
 I read in the code that the default allocation of the fileformat based on an educated guess from the filename  is implemented in a slightly clunky way. Soooo, perhaps you could try and overrule this default allocation by explicitly specifying it in your call
 to ft_read_atlas:</div>
<div><br>
</div>
<div>ft_read_atlas({filename_annotation filename_mesh}, ‘format’, ‘freesurfer_*’); </div>
<div><br>
</div>
<div>where the * should be the appropriate choice of ‘a2009s’ ‘aparc’, or ‘ba’.</div>
<div><br>
</div>
<div>Best wishes,</div>
<div>Jan-Mathijs</div>
<div><br>
</div>
<div>
<div>
<blockquote type="cite">
<div>On 4 Dec 2018, at 20:20, Mikkel Vinding <<a href="mailto:mikkel@cnru.dk" target="_blank">mikkel@cnru.dk</a>> wrote:</div>
<br class="m_-7033842075320317285Apple-interchange-newline">
<div>
<div dir="ltr">
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Dear FieldTrip list<span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">
<span> </span></p>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Has anyone here imported individual atlases from Freesurfer into FieldTrip? It should be possible with ft_read_atlas. From the documentation of ft_read_atlas:
<span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">
<span> </span></p>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<i>  For individual surface-based atlases from FreeSurfer, you should specify two
<span></span></i></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<i>  filenames as a cell-array: the first points to the file that contains information<span></span></i></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<i>  with respect to the parcels' labels, the second points to the file that defines the<span></span></i></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<i>  mesh on which the parcellation is defined.<span></span></i></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">
<span> </span></p>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Ft_read_atlas require a struct containing the filename of the atlas file and the cortical surface/mesh. However, I keep getting errors that ft_read_atlas cannot read Freesurfers “annot” files: “
<i>unrecognized filetype 'freesurfer_annot'.</i>“ I get a similar error when I try to read Freesurfer “label” files.<span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">
<span> </span></p>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
The problem seems to be because ft_read_atlas calls ft_read_mri which does not support the type 'freesurfer_annot'. My question is how to read in Freesurfer annotations or labels? Do I need to convert the Freesurfer files first or is there another step I need
 to do first? If anyone has managed to read Freesurfer labels in FieldTrip, I will be delighted to hear the answer.<span></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">
<span> </span></p>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Best regards<span></span></div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
Mikkel</div>
<div style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">
<br>
<span></span></div>
<div>
<div dir="ltr" class="m_-7033842075320317285gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr">
<div><font size="1"><span style="font-family:arial,helvetica,sans-serif">Mikkel C. Vinding<br>
NatMEG, Karolinska Institutet<b><br>
</b>Nobels väg 9<br>
171 77 Stockholm, Sweden<b><br>
</b>Email: <a href="mailto:mikkel.vinding@ki.se" target="_blank">mikkel.vinding@ki.se</a><b><br>
</b></span></font></div>
</div>
</div>
</div>
</div>
_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</div>
</blockquote>
</div>
<br>
</div>
</div>

_______________________________________________<br>
fieldtrip mailing list<br>
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" rel="noreferrer" target="_blank">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br>
<a href="https://doi.org/10.1371/journal.pcbi.1002202" rel="noreferrer" target="_blank">https://doi.org/10.1371/journal.pcbi.1002202</a><br>
</blockquote></div>