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 fn are preserved.

  • All global configuration parameters from DEFAULT_OPTIONS are added as keyword-only parameters.

  • Configuration parameters passed via the CLI are extracted from kwargs and applied through the Config context 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 as cat12_file, spm12_dir, matlab_dir, tpm_file, and darteltpm_file are excluded from the generated signature. If True, all configuration parameters are included. Default False.

Returns:
methodCallable

A wrapped version of fn whose signature includes both the original parameters and the global configuration parameters.

Notes

The wrapper inspects the signature of fn using inspect.signature and 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 the Config system rather than passed directly to the workflow. During execution, configuration parameters are removed from kwargs and passed to the Config context manager. Remaining arguments are forwarded to the underlying workflow function.