tractography — tractography backends and parameters#
Schema: TractographyConfig in src/thesis/core/config/validators.py. Drives the ProbTrackX2 (hcp) and MRtrix3 (mrtrix3) standalone workflows and the unified tract_synthseg meta-workflow (backend per method). Fields not relevant to the selected method are ignored.
General#
Field |
Type |
Default |
Constraints |
Description |
|---|---|---|---|---|
|
|
|
one of |
Tractography engine. |
|
|
|
— |
Optional workflow-level toggle (interpreted by HCP-style workflows). |
|
|
|
one of |
Hemisphere selection. |
|
|
|
|
Nipype scheduler memory hint (GB) for GPU tractography nodes. |
|
|
|
|
Nipype scheduler memory hint (GB) for CPU tractography nodes. |
|
|
|
— |
Whether to consume waypoint masks during tractography. |
ROIs and waypoints#
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Direct mapping of waypoint name → mask path (legacy single-atlas setup). |
|
|
|
Template-space ROI files to transform into patient space. |
|
|
|
Seed ROI path (patient- or template-space depending on workflow). |
|
|
|
Pre-resolved waypoint mask files. |
|
|
|
Multi-atlas ROI configuration (recommended). Each source has |
|
|
|
Legacy single-atlas ROI configuration ( |
|
|
|
SynthSeg-sourced ROI configuration ( |
waypoint_labels entry#
waypoint_labels is a mapping of ROI name → entry, used by atlas_sources,
roi_labels, and synthseg_roi_labels. The entry dict is loosely typed
(Dict[str, Any]); these are the keys the workflow reads (see
src/thesis/workflows/hcp/operations/extraction.py):
Key |
Type |
Description |
|---|---|---|
|
|
Role of the ROI in tractography: one of |
|
|
A single label string matched (case-/text-exact) against the |
|
|
Multiple label strings resolved via the CSV and merged into one mask (e.g. left + right). |
|
|
Explicit integer label values, used directly without a CSV lookup. This is the form |
Provide exactly one of label_values, label_names, or label_name per entry
(checked in that precedence order). atlas_sources / roi_labels resolve names
against their label_file; synthseg_roi_labels use label_values directly.
ProbTrackX2-specific (effective when method: probtrackx2)#
Field |
Type |
Default |
Constraints |
ProbTrackX2 flag |
Description |
|---|---|---|---|---|---|
|
|
|
|
|
Streamlines per seed voxel. |
|
|
|
|
|
Maximum steps per streamline. |
|
|
|
|
|
Step length in mm. |
|
|
|
|
|
Curvature threshold (lower = stricter). |
|
|
|
— |
|
Detect and prune looping samples. Slower but allows lower curvature thresholds. |
|
|
|
|
|
Discard streamlines shorter than this (mm). |
|
|
|
|
|
Starting fibre index. Only effective when |
|
|
|
|
|
Fibre sampling mode: |
|
|
|
— |
|
Use modified Euler streamlining. |
|
|
|
— |
|
Force per-streamline directory creation. |
|
|
|
— |
|
Output path distribution. |
MRtrix3-specific (effective when method: mrtrix3)#
Field |
Type |
Default |
Constraints |
Description |
|---|---|---|---|---|
|
|
|
— |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— |
|
|
|
|
— |
|
|
|
|
|
|
|
|
|
one of |
|
|
|
|
one of |
|
|
|
|
— |
Run |
|
|
|
one of |
|
|
|
|
one of |
Brain-mask source. |
|
|
|
|
Brain-mask dilation passes ( |
|
|
|
— |
Run |
|
|
|
one of |
|
|
|
|
— |
When |
Example — ProbTrackX2 protocol#
tractography:
method: probtrackx2
n_samples: 5000
n_steps: 2000
step_length: 0.5
curvature_threshold: 0.2
loop_check: true
dist_thresh: 0.0
rand_fib: 0
mod_euler: false
force_dir: true
opd: true
hemisphere: both
mem_gb_gpu: 8.0
mem_gb_cpu: 4.0
atlas_sources:
- name: main
roi_file: data/masks/annotation_full.nii.gz
label_file: data/masks/label_map.csv
waypoint_labels:
medulla-seed:
region_kind: seed
label_name: "pyramidal part of medulla oblongata"
peduncle-waypoint:
region_kind: waypoint
label_name: "cerebral peduncle (crus cerebri)"
Example — MRtrix3 protocol#
tractography:
method: mrtrix3
hemisphere: both-separately
tckgen_algorithm: iFOD2
tckgen_select: 2000000
tckgen_seeds: 50000000
tckgen_minlength: 30.0
tckgen_maxlength: 250.0
tckgen_backtrack: true
tckgen_crop_at_gmwmi: true
response_algorithm: dhollander
fod_algorithm: msmt_csd
use_mtnormalise: true
fivett_algorithm: freesurfer # brainstem seeds — see notes above
mask_source: fsl_nodif
mask_dilate_voxels: 1
use_sift2: true
Notes#
mem_gb_gpuandmem_gb_cpuare scheduler hints — they don’t cap actual memory. Set them to reflect real peak usage so Nipype doesn’t over-schedule.For MRtrix3 cross-subject comparisons, SIFT2 weights are scaled by
mu(captured automatically) to produce Fibre Bundle Capacity. Raw weight sums are not directly comparable across subjects.tract_similarityconsumes both backends transparently — settract_similarity.probtrackx_relpath: tractography/mrtrix3(oratlas.tractography_relpath) when running atlas / similarity workflows over MRtrix3 outputs.