mrsiprep.config.settings

Runtime configuration objects.

Classes

MRSIPrepConfig(bids_dir, output_dir, ...)

class mrsiprep.config.settings.MRSIPrepConfig(bids_dir: 'Path', output_dir: 'Path', analysis_level: 'str', participant_label: 'list[str]' = <factory>, session_label: 'list[str]' = <factory>, participants_file: 'Path | None' = None, bids_filter_file: 'Path | None' = None, metabolites: 'list[str] | None' = None, quality_metrics: 'list[str]' = <factory>, snr_min: 'float' = 4.0, linewidth_max: 'float' = 0.1, crlb_max: 'float' = 20.0, processing_mode: 'str' = 'mni-norm', tissue_backend: 'str' = 'synthseg-fast', registration_backend: 'str' = 'ants', ants_mrsi_to_t1_transform: 'str' = 'sr', ants_t1_to_mni_transform: 'str' = 's', fsl_mrsi_to_t1_dof: 'int' = 6, fsl_mrsi_to_t1_init: 'str' = 'flirt', fsl_t1_to_mni_dof: 'int' = 12, fsl_cost: 'str' = 'corratio', fsl_deformable: 'bool' = True, fsl_fnirt_warpres: 'tuple[int, int, int] | None'=None, fsl_fnirt_lambda: 'str' = '300, 200, 150, 150', normalization: 'str' = 'simple', output_spaces: 'list[str]' = <factory>, output_mrsi_t1w: 'bool' = False, mni_resolution: 'str' = 'origres', registration_t1_target: 'str | None' = None, csf_pv_threshold: 'float' = 0.95, parcellation_mode: 'str | None' = None, synthseg_mode: 'str' = 'robust', chimera_scheme: 'str' = 'LFMIHIFIS', chimera_scale: 'int' = 3, chimera_grow: 'int' = 2, atlas: 'str' = 'chimera-LFMIHIFIS-3', custom_atlas: 'Path | None' = None, custom_atlas_lut: 'Path | None' = None, fs_subjects_dir: 'Path | None' = None, write_connectivity: 'bool' = False, connectivity_method: 'str' = 'spearman', connectivity_space: 'str' = 'MRSI', connectivity_n_perturbations: 'int' = 50, connectivity_sigma_scale: 'float' = 2.0, connectivity_exclude_parcels: 'str | None' = None, connectivity_max_parcel_id: 'int | None' = None, regional_summary: 'str' = 'mean', nthreads: 'int' = 16, nproc: 'int' = 1, ref_met: 'str | None' = None, t1_pattern: 'str' = 'desc-brain_T1w', transform: 'str' = '', filter_biharmonic: 'bool' = True, filter_fwhm_mm: 'float | None' = None, spike_percentile: 'float' = 99.0, spike_max_cluster_voxels: 'int | None' = None, no_pvc: 'bool' = False, t1_correction: 'str' = 'none', t1_correction_water_status: 'str' = 'unknown', overwrite_t1corr: 'bool' = False, longitudinal: 'bool' = False, transform_spikemask: 'bool' = False, overwrite: 'bool' = False, overwrite_filt: 'bool' = False, overwrite_seg: 'bool' = False, overwrite_pve: 'bool' = False, overwrite_t1_reg: 'bool' = False, overwrite_mni_reg: 'bool' = False, overwrite_transform: 'bool' = False, overwrite_chimera: 'bool' = False, work_dir: 'Path | None' = None, verbose: 'int' = 1, validate_only: 'bool' = False, skip_file_integrity_check: 'bool' = False, check_external_libs: 'bool' = False, stop_on_first_crash: 'bool' = False, preset_citation: 'dict | None' = None)[source]

Bases: object

Parameters:
  • bids_dir (Path)

  • output_dir (Path)

  • analysis_level (str)

  • participant_label (list[str])

  • session_label (list[str])

  • participants_file (Path | None)

  • bids_filter_file (Path | None)

  • metabolites (list[str] | None)

  • quality_metrics (list[str])

  • snr_min (float)

  • linewidth_max (float)

  • crlb_max (float)

  • processing_mode (str)

  • tissue_backend (str)

  • registration_backend (str)

  • ants_mrsi_to_t1_transform (str)

  • ants_t1_to_mni_transform (str)

  • fsl_mrsi_to_t1_dof (int)

  • fsl_mrsi_to_t1_init (str)

  • fsl_t1_to_mni_dof (int)

  • fsl_cost (str)

  • fsl_deformable (bool)

  • fsl_fnirt_warpres (tuple[int, int, int] | None)

  • fsl_fnirt_lambda (str)

  • normalization (str)

  • output_spaces (list[str])

  • output_mrsi_t1w (bool)

  • mni_resolution (str)

  • registration_t1_target (str | None)

  • csf_pv_threshold (float)

  • parcellation_mode (str | None)

  • synthseg_mode (str)

  • chimera_scheme (str)

  • chimera_scale (int)

  • chimera_grow (int)

  • atlas (str)

  • custom_atlas (Path | None)

  • custom_atlas_lut (Path | None)

  • fs_subjects_dir (Path | None)

  • write_connectivity (bool)

  • connectivity_method (str)

  • connectivity_space (str)

  • connectivity_n_perturbations (int)

  • connectivity_sigma_scale (float)

  • connectivity_exclude_parcels (str | None)

  • connectivity_max_parcel_id (int | None)

  • regional_summary (str)

  • nthreads (int)

  • nproc (int)

  • ref_met (str | None)

  • t1_pattern (str)

  • transform (str)

  • filter_biharmonic (bool)

  • filter_fwhm_mm (float | None)

  • spike_percentile (float)

  • spike_max_cluster_voxels (int | None)

  • no_pvc (bool)

  • t1_correction (str)

  • t1_correction_water_status (str)

  • overwrite_t1corr (bool)

  • longitudinal (bool)

  • transform_spikemask (bool)

  • overwrite (bool)

  • overwrite_filt (bool)

  • overwrite_seg (bool)

  • overwrite_pve (bool)

  • overwrite_t1_reg (bool)

  • overwrite_mni_reg (bool)

  • overwrite_transform (bool)

  • overwrite_chimera (bool)

  • work_dir (Path | None)

  • verbose (int)

  • validate_only (bool)

  • skip_file_integrity_check (bool)

  • check_external_libs (bool)

  • stop_on_first_crash (bool)

  • preset_citation (dict | None)

analysis_level: str
ants_mrsi_to_t1_transform: str = 'sr'
ants_t1_to_mni_transform: str = 's'
atlas: str = 'chimera-LFMIHIFIS-3'
bids_dir: Path
bids_filter_file: Path | None = None
check_external_libs: bool = False
chimera_grow: int = 2
chimera_scale: int = 3
chimera_scheme: str = 'LFMIHIFIS'
connectivity_exclude_parcels: str | None = None
connectivity_max_parcel_id: int | None = None
connectivity_method: str = 'spearman'
connectivity_n_perturbations: int = 50
connectivity_sigma_scale: float = 2.0
connectivity_space: str = 'MRSI'
crlb_max: float = 20.0
csf_pv_threshold: float = 0.95
custom_atlas: Path | None = None
custom_atlas_lut: Path | None = None
property derivative_dir: Path
filter_biharmonic: bool = True
filter_fwhm_mm: float | None = None
property freesurfer_dir: Path
fs_subjects_dir: Path | None = None
fsl_cost: str = 'corratio'
fsl_deformable: bool = True
fsl_fnirt_lambda: str = '300,200,150,150'
fsl_fnirt_warpres: tuple[int, int, int] | None = None
fsl_mrsi_to_t1_dof: int = 6
fsl_mrsi_to_t1_init: str = 'flirt'
fsl_t1_to_mni_dof: int = 12
linewidth_max: float = 0.1
property logs_dir: Path
longitudinal: bool = False
metabolites: list[str] | None = None
mni_resolution: str = 'origres'
no_pvc: bool = False
normalization: str = 'simple'
nproc: int = 1
nthreads: int = 16
output_dir: Path
output_mrsi_t1w: bool = False
output_spaces: list[str]
overwrite: bool = False
overwrite_chimera: bool = False
overwrite_filt: bool = False
overwrite_mni_reg: bool = False
overwrite_pve: bool = False
overwrite_seg: bool = False
overwrite_t1_reg: bool = False
overwrite_t1corr: bool = False
overwrite_transform: bool = False
parcellation_mode: str | None = None
participant_label: list[str]
participants_file: Path | None = None
preset_citation: dict | None = None
processing_mode: str = 'mni-norm'
quality_metrics: list[str]
ref_met: str | None = None
regional_summary: str = 'mean'
registration_backend: str = 'ants'
registration_t1_target: str | None = None
resolve_cpu_budget()[source]

Coerce nproc*nthreads to the available CPU count.

Returns (nproc, nthreads, warning) where warning is set (and nthreads reduced) if the requested total thread budget exceeds the machine's CPU count.

Return type:

tuple[int, int, str | None]

session_label: list[str]
skip_file_integrity_check: bool = False
snr_min: float = 4.0
spike_max_cluster_voxels: int | None = None
spike_percentile: float = 99.0
stop_on_first_crash: bool = False
synthseg_mode: str = 'robust'
t1_correction: str = 'none'
t1_correction_water_status: str = 'unknown'
t1_pattern: str = 'desc-brain_T1w'
tissue_backend: str = 'synthseg-fast'
to_dict()[source]
Return type:

dict

transform: str = ''
transform_spikemask: bool = False
validate_only: bool = False
verbose: int = 1
work_dir: Path | None = None
write_connectivity: bool = False