DICOM Sort Configuration

Standalone DICOM rename / reorganize via dcm2niix (habit sort-dicom). This is not the full preprocessing pipeline; for resample / N4 / registration see Preprocessing Configuration.

Schema: DicomSortConfig. Template: config/dicom_sort/config_sort_dicom.yaml.

API reference: habit.core.dicom_sort.

Example configuration:

data_dir: ../../demo_data/dicom
out_dir: ../../demo_data/results/sorted_dicom
dcm2niix_path: ../../tools/bin/dcm2niix.exe
f: "subj_%n_%g_%x/%s_%d/%r_%o.dcm"
extra_args: []

Top-level fields

Field

Default

Description

data_dir

none (required)

Input DICOM root; relative paths resolve against the YAML directory

out_dir

none (required)

Output root for sorted files

f

none (required*)

dcm2niix -f pattern, passed verbatim (no path rewriting)

filename_format

null

Deprecated alias for f

dcm2niix_path

null

Executable file or directory; omit to search PATH

extra_args

[]

Extra CLI tokens appended to the dcm2niix command

output_dir

null

If set, used as dcm2niix -o instead of out_dir

* Provide either f or filename_format.

Notes

  • Do not put path-like tokens in f that HABIT would treat as file paths; the loader intentionally skips path resolution for the -f pattern.

  • On Windows lightweight installs, tools/bin/dcm2niix.exe is the usual bundled binary.

  • Command walkthrough: Preprocessing.