Note

This page is a reference documentation. It only explains the class signature, and not how to use it. Please refer to the user guide for the big picture.

brainprep.config.Config

class brainprep.config.Config(**options)[source]

Bases: object

Context manager for modifying global execution options.

This context manager allows temporary overrides of global options such as verbose and dryrun, which are commonly used across the brainprep package to control execution behavior. These options are primarily consumed by the interfaces and reporting modules when executing commands from decorated functions.

Additional options may be passed to workflows. These include resource-specific flags and configuration pre-configured to work with the associated container resource.

Parameters:
**optionsdict

Keyword arguments intercepted by the wrapper function: - verbose : bool, default True - print information or not. - dryrun : bool, default False - execute commands or not - no_color : bool, default False - print with colors or not. - skip_run_check : bool, default False - check run unicity or not. - cat12_file : File - path to the CAT12 standalone executable. - spm12_dir : Directory - path to the SPM12 standalone executable. - matlab_dir : Directory - path to the Matlab Compiler Runtime (MCR). - tpm_file : File - path to the SPM TPM file. - darteltpm_file : File - path to the CAT12 template file.

Notes

  • The context variable brainprep_options holds the current configuration.

  • Options are scoped to the with block and automatically restored afterward.

Examples

>>> from brainprep.config import Config
>>> from brainprep.interfaces import movedir
>>>
>>> with Config(dryrun=True, verbose=False):
...     target_directory = movedir(
...         source_dir="/tmp/source_dir",
...         output_dir="/tmp/destination_dir",
...     )
>>> target_directory
PosixPath('/tmp/destination_dir/source_dir')
__init__(**options)[source]

Examples using brainprep.config.Config

Defacing

Defacing

Quality Assurance

Quality Assurance

Quasi-RAW

Quasi-RAW

SBM

SBM

VBM

VBM

fMRI

fMRI