algorithms.registration.type_check¶
Module: algorithms.registration.type_check
¶
Utilities to test whether a variable is of, or convertible to, a particular type
Functions¶
- nipy.algorithms.registration.type_check.check_type(x, t, accept_none=False)¶
Checks whether a variable is convertible to a certain type. A ValueError is raised if test fails.
- Parameters:
- xobject
Input argument to be checked.
- ttype
Target type.
- accept_nonebool
If True, skip errors if x is None.
- nipy.algorithms.registration.type_check.check_type_and_shape(x, t, s, accept_none=False)¶
Checks whether a sequence is convertible to a numpy ndarray with given shape, and if the elements are convertible to a certain type. A ValueError is raised if test fails.
- Parameters:
- xsequence
Input sequence to be checked.
- ttype
Target element-wise type.
- ssequence of ints
Target shape.
- accept_nonebool
If True, skip errors if x is None.