Note
This page is a reference documentation. It only explains the function signature, and not how to use it. Please refer to the user guide for the big picture.
brainprep.cli.make_wrapped¶
- brainprep.cli.make_wrapped(fn, is_vbm=False)[source]¶
Wrap a workflow function and extend its signature with global configuration parameters.
This function creates a wrapper around a BrainPrep workflow function so that:
All original parameters of
fnare preserved.All global configuration parameters from
DEFAULT_OPTIONSare added as keyword-only parameters.Configuration parameters passed via the CLI are extracted from
kwargsand applied through theConfigcontext manager.The modified signature is exposed to Fire, ensuring that the CLI help message displays the extended parameter list.
- Parameters:
- fnCallable
The workflow function to wrap. Its signature is inspected and extended with additional keyword-only configuration parameters.
- is_vbmbool
Whether the wrapped function corresponds to a VBM workflow. If
False(default), VBM-specific configuration parameters such ascat12_file,spm12_dir,matlab_dir,tpm_file, anddarteltpm_fileare excluded from the generated signature. IfTrue, all configuration parameters are included. Default False.
- Returns:
- methodCallable
A wrapped version of
fnwhose signature includes both the original parameters and the global configuration parameters.
Notes
The wrapper inspects the signature of
fnusinginspect.signatureand reconstructs a new signature that includes both workflow-specific and global configuration parameters. Each configuration parameter is annotated as"Context Manager"to indicate that it is handled by theConfigsystem rather than passed directly to the workflow. During execution, configuration parameters are removed fromkwargsand passed to theConfigcontext manager. Remaining arguments are forwarded to the underlying workflow function.