Skip to content

tractometry

This workflow processes tractograms and associated data to clean, resample, and extract meaningful statistics. It requires three mandatory inputs and two optional : a set of tractogram bundles, centroids used for resampling or identification, various diffusion metrics associated with the tractography, a lesion probability mask (optional) and fixel-based FODF data (optional). The workflow performs key preprocessing and analysis steps such as invalid streamline removal, resampling, label map creation, uniformization, and statistical extraction. The final output includes various tractography-related statistics, which can be used for further analysis. You can retrieve intermediate outputs, but the subworkflow will run in its entirety nonetheless.

----------- Steps -----------

1. Remove invalid streamlines from bundles
Ensures that bundles are cleaned before further processing.

2. Fixel-Based Apparent Fiber Density
Use fodf to compute mean apparent fiber density (AFD) and mean radial radial fODF (radfODF) maps along a bundle. Requires both the cleaned tractogram and FODF data.

3. Centroid Processing or Resampling
If centroids are available, resamples the centroids. If centroids are missing, computes centroids from cleaned bundles.

4. Label Map Generation
Compute the label image (Nifti) from a centroid and tractograms (all representing the same bundle). The label image represents the coverage of the bundle, segmented into regions labelled from 0 to —nb_pts, starting from the head, ending in the tail. Each voxel will have the label of its nearest centroid point. The number of labels will be the same as the centroid’s number of points. Generates labeled tractograms and individual bundle masks.

5. Streamline Uniformization
Normalizes the labeled tractograms to ensure consistency.

6. Statistical Analysis
Computes various statistics, including Streamline length distributions. Endpoint-based metrics. Volume measurements, both global and lesion-specific. Mean and standard deviation of diffusion metrics per bundle.

Output The final outputs include various statistics relevant to tractometry analysis, which can be used for further exploration or reporting.

Keywords : Tractometry, Profile, Segmentation, Bundles, Statistics

Components : tractogram/removeinvalid, bundle/fixelafd, tractogram/resample, bundle/centroid, bundle/labelmap, bundle/uniformize, bundle/stats


TypeDescriptionMandatoryPattern
ch_bundlesfileChannel containing all the segmented bundle files.

Structure : tuple val(meta), path(bundles)
  • meta [map] Metadata map.
  • bundles [file] List of bundle tractogram files.
True*.trk
ch_centroidsfileChannel containing all the segmented centroids files.

Structure : tuple val(meta), path(centroids)
  • meta [map] Metadata map.
  • centroids [file] List of centroid tractogram files.
True*.trk
ch_metricsfileChannel containing nifti file to compute statistics on. Probably some tractometry measure(s) such as FA, MD, RD, … The metrics has to follow a specific naming convention.

Structure : tuple val(meta), path(metrics)
  • meta [map] Metadata map.
  • metrics [file] List of metric image files.
True*.nii.gz
ch_lesion_maskfileChannel containing lesion volume to compute statistics on. The lesion mask must be a binary mask.

Structure : tuple val(meta), path(lesion)
  • meta [map] Metadata map.
  • lesion [file] Lesion mask image file.
True*.nii.gz
ch_fodffileChannel containing fODF file to extract fixel measurements from.

Structure : tuple val(meta), path(fodf)
  • meta [map] Metadata map.
  • fodf [file] fODF image file.
True*.nii.gz

TypeDescriptionMandatoryPattern
stats_lengthfileInformation on a tractogram, number of streamlines, mean / min / max / std of length in number of points, length in mm and step size.

Structure : tuple val(meta), path(length)
  • meta [map] Metadata map.
  • length [file] Length statistics JSON file.
True*__length_stats.json
stats_endpoints_rawfileEstimation of the cortical area affected by the bundle (assuming streamlines start/end in the cortex).

Structure : tuple val(meta), path(endpoints_raw)
  • meta [map] Metadata map.
  • endpoints_raw [file] Endpoints raw statistics JSON file.
True*__endpoints_map_raw.json
stats_endpoints_metricfileCompute the statistics of metrics at the bundle endpoint map.

Structure : tuple val(meta), path(endpoints_metric)
  • meta [map] Metadata map.
  • endpoints_metric [file] Endpoints metric statistics JSON file.
True*__endpoints_metric_stats.json
stats_mean_stdfileAverage the metric values of all voxels occupied by the bundle.

Structure : tuple val(meta), path(mean_std)
  • meta [map] Metadata map.
  • mean_std [file] Mean and standard deviation statistics JSON file.
True*__mean_std.json
stats_volumefileEvaluate basic measurements of bundle(s).

Structure : tuple val(meta), path(volume)
  • meta [map] Metadata map.
  • volume [file] Volume statistics JSON file.
True*__volume.json
stats_volume_lesionsfileCompute bundle volume in each lesions in mm3.

Structure : tuple val(meta), path(volume_lesions)
  • meta [map] Metadata map.
  • volume_lesions [file] Volume lesions statistics JSON file.
True*__volume_lesion.json
stats_streamline_countfileReturn the number of streamlines in a tractogram.

Structure : tuple val(meta), path(streamline_count)
  • meta [map] Metadata map.
  • streamline_count [file] Streamline count statistics JSON file.
True*__streamline_count.json
stats_streamline_count_lesionsfileReturn the number of streamlines in each lesions.

Structure : tuple val(meta), path(streamline_count_lesions)
  • meta [map] Metadata map.
  • streamline_count_lesions [file] Streamline count lesions statistics JSON file.
True*__streamline_count_lesions.json
stats_volume_per_labelsfileCompute 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.

Structure : tuple val(meta), path(volume_per_labels)
  • meta [map] Metadata map.
  • volume_per_labels [file] Volume per labels statistics JSON file.
True*__volume_per_label.json
stats_volume_per_labels_lesionsfileCompute bundle volume per label in each lesions in mm3.

Structure : tuple val(meta), path(volume_per_labels_lesions)
  • meta [map] Metadata map.
  • volume_per_labels_lesions [file] Volume per labels lesions statistics JSON file.
True*__volume_per_label_lesions.json
stats_mean_std_per_pointfileAverage the metric values of all voxels occupied by the bundle per label.

Structure : tuple val(meta), path(mean_std_per_point)
  • meta [map] Metadata map.
  • mean_std_per_point [file] Mean and standard deviation per point statistics JSON file.
True*__mean_std_per_point.json
stats_lesion_statsfileFile of the lesion-wise volume measure.

Structure : tuple val(meta), path(lesion_stats)
  • meta [map] Metadata map.
  • lesion_stats [file] Lesion statistics JSON file.
True*_lesion_stats.json
endpoints_headfileEndpoint head map of bundle. The endpoint head map is simply a count of the number of streamlines that start in each voxel.

Structure : tuple val(meta), path(endpoints_head)
  • meta [map] Metadata map.
  • endpoints_head [file] Endpoints head image file.
True*.nii.gz
endpoints_tailfileEndpoint tail map of bundle. The endpoint tail map is simply a count of the number of streamlines that end in each voxel.

Structure : tuple val(meta), path(endpoints_tail)
  • meta [map] Metadata map.
  • endpoints_tail [file] Endpoints tail image file.
True*.nii.gz
lesion_mapfileNifti files of labelized lesion(s) map for each bundles.

Structure : tuple val(meta), path(lesion_map)
  • meta [map] Metadata map.
  • lesion_map [file] Lesion map image file.
True*.nii.gz
mean_lesions_tsvfileTSV file regrouping all bundle stats in lesionsTrue*_desc-mean_param-lesions_stats.tsv
mean_per_point_lesions_tsvfileTSV file regrouping all bundle per points stats with lesionsTrue*_desc-point_param-lesions_stats.tsv
mean_tsvfileTSV file regrouping all bundle statsTrue*_desc-mean_stats.tsv
mean_per_point_tsvfileTSV file regrouping all bundle per points statsTrue*_desc-point_stats.tsv


Last updated : 2026-03-17