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
Inputs
Section titled “Inputs”Input 1
Section titled “Input 1”Format : tuple val(meta), path(metrics), path(rois), path(rois_lut)
| Type | Description | Mandatory | Pattern | |
|---|---|---|---|---|
| meta | map | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] | True | |
| metrics | file | Metrics volume(s) in Nifti | True | *.{nii,nii.gz} |
| rois | file | ROI or Label volume(s) in Nifti | True | *.{nii,nii.gz} |
| rois_lut | file | LUT file corresponding to labels, used to name the regions of interest | False | *.{nii,nii.gz} |
Outputs
Section titled “Outputs”stats_json
Section titled “stats_json”Format : tuple val(meta), path(*.json)
| Type | Description | Mandatory | Pattern | |
|---|---|---|---|---|
| meta | map | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] | True | |
| *.json | file | JSON file containing mean/std per pair of roi/metrics or label/metrics | True | *.json |
stats_mean
Section titled “stats_mean”Format : tuple val(meta), path(*_desc-mean_*.{csv,tsv})
| Type | Description | Mandatory | Pattern | |
|---|---|---|---|---|
| meta | map | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] | True | |
| desc-mean.{csv,tsv} | file | Tabular 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} |
stats_std
Section titled “stats_std”Format : tuple val(meta), path(*_desc-std_*.{csv,tsv})
| Type | Description | Mandatory | Pattern | |
|---|---|---|---|---|
| meta | map | Groovy Map containing sample information e.g. [ id:'test', single_end:false ] | True | |
| desc-std.{csv,tsv} | file | Tabular 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} |
versions
Section titled “versions”Format : path(versions.yml)
| Type | Description | Mandatory | Pattern | |
|---|---|---|---|---|
| versions.yml | file | File containing software versions | True | versions.yml |
Arguments (see process.ext)
Section titled “Arguments (see process.ext)”| Type | Description | Default | Choices | |
|---|---|---|---|---|
| suffix | string | It will add an extra string before “_stats.json” | ||
| bin | boolean | If 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_weights | boolean | If set, the weights will be normalized to the [0,1] range. It will be used if use_label is false. | False | |
| use_label | boolean | If set, rois image will be considered as a label image with multiple indices. | False | |
| key_substrs_to_remove | string | Groovy 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_remove | string | Groovy 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_format | string | Output format for the tabular stats file. | tsv | - csv - tsv |
| meta_columns | list | List 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. | [] |
| Description | DOI | |
|---|---|---|
| scilpy | The Sherbrooke Connectivity Imaging Lab (SCIL) Python dMRI processing toolbox. |
Authors
Section titled “Authors”Last updated : 2025-12-22