Importing Folders from New Freesurfer Versions?

Hello,

I am attempting to import cortical reconstructions from Freesurfer into subjects' anatomy. I was able to import many folders that were created on Freesurfer 5.3.0 without a problem, however, we also have many folders created on a later version of Freesurfer (dev 20180220) that result in the following error when importing:

Error

Does Brainstorm currently accommodate newer versions of Freesurfer? Or could this be an unrelated issue?

Thank you,
Margot

Hi Margot,

I copy your error image here for easier access:

This message is due to unequal dimensions (different number of vertices) between the surface file (surf/lh.pial or lh.white) and the corresponding Brodmann atlas (label/lh.BA.annot).
I don't think any recent of version of FreeSurfer would write non-matching surfaces and textures/labels, I wouldn't know how to interpret that. But if you find any evidence that something has changed between FS6 and this dev version, let me know and I will fix it in Brainstorm.

If it is not an expected change of behavior of FreeSurfer it could be: a manipulation error on your end, or a bug in this development version of FreeSurfer.

Is there any particular reason why you use this version instead of the stable FS6?

Thanks Francois for your answer,

I'm working with Margot - and I want to follow up with her question.

We have a brain scan that ran through one of the most recent developmental versions of FS - and we did this for a separate project in order to retrieve hippocampal and amygdala subfields. As it is, it won't import into Brainstorm and pops out the error that Margot saw. I'm definitely sure it works with FS5.1, which was the initial version of FS we ran it through. We've since then upgraded to FS6.0 dev and now it doesn't.

We've taken that same FS6.0 dev brain and ran it through FS6.0 stable, first through the 2nd and 3rd recon-all steps, and that didn't work, with the same error. I though it would because I imagine it is the 2nd and 3rd step of recon-all that generates the ?h.white and ?h.BA.annot. We just reran the entirety of the 3 reconall steps, and still that error pops up. I'm going to try running it through FS5.3... though I'm hesitant downgrading that much.

I just want to double check, is Brainstorm suppose to be compatible with FS6.0 stable? It sounds like it is, which is troubling. I'm attaching the recon-all log (as you can see in it - it shifts from 5.1 -> 6.0 -> 6.0 dev for the subfield extraction -> 6.0)

update: actually for some reason because I'm a new user I can't upload files, so I'm to try and fix that

Yes, Brainstorm is supposed to work if you run the recon-all from FS 6 stable without any additional parameters. We've already adapted a few things for this release, like the possibility to have higher volume resolutions than 256x256x256. Maybe there are other things to change.

But I don't understand your multiple passes on this subject...
And the error you get seems to indicate that you have a mixture of multiple executions of recon-all (or a mix of different subjects).
Can you simply try to import the original MRI as a new empty subject (recon-all -i) and then process it entirely with FS6 stable (recon-all -all)?
Is it something you reproduced on multiple subjects?

actually for some reason because I'm a new user I can't upload files, so I'm to try and fix that

If you need to post files: upload the somewhere (dropbox, google drive...) and post a download link here.

Here is the recon-all log

We can certainly try running recon-all through the .nii, though this would not be ideal because then we would have to make some brainmask.mgz adjustments that we've already spent a couple of months doing for our dataset of ~600 brains.

I have another brain that we ran through FS6.0 dev but of course it didn't import into Brainstorm.

I found the solution:

Brainstorm calls to import ?h.BA.label by default, which is deprecated after 5.1. FS5.1 and after creates BA labels under ?h.BA_exvivo.label.

In our dataset, we ran it through 5.1 then to 6.0. The vertices between the ?h.white/pial are different between 5.1 and 6.0. Brainstorm is retrieving the 6.0 ?h.white (which FS overwrote the 5.1) and the 5.1 label, hence the error.

A suggestion for Brainstorm developers is to retrieve the exvivo labels if both the exvivo and the deprecated label exist.

1 Like

Does this modification the job? (Update Brainstorm to get it)
https://github.com/brainstorm-tools/brainstorm3/commit/01ae566fd75ecb1949a3b0b080ffa82b20fcc0b7#diff-722fbf53a444d06dab473a739c9348acR152

Thanks for the suggestion

Looks perfect - thanks Francois

1 Like

It works! Thank you so much for your prompt response and help, Francois.

I've checked the import_anatomy_fs.m script for the latest update of Brainstorm and it looks like the modification is still there, so I'm unsure of how I could still be getting the same error.

The Freesurfer folder comes from the same recon-all batch as before, and the recon.log script should look similar to the file Victor uploaded above. I can upload it later if needed.

Any guidance you could provide would be greatly appreciated! I'm not sure how/why the modification import function was able to work for ~40 subjects before failing and producing the same error as before....

Looks like it was an issue with the particular folders I was trying to import, no follow-up is needed. Thank you!

Margot