<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">
Dear Mikkel,
<div class=""><br class="">
</div>
<div class="">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 class=""><br class="">
</div>
<div class="">ft_read_atlas({filename_annotation filename_mesh}, ‘format’, ‘freesurfer_*’); </div>
<div class=""><br class="">
</div>
<div class="">where the * should be the appropriate choice of ‘a2009s’ ‘aparc’, or ‘ba’.</div>
<div class=""><br class="">
</div>
<div class="">Best wishes,</div>
<div class="">Jan-Mathijs</div>
<div class=""><br class="">
</div>
<div class="">
<div>
<blockquote type="cite" class="">
<div class="">On 4 Dec 2018, at 20:20, Mikkel Vinding <<a href="mailto:mikkel@cnru.dk" class="">mikkel@cnru.dk</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Dear FieldTrip list<span class=""></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">
<span class=""> </span></p>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
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 class=""></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">
<span class=""> </span></p>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""> For individual surface-based atlases from FreeSurfer, you should specify two
<span class=""></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""> filenames as a cell-array: the first points to the file that contains information<span class=""></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""> with respect to the parcels' labels, the second points to the file that defines the<span class=""></span></i></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<i class=""> mesh on which the parcellation is defined.<span class=""></span></i></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">
<span class=""> </span></p>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
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 class="">unrecognized filetype 'freesurfer_annot'.</i>“ I get a similar error when I try to read Freesurfer “label” files.<span class=""></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">
<span class=""> </span></p>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
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 class=""></span></div>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:"Calibri",sans-serif">
<span class=""> </span></p>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Best regards<span class=""></span></div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
Mikkel</div>
<div style="margin: 0cm 0cm 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;" class="">
<br class="">
<span class=""></span></div>
<div class="">
<div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">
<div dir="ltr" class="">
<div class=""><font size="1" class=""><span style="font-family:arial,helvetica,sans-serif" class="">Mikkel C. Vinding<br class="">
NatMEG, Karolinska Institutet<b class=""><br class="">
</b>Nobels väg 9<br class="">
171 77 Stockholm, Sweden<b class=""><br class="">
</b>Email: <a href="mailto:mikkel.vinding@ki.se" target="_blank" class="">mikkel.vinding@ki.se</a><b class=""><br class="">
</b></span></font></div>
</div>
</div>
</div>
</div>
_______________________________________________<br class="">
fieldtrip mailing list<br class="">
<a href="https://mailman.science.ru.nl/mailman/listinfo/fieldtrip" class="">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</a><br class="">
https://doi.org/10.1371/journal.pcbi.1002202<br class="">
</div>
</blockquote>
</div>
<br class="">
</div>
</body>
</html>