FastSurferCNN.utils.arg_types¶
- FastSurferCNN.utils.arg_types.float_gt_zero_and_le_one(a)[source]¶
Check whether a parameters are a float between 0 and one.
- Parameters:
- Returns:
- Raises:
ValueError
If
a
is neither a float between 0 and 1.
- FastSurferCNN.utils.arg_types.img_size(a)[source]¶
Convert the img_size argument to ‘fov’, ‘auto’ or int as a valid image size.
- Parameters:
- a
str
Image size type. Can be auto, fov or an integer greater than 0.
- a
- Returns:
- Raises:
ValueError
If the argument is not “fov”, “auto” or convertible to an int greater than 0.
- FastSurferCNN.utils.arg_types.int_ge_zero(value)[source]¶
Convert to integers greater 0.
- Parameters:
- value
str
String to convert to int.
- value
- Returns:
- val
int
Given value if bigger or equal to zero.
- val
- Raises:
ValueError
Invalid value, must be greater than 0.
- FastSurferCNN.utils.arg_types.int_gt_zero(value)[source]¶
Convert to positive integers.
- Parameters:
- Returns:
- val
int
Converted integer.
- val
- Raises:
ValueError
Invalid value, must not be negative.
- FastSurferCNN.utils.arg_types.orientation(a)[source]¶
Convert the orientation argument to a valid orientation from ‘native’, ‘soft[-_ ]<orientation/i>’, and ‘<orientation/i>’, where <orientation/i> is any valid orientation (case-insensitive).
- Parameters:
- a
str
Target orientation type, case-insensitive.
- a
- Returns:
str
One of ‘native’, ‘soft-<orientation>’, or ‘<orientation>’.
- Raises:
ValueError
If the argument is not a valid orientation.
- FastSurferCNN.utils.arg_types.target_dtype(a)[source]¶
Check for valid dtypes.
- Parameters:
- a
str
Datatype descriptor.
- a
- Returns:
str
The validated data type.
- Raises:
ValueError
If the dtype is invalid.
See also
numpy.dtype
For more information on numpy data types and their properties.
- FastSurferCNN.utils.arg_types.unquote_str(value)[source]¶
Unquote a (single quoted) string, i.e. remove one level of single-quotes.
- FastSurferCNN.utils.arg_types.vox_size(a)[source]¶
Convert the vox_size argument to ‘min’ or a valid voxel size.
- Parameters:
- Returns:
- Raises:
ValueError
If the argument is not “min”, “auto” or convertible to a float between 0 and 1.