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:
- a
str
String of a number or none, infinity.
- a
- Returns:
- Raises:
argparse.ArgumentTypeError
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:
argparse.ArgumentTypeError
If the argument is not “fov”, “auto” or convertible to an int greater than 0.
- 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, handles cases.
- a
- Returns:
str
One of ‘native’, ‘soft <orientation>’, or ‘<orientation>’.
- Raises:
argparse.ArgumentTypeError
If the argument is not a valid choice.
- 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:
argparse.ArgumentTypeError
Invalid dtype.
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:
- a
str
Vox size type. Can be auto, min or a number between 1 an 0.
- a
- Returns:
- Raises:
argparse.ArgumentTypeError
If the argument is not “min”, “auto” or convertible to a float between 0 and 1.