Skip to content

stats_metricsinroi

Module to compute statistics (mean, std) of scalar maps (metrics), which can represent diffusion metrics, in ROIs or labels.

Keywords : nifti, volume, scilpy, stats, rois


Format : tuple val(meta), path(metrics), path(rois), path(rois_lut)

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'test', single_end:false ]True
metricsfileMetrics volume(s) in NiftiTrue*.{nii,nii.gz}
roisfileROI or Label volume(s) in NiftiTrue*.{nii,nii.gz}
rois_lutfileLUT file corresponding to labels, used to name the regions of interestFalse*.{nii,nii.gz}

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

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'test', single_end:false ]True
*.jsonfileJSON file containing mean/std per pair of roi/metrics or label/metricsTrue*.json

Format : tuple val(meta), path(*_desc-mean_*.{csv,tsv})

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'test', single_end:false ]True
desc-mean.{csv,tsv}fileTabular file containing rows of (sample, roi, mean_metric1, mean_metric2, …). Can be either TSV or CSV depending on the output_format argument.True*_desc-mean_*.{csv,tsv}

Format : tuple val(meta), path(*_desc-std_*.{csv,tsv})

TypeDescriptionMandatoryPattern
metamapGroovy Map containing sample information e.g. [ id:'test', single_end:false ]True
desc-std.{csv,tsv}fileTabular file containing rows of (sample, roi, std_metric1, std_metric2, …). Can be either TSV or CSV depending on the output_format argument.True*_desc-std_*.{csv,tsv}

Format : path(versions.yml)

TypeDescriptionMandatoryPattern
versions.ymlfileFile containing software versionsTrueversions.yml

TypeDescriptionDefaultChoices
suffixstringIt will add an extra string before “_stats.json”
binbooleanIf set, will consider every value of the mask higherthan 0 to be part of the mask (equivalent weighting for every voxel). It will be used if use_label is false.False
normalize_weightsbooleanIf set, the weights will be normalized to the [0,1] range. It will be used if use_label is false.False
use_labelbooleanIf set, rois image will be considered as a label image with multiple indices.False
key_substrs_to_removestringGroovy list of strings to remove from the metric keys in the JSON. This is useful to clean or shorten the bundle names that will appear in the output JSON/CSV. e.g. ”[‘_mask’, ‘_warped’] will turn ‘CST_mask_warped’ into ‘CST‘“None
value_substrs_to_removestringGroovy list of strings to remove from the metric values in the JSON. This is useful to clean or shorten the metric names that will appear in the output JSON/CSV. e.g. ”[‘sub-01’, ‘_metric’] will turn ‘sub-01_fa_metric’ into ‘fa‘“None
output_formatstringOutput format for the tabular stats file.tsv- csv
- tsv
meta_columnslistList of keys from the meta map to add as extra columns in the tabular stats files. e.g. ['age', 'laterality'] will add two columns with the corresponding names and values for each sample taken from the input meta map. This is particularly useful to add covariates such as the age, laterality, diagnosis, etc. of each subject. If the key is not found in the meta map, an empty value will be used.[]

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


Last updated : 2025-12-22