nondefaced_detector.preprocess.preprocess¶
-
preprocess(vol_path, conform_volume_to=(128, 128, 128), conform_zooms=(2.0, 2.0, 2.0), save_path=None, with_label=False)[source]¶ Preprocess input volumes before prediction.
- Parameters
vol_path (str - Path or tuple of length 2 (str - Path, int)) – The path to the input volume. If the with_label flag is True, the vol_path is required to be a tuple of size 2 - (vol_path, label)
conform_volume_to (tuple of length 3, optional, default=(128 128, 128)) – The shape the volume will be conformed to. Note: The pretrained model was trained using the conform size of (128, 128, 128) and assumes the volume shape as such.
save_path (str - Path, optional) – The path where the output volume is saved. If none is provided, the output volume will be saved under vol_path/preprocessed
with_label (bool, optional) – If True, the input vol_path is required to be a tuple of 2 (vol_path, label)
- Returns
Path to the where the preprocessed volume is stored. (Path, label) if with_label is True.
- Return type
str - Path