Deep-MI / FastSurfer

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

Bias correction & pre-computed brain mask #458

Closed andyshieh closed 8 months ago

andyshieh commented 8 months ago

Question/Support Request

Thank you the FastSurfer team for creating such a wonderful tool. I have two questions regarding its usage.

  1. If we provided a full T1 image that has already been bias corrected using ANTs N4BiasCorrection module, is it safe to use the --no_biasfield option to run FastSurfer, or does the --no_biasfield option performs additional steps that may influence the results?

  2. Is there a way to provide pre-computed whole brain mask to FastSurfer to either speed up the computation or regularize the segmentation result?

Thank you.

dkuegler commented 8 months ago
  1. The no_biasfield option just deactivates the bias field as part of the segmentation pipeline (used for example for asegdkt.stats and cerebellum.stats) Also note, that our bias field correction is not just that, it also has some normalization steps (see the recon_surf/N4_bias_correct.py script). If not done in the segmentation pipeline, the bias field correction is always computed in the surface pipeline because of these normalization steps.
  2. Not really. We compute the mask from the segmentation result. That is very fast. Also, I am not sure if there are skull-stripped images in the training datasets at all, so it would likely only be hurting to apply the mask. Maybe you could use it to QC, but I don't really see a real use case for the mask.
andyshieh commented 8 months ago

Got it. Thank you very much @dkuegler for the prompt response.

m-reuter commented 8 months ago
  1. you can just input the bias corrected image, our code will do the bias correction again and additionally the intensity scaling which is needed for partial volume and surfaces. This is actually one of the possible "edits" when things don't look good, to do bias field removal as pre-processing, especially for strong bias fields (e.g. on 7T heavy correction is needed and the N4 in Ants is not enough).
  2. You can use your brain mask for the surface pipeline. This is another possible "edit". Sometimes this can help improve surface placement, e.g. when the CNN based segmentation is too tight or too wide. For that you just run the segmentation alone, replace the brain mask file and then run the surface module.

See https://github.com/Deep-MI/FastSurfer/blob/dev/EDITING.md

andyshieh commented 8 months ago

Thank you @m-reuter . This is extremely helpful. Cheers!