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.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, bin 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.