preprocessing and preprocess — preprocessing knobs#
The framework has two related top-level keys:
preprocessing—PreprocessingConfig(generic toggles, validated)preprocess—Dict[str, Any](workflow-specific config for thepreprocessworkflow, loosely typed to avoid a model-import cycle)
The preprocess workflow reads both: high-level toggles from preprocessing and detailed step config from preprocess. The detailed nested models live in src/thesis/workflows/preprocess/config.py.
preprocessing — generic toggles#
Schema: PreprocessingConfig in src/thesis/core/config/validators.py.
Field |
Type |
Default |
Constraints |
Description |
|---|---|---|---|---|
|
|
|
— |
Apply denoising before further preprocessing. |
|
|
|
— |
Apply N4-style bias-field correction. |
|
|
|
— |
Perform brain extraction on structural images. |
|
|
|
one of |
Brain-extraction backend. |
|
|
|
— |
Apply motion correction. |
|
|
|
— |
Apply FSL eddy-current correction. |
|
|
|
— |
Run FSL TOPUP for susceptibility-distortion correction. |
|
|
|
— |
Optional acquisition parameters passed to TOPUP (see workflow-specific |
preprocess — workflow-specific blocks#
The preprocess key holds a free-form dict. Each subkey corresponds to a typed Pydantic model in src/thesis/workflows/preprocess/config.py. Use these models as reference when authoring config/preprocess.yaml.
preprocess.acq_params — AcqParamsConfig#
Field |
Type |
Description |
|---|---|---|
|
|
Effective readout bandwidth (Hz/Px). |
|
|
Number of phase-encoding lines; used to derive the readout time. |
create_acqparams_file derives the readout time from bandwidth and
phase_encoding_dirs and emits fixed AP/PA encoding rows, so the previous
readout_time, echo_spacing, phase_encoding_direction_ap, and
phase_encoding_direction_pa fields have been removed.
preprocess.bet — BetConfig#
Brain-extraction (FSL BET) options. These apply only when
preprocessing.brain_extraction_method is bet; the SynthStrip path ignores
them.
Field |
Type |
Description |
|---|---|---|
|
|
Fractional intensity threshold per modality (0–1). |
|
|
Robust brain-center estimation (BET |
|
|
Pad end slices to improve BET on small FOVs (BET |
|
|
Head radius in mm (BET |
preprocess.bedpostx — BedpostXConfig#
BedpostX fibre-orientation estimation options. Authoritative defaults live in
src/thesis/workflows/preprocess/config.py (BedpostXConfig).
Field |
Type |
Default |
Constraints |
Description |
|---|---|---|---|---|
|
|
|
|
Number of fibre populations to model per voxel. |
|
|
|
|
Deconvolution model ( |
|
|
|
|
MCMC burn-in jumps. |
|
|
|
|
Total MCMC jumps. |
|
|
|
|
Record a sample every Nth jump. |
|
|
|
— |
Use CUDA-enabled BedpostX. |
|
|
|
|
ARD weight (only used by |
preprocess.synthseg — PreprocessSynthSegConfig#
SynthSeg-specific options as run inside the preprocess workflow (separate from the top-level synthseg block which configures the standalone workflow).
preprocess workflow-control toggles#
The preprocess dict also carries top-level boolean toggles (defined on
PreprocessConfig in src/thesis/workflows/preprocess/config.py) that gate whole
stages of the pipeline:
Key path |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Run FSL TOPUP distortion correction. |
|
|
|
Run FSL eddy-current correction. |
|
|
|
Run DTIFit tensor estimation. |
|
|
|
Run BedpostX fibre-orientation estimation. |
|
|
|
Run SynthSeg segmentation. |
|
|
|
Run the intra-subject coregistration chain ( |
preprocess.registration — RegistrationChainConfig#
ANTs registration steps embedded in the preprocess pipeline. Each entry is a
RegistrationStepConfig (transform type, metric, interpolation, etc.). The whole
chain is gated by preprocess.run_coregistration (see the toggles table above):
dwi_to_t1— intra-subject DWI→T1 (Rigid). Always built whenpreprocess.run_coregistrationis enabled; its composite transform is exported as thet1_to_dwi_transformoutput.t2_to_t1— intra-subject T2→T1 (Rigid). Built when a T2 image is present.t1_to_template— patient T1→template (SyN). Built when a template fixed image is configured via the top-levelregistration.fixed_image(reused from the registration workflow). This lets a patient that was not used to build the cohort template still be registered to it. Its outputs are exported on the preprocess outputnode ast1_to_template_transform(composite transform) andt1_to_template_warped(T1 resampled onto the template grid).
preprocess.label_transform — LabelTransformConfig#
Warps MNI/atlas labels into subject space via the dwi_to_t1 composite
transform (built only when transform_mni_labels is true and
mni_labels_list is non-empty):
Field |
Type |
Description |
|---|---|---|
|
|
Enable the per-label |
|
|
Label images to warp. |
|
|
ANTs interpolation ( |
|
|
Invert the composite transform (mapped to ANTs |
|
|
When true, warp labels onto the configured template ( |
preprocess.dtifit — DTIFitConfig#
FSL dtifit tensor-estimation options. Authoritative defaults live in
src/thesis/workflows/preprocess/config.py (DTIFitConfig).
Field |
Type |
Default |
Description |
|---|---|---|---|
|
|
|
Use weighted least-squares fitting. |
|
|
|
Compute kurtosis (DKI) parameters. |
|
|
|
Save the full tensor components. |
Example#
preprocessing:
denoise: true
bias_correction: true
brain_extraction: true
brain_extraction_method: synthstrip
motion_correction: true
eddy_correction: true
topup: true
preprocess:
acq_params:
bandwidth: 1923.077
phase_encoding_dirs: 96
bet:
frac_t1: 0.5
robust: true
radius: 80
bedpostx:
n_fibres: 3
model: 2
burn_in: 1000
n_jumps: 1250
sample_every: 25
use_gpu: true
synthseg:
parc: true
robust: true
dtifit:
use_wls: true
save_tensor: true
run_coregistration: true
See config/preprocess.yaml for the shipped reference protocol.