scil_tractogram_segment_bundles.py

usage: __main__.py [-h] [--out_dir OUT_DIR]
                   [--minimal_vote_ratio MINIMAL_VOTE_RATIO] [--seed SEED]
                   [--inverse] [--reference REFERENCE] [--processes NBR]
                   [-v [{DEBUG,INFO,WARNING}]] [-f]
                   in_tractograms [in_tractograms ...] in_config_file
                   in_directory in_transfo

Compute BundleSeg & supports multi-atlas & multi-parameters (RBx-like).
The model needs to be cleaned and lightweight.
Transform should come from ANTs: (using the --inverse flag)
AntsRegistrationSyNQuick.sh -d 3 -m MODEL_REF -f SUBJ_REF

If you are not sure about the transformation 'direction' you can try
scil_tractogram_segment_bundles.py (with the -v option), a warning will popup
if the provided transformation is not used correctly.

The number of folders inside 'models_directories' will increase the number of
runs. Each folder is considered like an atlas and bundles inside will initiate
more BundleSeg executions. The more atlases you have, the more robust the
recognition will be.

--minimal_vote_ratio is a value between 0 and 1. If you have 5 input model
directories and a minimal_vote_ratio of 0.5, you will need at least 3 votes

Example data and usage available at: https://zenodo.org/record/7950602

For RAM usage, it is recommanded to use this heuristic:
    (size of inputs tractogram (GB) * number of processes) < RAM (GB)
This is important because many instances of data structures are initialized
in parallel and can lead to a RAM overflow.

Formerly: scil_recognize_multi_bundles.py

positional arguments:
  in_tractograms        Input tractogram filename (.trk or .tck).
  in_config_file        Path of the config file (.json)
  in_directory          Path of parent folder of models directories.
                        Each folder inside will be considered as adifferent atlas.
  in_transfo            Path for the transformation to model space (.txt, .npy or .mat).

options:
  -h, --help            show this help message and exit
  --out_dir OUT_DIR     Path for the output directory [voting_results].
  --minimal_vote_ratio MINIMAL_VOTE_RATIO
                        Streamlines will only be considered for saving if
                        recognized often enough [0.5].
  --seed SEED           Random number generator seed 0.
  --inverse             Use the inverse transformation.
  --reference REFERENCE
                        Reference anatomy for tck/vtk/fib/dpy file
                        support (.nii or .nii.gz).
  --processes NBR       Number of sub-processes to start.
                        Default: [1]
  -v [{DEBUG,INFO,WARNING}]
                        Produces verbose output depending on the provided level.
                        Default level is warning, default when using -v is info.
  -f                    Force overwriting of the output files.

[1] St-Onge, Etienne, Kurt G. Schilling, and Francois Rheault.
"BundleSeg: A versatile,reliable and reproducible approach to white
matter bundle segmentation." International Workshop on Computational
Diffusion MRI. Cham: Springer Nature Switzerland (2023)