MNE Python and CAT12

Dear experts,

I’m quite new to MNE python and I’m trying to migrate to it from Fieldtrip for MEG analysis.

My question regards the anatomical reconstructions.

I have a large dataset with anatomy (surfaces t co) extracted with the Computational anatomy Toolbox (CAT12). There is a way to use those anatomical reconstructions in MNE python, without re-running everything in FreeSurfer?

Thank you very much in advance !

Davide.

1 Like

hi,

MNE is really meant to work smoothly with freesurfer. It’s not impossible but it’s clearly
not easy and would require a deep understanding of the MNE internals. I would suggest
to rerun with freesurfer.

Alex

Thank you Alex for your quick answer !

Actually, the dataset consists in something like 1200 subjects … so it will be very difficult to re-run everything in FreeSurfer !

Do you think it is very complex? There are guides on the topic? What about using low level anatomical objects loading and then run the analysis? I’m quite good in programming, coming from C++, and I’m not afraid of “complex things”.

Otherwise I’m afraid that re-running everything n FreeSurfer will be not possible and therefore impossible for me to switch to MNE Python (something I would really do :(((( … ).

Thank you again and have a nice day !

Davide

(caveat: I have no experience with CAT12 so I may say something naive).

My feeling is that if @DavideTabarelli is able and motivated to work on this, it would be a useful thing to have in MNE to be able to read CAT12 surfaces. But I wonder if it’s already possible? I poked around on CAT12 Manual and found a section called

Surfaces in (normalized) template space (after resampling and smoothing; saved in subfolder “surf” by default)

and there they say there is a surface

RESAMP resampling to 164k (Freesurfer) or 32k (HCP) mesh [ resampled | resampled_32k ]

might it work to (generate those if they’re not automatically generated, and then) load those with mne.read_surface — MNE 1.7.0.dev6+g6c6e6ec6d documentation?

If that doesn’t work, then I think we should at least talk through what it would take to get something that does work. WDYT @larsoner?

It sounds like you can probably/hopefully use the surf files. I don’t know if CAT12 provides everything you need like lh.white, lh.sphere, lh.sphere.reg, etc. but hopefully it does! That would cover the surface source space end of things.

Then from the BEM end of things if they create suitably smooth and decimated freesurfer-format inner/outer skull and scalp surfaces then you should be good to go, but I doubt it. MNE-Python can create these surfaces for you using mne.bem.make_watershed_bem — MNE 1.3.1 documentation for example.

Thank you all for the answers and suggestions !

The main topic here is how to analyze big datasets (like the CamCAN or others) that provides MEG and need for reconstructing surfaces from a large amount of MRI data (~700 or more).

I tried the FreeSurfer approach but is not feasible fr two reasons:

  1. The time required for computation is too large
  2. FreeSurfer (at least on CamCAN data) dial reconstructions usually contains defects, especially in the somatosensory part of the cortex. These pail defects can not be automatically (in my experience) solved by using, for example, a T2 image for dial surface reconstruction improvement. A manual correction with more than 700 subjects is, of course, impossible.

I tried FastSurfer (a deep learning based approach that provides the same output as FreeSurfer with a computational time comparable to the one of CAT12) but the problem 2) still holds.

In my experience, the best approach was the SPM based Computational Anatomy Toolbox (CAT12).

I was successful in using the CAT12 surfaces reconstructions for inverse modeling in Brainstorm and in Fieldtrip but, so far, not in MNE python, which is the tool I aim to use right now.

CAT12 extract a “central” surface, i.e: a mesh of the cortical mantle in between the pial and the white surfaces, in native space. It also provides white surface, the registered spheres in a fully FreeSurfer compatible format etc …

The name of the files are lh.central, lh.white, lh.sphere, lh.sphere.reg etc …

My aim, now, is to

  1. Use those surfaces as a source model in MNE python
  2. Find a way (avoiding a full recon-all) to generate the other BEM surfaces (skull and scalp)
  3. Understand which MNE python functions I can use to put everything together and compute a forward/inverse model in MNE python.

Thank you all for the useful suggestions !

Davide

fair enough.

have you tried to put these files in a subject directory mapping freesurfer layout of the files?
then try the mne forward model and let me know what error you get.

Alex

Dear all,

Are there any progress in this matter?

@DavideTabarelli could you finally use CAT12 segmentation with MNE?

Thanks in advance,

Hi,

yes I tried but it was terribly complicated (lot of errors). I think Alexander was right. MNE is really intended to work with FreeSurfer outputs. finally I re-run my analysis using FastSurfer to obtain a fully compatible FreeSurfer anatomica output.

Best

Davide

1 Like

If someone can run CAT12 on MNE-Python’s sample subject that might help. Then we could see if it’s possible to create a reasonable BEM + forward + inverse using those files.

Hi Eric,

Apologies for the misunderstanding with nibabel issue.

In this link, I leave the results of a CAT12 segmentation process on the MNE sample subject downloaded from OpenNeuro.

Thanks for giving it a thought.

I upvote this, as would add a lot of functionnalities to MNE python