Deep-MI / FastSurfer

PyTorch implementation of FastSurferCNN
Apache License 2.0
459 stars 120 forks source link

Integration with Brainstorm #85

Closed ftadel closed 2 years ago

ftadel commented 2 years ago

Dear colleagues,

We've been interfacing FastSurfer with Brainstorm: https://neuroimage.usc.edu/brainstorm

It's now possible to call the FastSurfer pipeline directly from the Brainstorm interface or from a Brainstorm script. The process function that calls the FastSurfer pipeline: https://github.com/brainstorm-tools/brainstorm3/blob/master/toolbox/process/functions/process_segment_fastsurfer.m

The corresponding online tutorial on the Brainstorm website: https://neuroimage.usc.edu/brainstorm/Tutorials/SegFastSurfer

This is based on our FreeSurfer tutorial: https://neuroimage.usc.edu/brainstorm/Tutorials/LabelFreeSurfer

I just have a few questions related with the aparc.mgz volumes:

Please let us know if you have any additional comment. Otherwise, please close this issue - Thanks

m-reuter commented 2 years ago

HI @ftadel , thanks for your great work. We really need to update our documentation to better inform everyone what outputs they should look at. Short answer is aparc.mapped+aseg.mgz and wmparc.mapped.mgz as well as aseg.mgz are the main outputs of the default pipeline, together with their corresponding stats files.

Long answer:

aparc.DKTatlas+aseg.deep.mgz

The segmentation of FastSurferCNN. This is the input segmentation to the recon_surf pipeline. Some users only run the segmentation, then this will be the final one. However, if recon_surf is used, a Corpus Callosum label will be added later. Also both subcortical and cortical segmentations will be updated/improved by using the surfaces for fine-tuning later.

aparc+aseg.orig.mgz

The input segmentation to recon_surf gets converted to mgz file format here. In the default pipeline, the input is already mgz, so this is really only a copy.

aparc.DKTatlas+aseg.deep.withCC.mgz

A few steps into recon-surf we use FreeSurfer to compute the Corpus Callosum label. This label then gets painted into the orignial FastSurferCNN segmentation. Statistics of this are also computed and provided in: stats/aparc.DKTatlas+aseg.deep.volume.stats There are plans to replace FreeSurfer's CC segmentation with a better deep learning solution in the future.

aparc.mapped+aseg.mgz

This file is an updated segmentation (including CC), where the cortical regions (aparc) are mapped from the surfaces back into the volume. Generally a "mapped" in the file name indicates that cortical parcellations are not computed on the cortical surfaces but are mapped from the CNN segmentation onto the surface earlier, e.g. for ROI thickness estimates. The aparc.mapped+aseg.mgz is a volume where both subcortical and cortical labels are corrected by the surfaces, so that no cortical labels should be outside the space between white and pial surface. From this segmentation volume we create a wmparc.mapped.mgz including the additional white matter segmentations. Similarly the aseg.mgz (without cortical parcellations) is updated with the surfaces. Cortical stats are already provided at an earlier stage based on surfaces here: stats/$hemi.aparc.mapped.stats WM stats are here: stats/wmparc.mapped.stats And final aseg stats are here as usual: stats/aseg.stats

aparc+aseg.mgz (OPTIONAL --fsaparc)

If recon-surf was run with the --fsaparc flag, processing is more involved. Here we use FreeSurfers non-linear spherical atlas to actually segment surfaces as done in FreeSurfers recon-all, instead of only mapping FastSurferCNN's volume segmentation onto the cortex. This adds considerable processing time mainly and provides the aparc+aseg.mgz and wmparc.mgz files. In our experiments we were very happy with the mapped results and don't think that spherical segmentation is necessary, which is why it is switched off by default. The spherical registration step, however, is necessary if users want to perform statistics on the surfaces (fsaverage as a group template). It can be switched on by itself without spherical segmentation, via the --surfreg flag.

ftadel commented 2 years ago

Short answer is aparc.mapped+aseg.mgz and wmparc.mapped.mgz as well as aseg.mgz are the main outputs of the default pipeline, together with their corresponding stats files.

Thank you for the explanations. These are the parcellations that are currently selected by our FreeSurfer import functions, therefore we don't have anything to change for reading FastSurfer outputs instead.

The spherical registration step, however, is necessary if users want to perform statistics on the surfaces (fsaverage as a group template). It can be switched on by itself without spherical segmentation, via the --surfreg flag.

We propose this flag by default for all users because we rely on the registered spheres for group analysis (projecting source maps from the subject space to an MNI template space).

Please let us now in the future if you change the output filenames, so that we can update our reading functions.

ftadel commented 2 years ago

Two more questions:

m-reuter commented 2 years ago