Skip to content

Subfunctions

Library of implemented Subfunctions in AUCMEDI.

A Subfunction is a preprocessing method, which is automatically applied on all samples if provided to a DataGenerator.

Image preprocessing is defined as a method or technique which modify the image before passing it to the neural network model. The aim of preprocessing methods is to extensively increase performance due to simplification of information. Common preprocessing methods range from intensity value normalization to image resizing.

Info

The DataGenerator applies the list of Subfunctions sequentially on the data set.

The Subfunctions Resize and Standardize are integrated into the DataGenerator base due to its requirement in any medical image classification pipeline.

Example
# Import Subfunctions
from aucmedi.data_processing.subfunctions import *

# Select desired Subfunctions
sf_crop = Crop(shape=(128, 164), mode="center")
sf_padding = Padding(mode="square")
# Pack them into a list
sf_list = [sf_crop, sf_padding]                 # Subfunctions will be applied in provided list order

# Pass the list to the DataGenerator
train_gen = DataGenerator(samples=index_list,
                          path_imagedir="my_images/",
                          labels=class_ohe,
                          resize=(512,512),                # Call the integrated resize Subfunction
                          standardize_mode="grayscale",    # Call the integrated standardize Subfunction
                          subfunctions=sf_list)            # Pass desired Subfunctions

Subfunctions are based on the abstract base class Subfunction_Base, which allow simple integration of custom preprocessing methods.