nondefaced_detector.preprocess.preprocess_parallel

preprocess_parallel(volume_filepaths, num_parallel_calls=- 1, conform_volume_to=(128, 128, 128), conform_zooms=(2.0, 2.0, 2.0), save_path=None, with_label=True)[source]

Preprocess multiple input volumes before prediction in parallel.

Parameters
  • volume_filepaths (list of str - Path or list of tuple of length 2 [(str - Path, int), ..]) – A list of paths to the input volumes. If the with_label flag is True, the volume_filepaths is required to be a list of tuples of size 2 - (volume_filepath, label)

  • num_parallel_calls (int) – Number of parallel calls to make for preprocessing.

  • 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.

  • conform_zooms (tuple of size 3, optional, default=(2.0, 2.0, 2.0)) – The zoom of the resampled output.

  • save_path (str - Path, optional) – The path where the output volume is saved. If none is provided, the output volume will be saved under volume_filepath/preprocessed

  • with_label (bool, optional) – If True, each volume_filepath is required to be a tuple of 2 (volume_filepath, label)

Returns

List of str paths to the where each preprocessed volume is stored. [(Path, label), …] if with_label is True.

Return type

list of str