Deep-MI / FastSurfer

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

Could we use our own atlas for brain segmentation using FastSurfer? #315

Closed AXu0511 closed 1 year ago

AXu0511 commented 1 year ago

Question/Support Request

Maybe I have missed it, but could we use our own atlas for brain segmentation using FastSurfer? If possible, could you please tell me specifically how to operate it? Looking forward to your reply soon.

LeHenschel commented 1 year ago

Hey,

overall, there are two potential ways you can do that.

1.) you can retrain the networks on data with your own atlas as ground truth. 2.) if the atlas is defined on FSAVERAGE you can align the generated surfaces to it with sphere.reg and map the labels to the subjects (similar to how the original surface parcellation is done in FreeSurfer e.g.).

Kind regards, Leonie

AXu0511 commented 1 year ago

Hello,

If my atlas is defined on FSAVERAGE, can I use my atlas for segmentation in FreeSurfer? If so, what command should I use to replace the atlas? If my atlas is not defined on FSAVERAGE, is there any solution to transform it to be defined on FSAVERAGE? Kind regards, AXu

LeHenschel commented 1 year ago

Can you be a bit more specific what you actually want to do in the end (Do you want FastSurferCNN to return your segmentations or you are fine with running the surface pipeline as well?)?

If your atlas is on FSAVERAGE you can use the mris_ca_label from FreeSurfer to get a parcellation of the surfaces: [mris_ca_label](https://surfer.nmr.mgh.harvard.edu/fswiki/mris_ca_label) ../label/lh.cortex.label -aseg aseg.presurf.mgz <subjid> ?h ?h.sphere.reg $ATLAS_HOME/?h.YOURATLAS.gcs ../label/?h.aparc.YOURATLAS.annot

To prepare such an atlas from annotated labels see https://surfer.nmr.mgh.harvard.edu/fswiki/mris_ca_train

AXu0511 commented 1 year ago

In fact, I hope to obtain a segmentation map that is consistent with the segmented regions of my atlas through FastSurfer or FreeSurfer. I noticed that using FastSurfer or FreeSurfer can generate many different segmentation maps, but I am not particularly interested in the structures of certain brain regions in these results. Therefore, I am curious if there is a way to use my own atlas as a segmentation template to obtain segmented maps with consistent segmentation regions.

LeHenschel commented 1 year ago

Ok, if you do not want to retrain you can use the commands I posted above to get your own atlas segmentations. This works with both FastSurfer and FreeSurfer output.

AXu0511 commented 1 year ago

Thanks a lot. I will try both methods and If I successfully obtain the segmentation I want, I will close this issue.

RDoerfel commented 1 year ago

Hi, I'm sorry for hijacking this issue, but I think my issue is rather similar, and I would like to confirm.

Is it possible to get parcellations and respective stats for other atlases than the DKT atlas? More specifically, I'm talking about the HCP (Glasser) atlas.

LeHenschel commented 1 year ago

Yes, the commands above should work for any atlas in theory (as long as it is defined on FSAVERAGE, as the registration of the subject surfaces to it already exists (=sphere.reg)).

RDoerfel commented 1 year ago

Awesome, thank you!