LONG: long_fastsurfer.sh

Note

Please also see the documentation on Longitudinal Processing.

Usage help text

$ ./long_fastsurfer.sh --help
Setting ENV variable FASTSURFER_HOME to script directory /home/runner/work/FastSurfer/FastSurfer/src. 
Change via environment to location of your choice if this is undesired (export FASTSURFER_HOME=/dir/to/FastSurfer)

Usage: long_fastsurfer.sh --tid <tid> --t1s <T1_1> <T1_2> .. --tpids <tID1> <tID2> .. [OPTIONS]

long_fastsurfer.sh takes a list of T1 full head image and sequentially creates:
     (i)   a template directory for the specific person
     (ii)  directories for each processed time point in template space,
           here you find the final longitudinal results

FLAGS:

  --tid <templateID>        ID for person-specific template directory inside
                              $SUBJECTS_DIR to be created"
  --t1s <T1_1> <T1_2> ..    T1 full head inputs for each time point (do not need
                              to be bias corrected). Requires ABSOLUTE paths!
  --tpids <tID1> <tID2> ..  IDs for future time points directories inside
                              $SUBJECTS_DIR to be created later (during --long)
  --t2s <T2_1> <T2_2> ..    *Optional* T2 full head inputs, one per time point in
                              the order of --tpids, for the hypothalamus module.
                              Every time point needs one, or none does. Each is
                              registered to its time point's T1 in template space,
                              or with --reg_mode none, taken as co-registered with
                              the T1 given in --t1s and mapped into template space
                              with that T1's transform. Only the long_seg stage
                              uses them. Requires ABSOLUTE paths!
  --sd  <subjects_dir>      Output directory $SUBJECTS_DIR (or pass via env var)
  --py <python_cmd>         Command for python, used in both pipelines.
                              Default: "python3 -s"
                              (-s: do no search for packages in home directory)
  -h --help                 Print Help

Stage control:
  --stage <stage>           Run specific stage(s). Can be specified multiple times.
                              Valid stages: prepare, template_seg, template_surf,
                                            long_seg, long_surf, all
                              Default: all (runs full pipeline)

                            Stage dependencies:
                              - prepare: none (requires --t1s and --tpids)
                              - template_seg: prepare
                              - template_surf: prepare, template_seg
                              - long_seg: prepare
                              - long_surf: prepare, template_seg, template_surf, long_seg

                            These take the place of --seg_only and --surf_only:
                              segmentation only: prepare, template_seg, long_seg
                              surfaces only:     template_surf, long_surf
                            A dependency that already exists on disk does not have
                              to be listed again, so drop prepare on a re-run.

Parallelization options:
  All of the following options will activate parallel processing of the template and the longitudinal time-point images
  where possible. Additionally, the number of different processes for segmentation and surface reconstructionis set.
  --parallel <n>|max        See above, sets the size of the processing pool for segmentation and surface reconstruction
  --parallel_seg <n>|max    See above, only sets the size of the processing pool for segmentation (default: 1)
  --parallel_surf <n>|max   See above, only sets the size of the processing pool for surface reconstruction (default: 1)


--t1, --t2 and --sid are not accepted here, they are populated per time point from --t1s, --t2s
and --tpids.
--seg_only and --surf_only are not accepted either, pick the stages above instead. Every other
run_fastsurfer.sh option is supported, see 'run_fastsurfer.sh --help'.


REFERENCES:

If you use this for research publications, please cite:

For FastSurfer (both):
Henschel L, Conjeti S, Estrada S, Diers K, Fischl B, Reuter M, FastSurfer - A
 fast and accurate deep learning based neuroimaging pipeline, NeuroImage 219
 (2020), 117012. https://doi.org/10.1016/j.neuroimage.2020.117012

Henschel L*, Kuegler D*, Reuter M. (*co-first). FastSurferVINN: Building
 Resolution-Independence into Deep Learning Segmentation Methods - A Solution
 for HighRes Brain MRI. NeuroImage 251 (2022), 118933. 
 http://dx.doi.org/10.1016/j.neuroimage.2022.118933

And for longitudinal processing:
Reuter M, Schmansky NJ, Rosas HD, Fischl B. Within-subject template estimation
 for unbiased longitudinal image analysis, NeuroImage 61:4 (2012).
 https://doi.org/10.1016/j.neuroimage.2012.02.084

For cerebellum sub-segmentation:
Faber J*, Kuegler D*, Bahrami E*, et al. (*co-first). CerebNet: A fast and
 reliable deep-learning pipeline for detailed cerebellum sub-segmentation.
 NeuroImage 264 (2022), 119703.
 https://doi.org/10.1016/j.neuroimage.2022.119703

For hypothalamus sub-segemntation:
Estrada S, Kuegler D, Bahrami E, Xu P, Mousa D, Breteler MMB, Aziz NA, Reuter M.
 FastSurfer-HypVINN: Automated sub-segmentation of the hypothalamus and adjacent
 structures on high-resolutional brain MRI. Imaging Neuroscience 2023; 1 1–32.
 https://doi.org/10.1162/imag_a_00034