scil_bundle_diameter.py

usage: __main__.py [-h] [--fitting_func {lin_up,lin_down,exp,inv,log}]
                   [--show_rendering | --save_rendering OUT_FOLDER]
                   [--wireframe] [--error_coloring] [--width WIDTH]
                   [--opacity OPACITY] [--win_dims WIDTH HEIGHT]
                   [--background R G B] [--reference REFERENCE]
                   [--indent INDENT] [--sort_keys] [-v [{DEBUG,INFO,WARNING}]]
                   [-f]
                   in_bundles [in_bundles ...] in_labels [in_labels ...]

Script to estimate the diameter of bundle(s) along their length.
See also scil_bundle_shape_measures.py, which prints a quick estimate of
the diameter (volume / length). The computation here is more complex and done
for each section of the bundle.

The script expects:
- bundles with coherent endpoints from scil_tractogram_uniformize_endpoints.py
- labels maps with around 5-50 points scil_bundle_label_map.py
    <5 is not enough, high risk of bad fit
    >50 is too much, high risk of bad fit
- bundles that are close to a tube
    without major fanning in a single axis
    fanning is in 2 directions (uniform dispersion) good approximation

The scripts prints a JSON file with mean/std to be compatible with tractometry.
WARNING: STD is in fact an ERROR measure from the fit and NOT an STD.

Since the estimation and fit quality is not always intuitive for some bundles
and the tube with varying diameter is not easy to color/visualize,
the script comes with its own VTK rendering to allow exploration of the data.
(optional).

Formerly: scil_estimate_bundles_diameter.py

positional arguments:
  in_bundles            List of tractography files.
  in_labels             List of labels maps that match the bundles.

options:
  -h, --help            show this help message and exit
  --fitting_func {lin_up,lin_down,exp,inv,log}
                        Function to weigh points using their distance.
                        [Default: None]
  --reference REFERENCE
                        Reference anatomy for tck/vtk/fib/dpy file
                        support (.nii or .nii.gz).
  -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.

Visualization options:
  --show_rendering      Display VTK window (optional).
  --save_rendering OUT_FOLDER
                        Save VTK render in the specified folder (optional)
  --wireframe           Use wireframe for the tube rendering.
  --error_coloring      Use the fitting error to color the tube.
  --width WIDTH         Width of tubes or lines representing streamlines
                        [Default: 0.2]
  --opacity OPACITY     Opacity for the streamlines rendered with the tube.
                        [Default: 0.2]
  --win_dims WIDTH HEIGHT
                        The dimensions for the vtk window. [(1920, 1080)]
  --background R G B    RBG values [0, 255] of the color of the background.
                        [Default: [1, 1, 1]]

Json options:
  --indent INDENT       Indent for json pretty print.
  --sort_keys           Sort keys in output json.