Vision inference
save_series_pred
save_series_pred (series_obj, save_dir, val='1234')
Saves series prediction with updated DICOM UIDs.
load_system_resources
load_system_resources (models_path, learner_fn, variables_fn)
Load necessary resources like learner and variables.
inference
inference (learn_inf, reorder, resample, fn:(<class'str'>,<class'pathlib.Path'>)='', save_path:(<class'str'>,<class'pathlib.Path'>)=None, org_img=None, input_img=None, org_size=None)
Predict on new data using exported model.
compute_binary_tumor_volume
compute_binary_tumor_volume (mask_data:torchio.data.image.Image)
Compute the volume of the tumor in milliliters (ml).
Post-processing
refine_binary_pred_mask
refine_binary_pred_mask (pred_mask, remove_size:(<class'int'>,<class'float'>)=None, percentage:float=0.2, verbose:bool=False)
*Removes small objects from the predicted binary mask.
Args: pred_mask: The predicted mask from which small objects are to be removed. remove_size: The size under which objects are considered ‘small’. percentage: The percentage of the remove_size to be used as threshold. Defaults to 0.2. verbose: If True, print the number of components. Defaults to False.
Returns: The processed mask with small objects removed.*
Gradio
gradio_image_classifier
gradio_image_classifier (file_obj, learn, reorder, resample)
Predict on images using exported learner and return the result as a dictionary.