Skip to content

bundle_stats

Compile statistics on bundle profiles. Uses the data after segmenting the tractogram into different bundles, which in turn are segmented into different sections. This module allows you to perform statistical analysis on bundles using metrics maps. You can choose from several types of statistics. ----------- Available statistics ----------- volume:

  • volume_info: volume, volume_endpoints
  • streamlines_info: streamlines_count, avg_length (in mm or in number of point), average step size, min_length, max_length.
  • shape_info: span, curl, diameter, elongation, surface area, irregularity, end surface area, radius, end surface irregularity, mean_curvature, fractal dimension. ** The diameter, here, is a simple estimation using volume / length. length: number of streamlines, and mean / min / max / std of :
  • length in number of points
  • length in mm
  • step size. endpoints: Computes the endpoint map of a bundle. The endpoint map is simply a count of the number of streamlines that start or end in each voxel. Then, Compute the statistics (mean, std) of scalar maps, which can represent diffusion metrics, in endpoint map. mean std:
  • mean and std for each metric. streamline count:
  • number of streamlines in a tractogram. (as this information is given by the volume stat you can choose to want only the streamlines count by deactivating volume and activating streamlines count.) volume per labels:
  • bundle volume per label in mm3. This script supports anisotropic voxels resolution. Volume is estimated by counting the number of voxel occupied by each label and multiplying it by the volume of a single voxel. mean std per labels:
  • mean and std for each metric along the bundle for each point(labels). **To create label_map and distance_map, see scil_bundle_label_map.py

Keywords : Bundle, Labels, Statistic, Volume, Length, Endpoint, Mean std, Streamlines count, json


Format : tuple val(meta), path(bundles), path(labels_map), path(metrics), path(lesions)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
bundlesfileFiber bundle file to compute statistics on.True*.trk
labels_mapfilelabel map of the corresponding fiber bundle. this file must have the same dimension than bundle file and have datatype in int. If you have multiple bundles, it must have the same numbers of sections.True*.nii.gz
metricsfileNifti file to compute statistics on. Probably some tractometry measure(s) such as FA, MD, RD, … The metrics has to follow a specific naming convention.True*_{bundle_name}_{metric_name}.nii.gz
lesionsfileNifti lesion volume to compute statistics on. The lesion mask must be a binary mask.False*.nii.gz

Format : tuple val(meta), path(*__length_stats.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__length_stats.jsonfileInformation on a bundle(s) : number of streamlines, mean / min / max / std of length in number of points, length in mm and step size.True*__length_stats.json

Format : tuple val(meta), path(*__endpoints_map_raw.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__endpoints_map_raw.jsonfileEstimation of the cortical area affected by the bundle(s) (assuming streamlines start/end in the cortex).True*__endpoints_map_raw.json

Format : tuple val(meta), path(*__endpoints_metric_stats.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__endpoints_metric_stats.jsonfileStatistics of metrics at the bundle(s) endpoints.True*__endpoints_metric_stats.json

Format : tuple val(meta), path(*__mean_std.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__mean_std.jsonfileAverage the metric values of all voxels occupied by the bundle(s).True*__mean_std.json

Format : tuple val(meta), path(*__volume.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__volume.jsonfileVolume occupied by the bundle(s).True*__volume.json

Format : tuple val(meta), path(*__volume_lesions.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__volume_lesions.jsonfileBundle(s) volume in each lesions in mm3.True*__volume_lesion.json

Format : tuple val(meta), path(*__streamline_count.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__streamline_count.jsonfileNumber of streamlines in the bundle(s).True*__streamline_count.json

Format : tuple val(meta), path(*__streamline_count_lesions.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__streamline_count_lesions.jsonfileNumber of streamlines in each lesions.True*__streamline_count_lesions.json

Format : tuple val(meta), path(*__volume_per_label.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__volume_per_label.jsonfileBundle volume per label in mm3. Volume is estimated by counting the number of voxel occupied by each label and multiplying it by the volume of a single voxel.True*__volume_per_label.json

Format : tuple val(meta), path(*__volume_per_label_lesions.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__volume_per_label_lesions.jsonfileBundle(s) volume per label in each lesions in mm3.True*__volume_per_label_lesions.json

Format : tuple val(meta), path(*__mean_std_per_point.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__mean_std_per_point.jsonfileAverage metric values of all voxels occupied by the bundle per label.True*__mean_std_per_point.json

Format : tuple val(meta), path(*__lesion_stats.json)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*__lesion_stats.jsonfileLesion-wise volume measure.True*__lesion_stats.json

Format : tuple val(meta), path(*_endpoints_map_head.nii.gz)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*_endpoints_map_head.nii.gzfileEndpoint head map of bundle. The endpoint head map is simply a count of the number of streamlines that start in each voxel.True*__endpoints_map_head.nii.gz

Format : tuple val(meta), path(*_endpoints_map_tail.nii.gz)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*_endpoints_map_tail.nii.gzfileEndpoint tail map of bundle. The endpoint tail map is simply a count of the number of streamlines that end in each voxel.True*__endpoints_map_tail.nii.gz

Format : tuple val(meta), path(*_lesion_map.nii.gz)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'sample1', single_end:false ]True
*_lesion_map.nii.gzfileNifti files of labeled lesion(s) map for each bundles.True*__lesion_map.nii.gz

Format : path(versions.yml)

TypeDescriptionMandatoryPattern
versions.ymlfileFile containing software versionsTrueversions.yml

TypeDescriptionDefaultChoices
density_weightingbooleanIf set, weights statistics by the number of fibers passing through each voxel.False
normalize_weightsbooleanIf set, the weights will be normalized to the [0,1] range.False
length_statsbooleanIf set, compute the length stats of the streamlines.True
endpointsbooleanIf set, compute the endpoint map of the bundle.False
mean_stdbooleanIf set, compute the mean and std of the metrics along the bundle.False
volumebooleanIf set, compute the volume of the bundle(s).False
lesions_statsbooleanIf set, compute the statistics of the lesion volume.False
min_lesion_volintMinimum volume of a lesion to be considered (mm).7
streamline_countbooleanIf set, compute the number of streamlines in a bundle.False
volume_per_labelsbooleanIf set, compute bundle volume per label in mm3.False
mean_std_per_pointbooleanIf set, compute the mean and std of the metrics along the bundle for each point(labels).False

DescriptionDOI
scilpyThe Sherbrooke Connectivity Imaging Lab (SCIL) Python dMRI processing toolbox.


Last updated : 2025-10-30