fsl.utils.assertions

This module contains a handful of miscellaneous assertion routines.

assertFileExists

assertIsNifti3D

assertIsNifti4D

assertIsNifti

assertNiftiShape

assertIsSurfGifti

assertIsFuncGifti

assertIsMelodicDir

The disabled() context manager can be used to temporarily disable assertion checks.

fsl.utils.assertions._DISABLE_ASSERTIONS = 0

Semaphore used by the disabled() context manager.

fsl.utils.assertions.disabled(disable=True)[source]

Context manager which allows assertion checks to be temporarily disabled.

If calls to this function are nested, only one of the calls need to be made with disable=True for assertions to be disabled; any other calls which are part of the call stack which set disable=False will have no effect.

Parameters:

disable – Set to True (the default) to disable assertions, or False to enable them.

fsl.utils.assertions._canDisable(func)[source]

Decorator used on assertion functions, allowing them to be disabled via the disabled() context manager.

fsl.utils.assertions.assertFileExists(*args, **kwargs)[source]
fsl.utils.assertions.assertIsNifti3D(*args, **kwargs)[source]
fsl.utils.assertions.assertIsNifti4D(*args, **kwargs)[source]
fsl.utils.assertions.assertIsNifti(*args, **kwargs)[source]
fsl.utils.assertions.assertNiftiShape(*args, **kwargs)[source]
fsl.utils.assertions.assertIsSurfGifti(*args, **kwargs)[source]
fsl.utils.assertions.assertIsFuncGifti(*args, **kwargs)[source]
fsl.utils.assertions.assertIsMelodicDir(*args, **kwargs)[source]