Skip to content

config

tit.pre.qsi.config

Configuration dataclasses and enums for QSI integration.

This module defines type-safe configuration objects for QSIPrep and QSIRecon Docker runs, including resource allocation and pipeline specifications.

ReconSpec

Bases: StrEnum

Available QSIRecon reconstruction specifications.

Each spec defines a complete reconstruction pipeline with specific algorithms and output formats.

from_string classmethod

from_string(value: str) -> Self

Convert string to ReconSpec enum.

Source code in tit/pre/qsi/config.py
@classmethod
def from_string(cls, value: str) -> Self:
    """Convert string to ReconSpec enum."""
    for spec in cls:
        if spec.value == value:
            return spec
    raise ValueError(f"Unknown recon spec: {value}")

list_all classmethod

list_all() -> list[str]

Return list of all spec values.

Source code in tit/pre/qsi/config.py
@classmethod
def list_all(cls) -> list[str]:
    """Return list of all spec values."""
    return [spec.value for spec in cls]

QSIAtlas

Bases: StrEnum

Available atlases for QSIRecon connectivity analysis.

These atlases can be used for structural connectivity matrix generation.

from_string classmethod

from_string(value: str) -> Self

Convert string to QSIAtlas enum.

Source code in tit/pre/qsi/config.py
@classmethod
def from_string(cls, value: str) -> Self:
    """Convert string to QSIAtlas enum."""
    for atlas in cls:
        if atlas.value == value:
            return atlas
    raise ValueError(f"Unknown atlas: {value}")

list_all classmethod

list_all() -> list[str]

Return list of all atlas values.

Source code in tit/pre/qsi/config.py
@classmethod
def list_all(cls) -> list[str]:
    """Return list of all atlas values."""
    return [atlas.value for atlas in cls]

ResourceConfig dataclass

ResourceConfig(cpus: int | None = None, memory_gb: int | None = None, omp_threads: int = QSI_DEFAULT_OMP_THREADS)

Resource allocation configuration for QSI containers.

Attributes

cpus : int Number of CPUs to allocate to the container. memory_gb : int Memory limit in gigabytes. omp_threads : int Number of OpenMP threads (affects ANTS, MRtrix, etc.).

QSIPrepConfig dataclass

QSIPrepConfig(subject_id: str, output_resolution: float = QSI_DEFAULT_OUTPUT_RESOLUTION, resources: ResourceConfig = ResourceConfig(), image_tag: str = QSI_DEFAULT_IMAGE_TAG, skip_bids_validation: bool = True, denoise_method: str = 'dwidenoise', unringing_method: str = 'mrdegibbs', distortion_group_merge: str = 'none')

Configuration for a QSIPrep run.

Attributes

subject_id : str Subject identifier (without 'sub-' prefix). output_resolution : float Target output resolution in mm (default: 2.0). resources : ResourceConfig Resource allocation settings. image_tag : str Docker image tag for QSIPrep. skip_bids_validation : bool Whether to skip BIDS validation (useful for non-BIDS datasets). denoise_method : str Denoising method: 'dwidenoise', 'patch2self', or 'none'. unringing_method : str Unringing method: 'mrdegibbs', 'rpg', or 'none'. distortion_group_merge : str Method for merging distortion groups: 'concatenate', 'average', or 'none'.

QSIReconConfig dataclass

QSIReconConfig(subject_id: str, recon_specs: list[str] = (lambda: ['mrtrix_multishell_msmt_ACT-fast'])(), atlases: list[str] | None = (lambda: ['Schaefer100', 'AAL116'])(), use_gpu: bool = False, resources: ResourceConfig = ResourceConfig(), image_tag: str = QSI_DEFAULT_IMAGE_TAG, skip_odf_reports: bool = True)

Configuration for a QSIRecon run.

Attributes

subject_id : str Subject identifier (without 'sub-' prefix). recon_specs : list[str] List of reconstruction specs to run. Defaults to ['dipy_dki']. atlases : list[str] | None List of atlases for connectivity analysis. None = no connectivity. use_gpu : bool Whether to enable GPU acceleration (requires NVIDIA Docker runtime). resources : ResourceConfig Resource allocation settings. image_tag : str Docker image tag for QSIRecon. skip_odf_reports : bool Whether to skip ODF report generation (saves time).