ImFusion SDK 4.3
ImFusion::ML Namespace Reference

Namespace containing all the classes relevant for the data processing and the execution of machine learning models. More...

Detailed Description

Namespace containing all the classes relevant for the data processing and the execution of machine learning models.

See also
ImFusionML

Classes

class  AddCenterBoxOperation
 Add Centerbox in a second channel. More...
 
class  AddDegradedLabelAsChannelOperation
 Operation to add a channel with blobs whose sign depends on the label. More...
 
class  AddPixelwisePredictionChannelOperation
 Run an existing pixelwise model and add result to the input image as additional channels. More...
 
class  AddPositionAsChannelAlgorithm
 Algorithm to add a new channel to a given image containing each pixel's position. More...
 
class  AddPositionChannelOperation
 Add Position Channel. More...
 
class  AddRandomNoiseOperation
 Apply a pixelwise random noise to the image pixels type (string): Distribution of the noise ('uniform', 'gaussian', 'gamma') random_range (double): The generated noise level: For 'uniform': noise is drawn in [-intensity, intensity] For 'gaussian': noise is drawn from a Gaussian with zero mean and standard deviation equal to intensity For 'gamma': noise is drawn from a Gamma distribution with k = theta = intensity (note that this noise has a mean of 1.0 so it is biased) For 'shot': noise is drawn from a Gaussian with zero mean and standard deviation equal to intensity * sqrt(pixelValue) probability (double): Value in [0.0; 1.0] indicating the probability of this operation to be performed. More...
 
class  AdjustShiftScaleOperation
 Apply a shift and scale to the input image intensities: Output = (Input + shift) / scale. More...
 
class  AdvancedParameter
 The AdvancedParameter class extends the Parameter class by providing some additional functionalities used in ML::Operation and ML::ImageROISampler classes, like specifying whether a parameter is required for the object to work, and automatically logging an error message in case the user doesn't provide it. More...
 
class  ApplyTopDownFlagOperation
 Flip the image, if the image is not top-down. More...
 
class  ApproximateToHigherResolutionOperation
 Replicate the input from the original reference image. More...
 
class  ArgMaxOperation
 Create a label map with the indices corresponding of the input channel with the highest value. More...
 
class  AxisFlipOperation
 Flip image content along specified set of axes. More...
 
class  AxisRotationOperation
 Rotate around image axis with axis-specific rotation angles that are signed multiples of 90 degrees. More...
 
class  BakeDeformationOperation
 Deform an image with its attached Deformation and store the result into the returned output image. More...
 
class  BakePhotometricInterpretationOperation
 The PhotometricInterpretation is a DICOM flag that encodes the relation between intensity values and their display value If the PhotometricInterpretation is set to Monochrome1, we invert the values over the range of values (min becomes max, max becomes min). More...
 
class  BakeTransformationOperation
 Apply the rotation contained in the matrix of the input volume. More...
 
class  BatchDataLoader
 Batches the items in the nested loader into batches of the specified size. More...
 
class  BlobsFromKeypointsOperation
 Transforms keypoints into an actual image (blob map with the same size of the image). More...
 
class  BoundingBoxElement
 DataElement based on BoundingBoxSet. More...
 
class  BoundingBoxSet
 Class for managing sets of bounding boxes within a BoundingBoxElement The class is meant to be used in parallel with SharedImageSet. More...
 
class  BoundingBoxSetIoAlgorithm
 Io Algorithm to load/save BoundingBoxSet. More...
 
struct  Box
 Bounding Box for ML tasks Since bounding boxes are axis aligned by definition, a Box is represented by its center and its extent. More...
 
class  CacheDataLoader
 Caches the dataset loaded until now. More...
 
class  CenterROISampler
 Sampler which samples one ROI from the input image and label map with a target size. More...
 
class  CheckDataOperation
 Runs some tests on the input data and then forwards it as is. More...
 
class  ClassificationLearningEvaluation
 Class for evaluation of a binary classification method. More...
 
class  ClipOperation
 Clip values in a range. More...
 
class  ConcatenateNeighboringFramesToChannelsOperation
 Iterates over frame and adds to channel dimension the neighboring frames of both sides of the frame. More...
 
class  ConvertSlicesToVolumeOperation
 Creates a volume out of a set of slices with the same size. More...
 
class  ConvertToGrayOperation
 Convert input image to grayscale by averaging the color channels. More...
 
class  ConvertVolumeToSlicesOperation
 Extract slices from a volume TODO: for now this works only if input SIS contains a single 3D image, see issue ML-577. More...
 
class  ConvolutionalCRFOperation
 Adapt segmentation map or raw output of model to image content. More...
 
class  CopyOperation
 Copy a set of fields of a DataItem source (List[str]): list of the elements to be copied target (List[str]): list of the names of the new elements (must match the size of source) More...
 
class  CropAroundLabelMapOperation
 Selects the given label from a multi-label, and crops the image and labels around it. More...
 
class  CropOperation
 Crop input images and label maps with a given size and offset crop_size (vec3i): List of integers representing the target dimensions of the image to be cropped. More...
 
struct  CudaComputeCapability
 Helper struct to store the CUDA compute capability. More...
 
class  CudaDeviceManager
 Singleton class that helps getting a compatible CUDA device. More...
 
class  CutOutOperation
 Cut out regions in input images and label maps with a given size, offset and fill value size (vector<vec3>): List of 3-dim vectors representing the extent of the cut out fill_value (vector<float>): List of intensity values for filling out cutout region size_units (ParamUnit): Units of cut out size parameter. More...
 
class  DataElement
 Main interface for data elements used for wrapping other ImFusion types and use them in a machine learning specific workflow. More...
 
struct  DataElementException
 Custom exception thrown by some DataElement. More...
 
class  DataItem
 Class for holding a map of heterogeneous DataElements, see DataElement. More...
 
class  DataItemDisplayHandler
 DataDisplayHandler for DataItems. More...
 
struct  DataItemException
 Custom exception thrown by DataItem. More...
 
class  DataListReader
 DataReader to directly read data from a given datalist where each column corresponds to a (single) field of the DataItem. More...
 
class  DataLoader
 Interface for all data loaders, establishing the mechanism for loading and processing data. More...
 
struct  DataLoaderException
 Custom exception thrown by DataLoader. More...
 
struct  DataLoaderSpecs
 
class  DataReader
 Base class for data readers. More...
 
class  Dataset
 Class for creating an iterable dataset by chaining data loading and transforming operations executed in a lazy fashion. More...
 
class  DefaultROISampler
 Sampler which simply returns the image and the label map, after padding of a specified dimension divisor: each spatial dimension of the output arrays will be divisible by dimensionDivisor. More...
 
class  DeformationOperation
 Apply a deformation to the image using a specified control point grid and specified displacements nSubdivisions (vec3i): list specifying the number of subdivisions for each dimension (the number of control points is subdivisions+1). More...
 
class  DiceMetric
 Compute the Dice score between a label map and a ground truth segmentation. More...
 
struct  ElementTypeHash
 Hash function for the ElementType enum class. More...
 
class  Engine
 Generic interface for machine learning models serialized by specific frameworks (PyTorch, ONNX, etc.). More...
 
class  EngineConfiguration
 
class  EnsureExplicitMaskOperation
 Converts the existing mask of all input images into explicit masks. More...
 
class  EnsureOneToOneMatrixMappingOperation
 Ensures that it is possible to get/set the matrix of each frame of the input image set independently. More...
 
class  ExtractRandomSubsetOperation
 Extracts a random subset from a SharedImageSet. More...
 
class  ExtractSubsetOperation
 Extracts a subset from a SharedImageSet. More...
 
class  Factory
 Generic factory class for registering polymorphic types Usage: More...
 
class  FileNotFoundError
 
class  FileReader
 Loads data by reading the files from a list of data "columns" (see above). More...
 
struct  FileReaderColumn
 This struct represents a "column" of filenames in a filelist, like those contained in datalist_training.txt/data_list_validation.txt produced by ImFusionLabels. More...
 
class  FilterDataLoader
 Filters the items according to user defined criterion. More...
 
class  FilterEmptyElementContentDataLoader
 Filters the items out if any of the selected fields is holding a DataElement with empty content. More...
 
class  ForegroundGuidedLabelUpsamplingOperation
 Operation that generates a label map by upsampling or resampling a multi-class one-hot encoded image (such as a softmax model prediction) to the space of a binary image (such as a sigmoid model prediction). More...
 
class  GammaCorrectionOperation
 Apply a gamma correction which changes the overall contrast (see https://en.wikipedia.org/wiki/Gamma_correction) gamma (double): Power applied to the normalized intensities. More...
 
class  GenerateBoxSegmentationTrainingDataAlgorithm
 Algorithm to generate learning data for box segmentation network. More...
 
class  GenerateRandomKeypointsOperation
 Generate uniformly distributed random keypoints in the image. More...
 
class  GroupToDataItemAlgorithm
 Groups a list of Data into a DataItem. More...
 
class  HighPassOperation
 Smooth input image with a Gaussian kernel with halfKernelSize Then subtract the smoothed image from the input, resulting in a reduction of low-frequency components (like large gradients) More...
 
class  ImageElement
 DataElement for 2D and 3D images. More...
 
class  ImageMathOperation
 Computes a specified formula involving images from the input dataitem. More...
 
class  ImageMattingOperation
 Reshape label map based on intensities of input image. More...
 
class  ImageResampler
 Helper class to run resampling algorithms within operations The class holds two permanent algorithm instances (one for images, one for labels) for the sake of efficiency Images with more 4 channels are properly handled so that GPU execution is still possible. More...
 
class  ImageROISampler
 Interface for samplers used during training of machine learning models. More...
 
struct  ImageSamplersException
 Custom exception. More...
 
class  ImagewiseClassificationMetrics
 Compute the confusion matrix for a multi-class classification. More...
 
class  InterleaveDataLoader
 Routes DataItems from different pipelines into one active pipeline. More...
 
class  InverseOperation
 Operation that inverts a specific operation by using the InversionComponent. More...
 
class  InversionComponent
 Data component for storing operation inversion information. More...
 
class  InvertibleOperation
 Base class for operations that support inversion. More...
 
class  InvertOperation
 Invert the intensities of the image. More...
 
class  IOError
 
class  KeepLargestComponentOperation
 Create a label map with the largest components above the specified threshold. More...
 
class  KeypointExtractionAlgorithm
 Algorithm for extracting keypoints from blobs representing the probability distribution of the keypoint location. More...
 
class  KeypointsElement
 DataElement based on KeypointSet. More...
 
class  KeypointSet
 Class for managing sets of keypoints within a KeypointsElement The class is meant to be used in parallel with SharedImageSet. More...
 
class  KeypointSetIoAlgorithm
 Io Algorithm to load/save KeypointSet. More...
 
class  KeypointsFromBlobsOperation
 Extracts keypoints from a blob image Requires an image called label keypoints_field_name (str): Field name of the output keypoints keypoint_extraction_mode (int): Extraction mode: 0: Max, 1: Mean, 2: Local Max. More...
 
class  LabelROISampler
 Sampler which samples ROIs from the input image and label map, such that one particular label appears. More...
 
class  LandmarkPredictionAlgorithm
 Algorithm to predict landmarks in an image. More...
 
class  LinearIntensityMappingOperation
 Apply a linear shift and scale to the image intensities. More...
 
class  LocalConvolutionalNetworkAlgorithm
 Algorithm to perform a Local (possibly augmented) prediction using a fully convolutional network around a central point. More...
 
class  LocalizeSegmentAlgorithm
 Localize & Segment Algorithm Runs an initial low resolution pixelwise segmentation to find a bounding box. More...
 
class  MachineLearningModel
 Class for managing and executing a machine learning model on generic input data. More...
 
class  MachineLearningModelAlgorithm
 Generic algorithm to apply a machine learning model. More...
 
class  MakeFloatOperation
 Turn image into a float image (if not float already) More...
 
class  MapDataLoader
 Applies a mapping to each item in the nested loader. More...
 
class  MarkAsTargetOperation
 Mark elements from the input data item as "target" which might affect the behavior of subsequent operations that rely on Operation::ProcessingPolicy or use other custom target-specific logic. More...
 
class  MarkovChain
 
class  MatrixBasedOperation
 Extension of the Operation class for operations based on a geometric transformation using a matrix (e.g. More...
 
class  MergeAsChannelsOperation
 Merge multiple images into one along the channel dimension. More...
 
class  MeshSegmentationAlgorithm
 Mesh segmentation algorithm based on a graph neural networks Converts an input Mesh to a Graph and runs a provided GNN model. More...
 
class  Metric
 The Metric interface is a key part of our pipeline for standardized evaluations of a machine learning pipeline, or an algorithm in general. More...
 
class  MetricAlgorithm
 Algorithm to compute metrics from a generic list of data The selected metric need to be set via the configure method: DataList algoInput = {labelMap1.get(), labelMap2.get()}; MetricAlgorithm metricAlgo(algoInput); Properties algoProps; algoProps.setParam("metricName", "DiceMetric"); metricAlgo.configure(&algoProps); metricAlgo.compute(); std::vector<Metric::Record> results = metricAlgo.metricOutput();. More...
 
struct  MetricException
 Custom exception for metrics. More...
 
struct  MLModelException
 Custom exception thrown by MachineLearningModel. More...
 
class  ModalitySynthesisAlgorithm
 Class for running an algorithm that that given an image in one modality generates the corresponding image in another modality. (e.g. MR to CT). More...
 
class  ModelConfiguration
 Configuration class for MachineLearningModel parameters. More...
 
class  MorphologicalFilterOperation
 Runs a morphological operation on the input mode (string): Name of the operation in ['dilation', 'erosion', 'opening', 'closing'] op_size (int): Size of the structuring element. More...
 
class  MRIBiasFieldCorrectionAlgorithm
 Algorithm to perform bias field correction using an implicitly trained neural network This algorithm addresses the problem of intensity inhomogeneities "bias fields" in magnetic resonance imaging (MRI). More...
 
class  MRIBiasFieldCorrectionOperation
 Operation to perform bias field correction using an implicitly trained neural network (see MRIBiasFieldCorrectionAlgorithm for more details and the parameters description) More...
 
class  MRIBiasFieldGenerationOperation
 Generate and optionally apply a smooth multiplicative intensity modulation ("bias") field. More...
 
class  MultiClassificationLearningEvaluation
 Class for evaluation of a multi-label classification method. More...
 
class  NetworkTrainingFileGenerator
 Generator of a Caffe neural network architecture text file from a set of the training data and some user-defined parameters This class is called from the GenerateCaffeTrainingDataAlgorithm to automatically produce a sample network suitable for training. More...
 
class  NormalizeMADOperation
 MAD (median absolute deviation) Normalize Operation. More...
 
class  NormalizeNormalOperation
 Channel-wise normalize values to mean 0, std 1, ignoring a certain background value if needed. More...
 
class  NormalizePercentileOperation
 Normalize the input image based on its intensity distribution, in particular on a lower and upper percentile. More...
 
class  NormalizeUniformOperation
 Normalize values in range [a, b]. More...
 
class  OneHotOperation
 Transform a label map into a multi-channel image based on a one-hot encoding Up to 4 channels are supported with OpenGL, more channels will fall back to CPU. More...
 
class  Operation
 Class to define a pre-post processing operation on data items. More...
 
struct  OperationException
 Custom exception to be used by Operation. More...
 
class  OperationsSequence
 Class to execute a sequence of Operation, depending on the workflow phase (training, validation, etc.). More...
 
class  OperationsSequenceAlgorithm
 Algorithm for running operations sequence on data. More...
 
class  OrderedMap
 Class for an insertion ordered map in order to mimic a python dictionary in C++ This is a convenience class which provides a similar interface to std::map and std::unordered_map It should be only used if there are not many elements to store or performance is not critical Due to its simple implementation it performs lookup only in O(N) More...
 
class  OrientedROISampler
 The OrientedROISampler samples m_numSamples samples of size m_roiSize from each dataset with an efficient GPU sampler. More...
 
class  PadDimsOperation
 Pad an image to specific target dimensions. More...
 
class  PadDimsToNextMultipleOperation
 Pads each dimension of the input image to the next multiple of the specified divisor. More...
 
class  PaddingDoneDataComponent
 Data component for keeping track of the original location of a patch in the original image. More...
 
class  PaddingDoneInfo
 Struct for geometrical information about how the patches were extracted from the original images. More...
 
class  PadOperation
 Pad an image to a specific padding size in each dimension. More...
 
struct  ParamException
 Special type for handling exceptions during parameter configuration. More...
 
class  PatchesFromImageDataComponent
 Data component for keeping track of the original location of a patch in the original image. More...
 
struct  PatchInfo
 Struct for storing the descriptor of the image a patch was extracted from and the region of interest in the original image. More...
 
class  PersistentCacheDataLoader
 Caches the dataset loaded until now in a persistent manner (on a disk location) More...
 
class  PixelwiseClassificationMetrics
 Compute dense classification related metrics between a label map and a ground truth segmentation Precisely, computes the sensitivity, specificity, precision and recall. More...
 
class  PixelwiseLearningStream
 Stream running a pixelwise learning model on another stream. More...
 
class  PolyCropOperation
 Masks the image with a convex polygon as described in Markova et al. More...
 
class  PrefetchDataLoader
 Prefetch the next items in a background thread. More...
 
class  PreprocessDataLoader
 Applies a preprocessing pipeline to each item in the nested loader. More...
 
class  ProcessingRecordComponent
 Data component for keeping track of the data's origin. More...
 
class  RandomAddDegradedLabelAsChannelOperation
 Operation to add a channel with randomly distributed blobs, whose sign is positive if a blob is in the label and else negative. More...
 
class  RandomAddRandomNoiseOperation
 Operation that randomly varies the intensity strength of the AddRandomNoiseOperation. More...
 
class  RandomAxisFlipOperation
 Flip image content along specified set of axes, with independent sampling for each axis. More...
 
class  RandomAxisRotationOperation
 Rotate around image axis with axis-specific rotation angles that are signed multiples of 90 degrees. More...
 
class  RandomChoiceOperation
 Meta-operation that picks one operation from its configuration randomly and executes it This is particularly useful for image samplers, where we might want to alternate between different ways of sampling the input images The operationWeights argument allows to parameterize the operation selection probability distribution, if not specified, uniform sampling is used. More...
 
class  RandomCropAroundLabelMapOperation
 Random version of CropAroundLabelMapOperation that selects a single random label value and crops around it. More...
 
class  RandomCropOperation
 Crop input images and label maps with a random factor crop_ranges (vec3): List of floats from [0;1] specifying the maximum percentage of the dimension to crop, for each axis. More...
 
class  RandomCutOutOperation
 Cut out regions in input images and label maps with a random factor cutout_number_range (vec2i): List of integers specifying the minimum and maximum number of cutout regions cutout_value_range (vec2f): List of floats specifying the minimum and maximum fill value for cutout regions cutout_size_lower (vec3): List of floats specifying the lower bound of the cutout region size for each dimension cutout_size_upper (vec3): List of floats specifying the upper bound of the cutout region size for each dimension cutout_size_units (ParamUnit): Units of the cutout size bounds, Default: ParamUnit::MM. More...
 
class  RandomDeformationOperation
 Same as DeformationOperation but samples displacements randomly from a specified range nSubdivisions (vec3i): list specifying the number of subdivisions for each dimension (the number of control points is subdivisions+1) maxAbsDisplacement (float): absolute value of the maximum possible displacement (mm) paddingMode (PaddingMode): defines which type of padding is used. More...
 
class  RandomGammaCorrectionOperation
 Apply a random gamma correction which changes the overall contrast (see https://en.wikipedia.org/wiki/Gamma_correction). More...
 
class  RandomImageFromLabelOperation
 Creates a random image from a label map, each label is sampled from a Gaussian distribution. More...
 
class  RandomInvertOperation
 Operation that randomly inverts an image with a default probability of 50% (can be changed) More...
 
class  RandomKeypointJitterOperation
 Adds an individually and randomly sampled offset to each keypoint of each KeypointElement. More...
 
class  RandomLinearIntensityMappingOperation
 Apply a random affine intensity mapping to an image. More...
 
class  RandomMRIBiasFieldGenerationOperation
 Apply a random multiplicative bias field The field amplitude, length scale and distance scaling are drawn from uniform distributions. More...
 
class  RandomOperation
 Abstract class for random operations that build upon another one In order to create a randomized version of a BaseOperation, you need to derive from RandomOperation<BaseOperation> and just implement the method randomizeOperation. More...
 
class  RandomPolyCropOperation
 Masks the image with a random convex polygon as described in Markova et al. More...
 
class  RandomResolutionReductionOperation
 Reduces the resolution of an image to a spacing randomly sampled in each dimension between the image spacing and the specified max_spacing max_spacing (vec3): maximum spacing for resolution reduction. More...
 
class  RandomROISampler
 Sampler which randomly samples ROIs from the input image and label map with a target The images will be padded if the target size is larger than the input image. More...
 
class  RandomRotationOperation
 Rotate input images and label maps with random angles. More...
 
class  RandomScalingOperation
 Scale input images and label maps with random factors scales_range (vec3): List of floats specifying the upper bound of the range from which the scaling ofset will be sampled. More...
 
class  RandomSmoothOperation
 Apply a random smoothing on the image (Gaussian kernel). More...
 
class  RandomTemplateInpaintingOperation
 Inpaints a template into an image with randomly selected spatial and intensity transformation in a given range. More...
 
class  RecombinePatchesOperation
 Operation to recombine image patches back into a full image. More...
 
class  RectifyRotationOperation
 Sets the rotation matrix of each element to the nearest xyz-axis aligned rotation to avoid oblique angles when baking in the rotation. More...
 
struct  ReferenceImageDataComponent
 Data component used to store a reference image. More...
 
struct  RegionOfInterest
 Helper struct to represent a region of interest. More...
 
class  Registry
 
class  RegressionLearningEvaluation
 Class for evaluation of a regression method. More...
 
class  RemoveMaskOperation
 Removes the mask of all input images. More...
 
class  RemoveOperation
 Remove a set of fields from a DataItem Use 'apply_to' from base to specify which fields to remove. More...
 
class  RenameOperation
 Rename a set of fields of a DataItem source (List[str]): list of the elements to be replaced target (List[str]): list of names of the new elements (must match the size of source) throw_error_on_missing_source (bool): if source field is missing, then throw an error (otherwise do nothing) throw_error_on_existing_target (bool): if target field already exists, then throw an error (otherwise overwrite it) More...
 
class  RepeatDataLoader
 Repeats items coming from a nested loader. More...
 
class  ReplaceLabelsValuesOperation
 Replace label values (assumes that it is unsigned byte) More...
 
class  ResampleDimsOperation
 Resample input to target dimensions. More...
 
class  ResampleKeepingAspectRatioOperation
 Resample input to target dimensions while keeping aspect ratio of original images. More...
 
class  ResampleOperation
 Resample input to target spacing. More...
 
class  ResampleToInputOperation
 Resample to a target image. More...
 
class  ResolutionReductionOperation
 Reduces the resolution of an image to a specified spacing by keeping image dimensions target_spacing (vec3): target spacing for intermediate downsampling before upsampling again. More...
 
class  RotationOperation
 Rotate input images and label maps with fixed angles. More...
 
class  RunModelOperation
 Run a machine learning model on the input item and merge the prediction to the input item. More...
 
class  SampleDataLoader
 Extract samples from each item in the nested loader. More...
 
class  SamplingConfiguration
 
class  ScalingOperation
 Scale input images and label maps with fixed factors scales (vec3): Scaling factor applied to each dimension apply_now (bool): Bake transformation right way (otherwise, just changes the matrix) More...
 
class  SelectChannelsOperation
 Select a sub-set of the input channels. More...
 
class  SetLabelModalityOperation
 Sets the data modality of labels to Data::Modality::LABEL if data type is PixelType::UByte, otherwise casts a warning and skips execution. More...
 
class  SetMatrixToIdentityOperation
 Set the matrices of all images to identity (associated landmarks and boxes will be moved accordingly). More...
 
class  SetModalityOperation
 Sets the data modality. More...
 
class  SetSpacingOperation
 Sets spacing of image elements (data buffer is not changed). More...
 
class  ShuffleDataLoader
 Shuffles the next specified items in the nested loader. More...
 
class  SigmoidOperation
 Apply a sigmoid function on values. More...
 
class  Singleton
 Base class for singletons. More...
 
class  SISBasedElement
 Interface for DataElement based on SharedImageSet. More...
 
class  SmoothOperation
 Run a convolution with a Gaussian kernel on the input image. More...
 
class  SoftmaxOperation
 Computes channel-wise softmax of input image. More...
 
class  SplitDataLoader
 Splits the items in the nested loader into DataItems containing a single image (batch size of 1) More...
 
class  SplitIntoPatchesOperation
 Operation which splits the input image into overlapping patches for sliding window inference. More...
 
class  SplitROISampler
 Sampler which splits the input image into overlapping ROIs for sliding window inference. More...
 
class  StandardizeImageAxesOperation
 Reorganize the memory buffer of a medical image to ensure anatomical consistency. More...
 
struct  Status
 Convenience tool for returning error messages together with statuses. More...
 
class  SurfaceDistancesMetric
 Compute a set of distance-based metrics between a label map and a ground truth segmentation. More...
 
class  SwapImageAndLabelsOperation
 Swap image and labels. More...
 
class  SyncOperation
 Sync shared memory of images. More...
 
class  TagDataElementOperation
 Operation for changing data element tags. More...
 
class  TanhOperation
 Apply a tanh function on values. More...
 
class  TargetTag
 Simple data component to identify data that must be considered as learning target. More...
 
class  TemplateInpaintingOperation
 Inpaints a template into an image with specified spatial and intensity transformation. More...
 
class  Tensor
 Implementation of a Tensor class; used in TensorDataElement to directly present data to a neural network. More...
 
class  TensorSet
 Class for managing sets of tensors, one for each frame in the set. More...
 
class  TensorSetElement
 DataElements for Raw Tensors (Experimental) Unlike ImageElements, these elements will go into the ML engine in the shape that they are created (i.e. More...
 
class  ThresholdOperation
 Threshold values of the input image. More...
 
class  UndoPaddingOperation
 Apply the inverse of a previously applied padding operation. More...
 
class  UnmarkAsTargetOperation
 Remove the target tag from the elements of the input data item. More...
 
class  VectorElement
 DataElement for non-image data (such as imagewise labels), represented as 1D images (i.e. More...
 

Typedefs

template<typename ParamType>
using LoaderParam = ML::AdvancedParameter<ParamType, DataLoader>
 
using DataLoaderList = std::vector<std::unique_ptr<DataLoader>>
 
using DataLoaderDecoratorFactory = ML::Singleton<ML::Factory<DataLoader, DataLoaderList, const Properties&>>
 
using DataReaderFactory = Singleton<Factory<DataReader, const Properties&>>
 
using EngineFactory = Singleton<Registry<Factory<Engine, const Properties&>>>
 Engine Factory, this is instantiated in GenericFactory.cpp.
 
using EngineSubFactory = Factory<Engine, const Properties&>
 Sub-factories (e.g. C++, Python) of the main factory.
 
template<typename ParamType>
using EngineParameter = AdvancedParameter<ParamType, EngineConfiguration>
 
using MetricFactory = Singleton<Factory<Metric, const Properties&>>
 Machine Learning Operation registry typedef.
 
template<typename ParamType>
using SamplingParameter = AdvancedParameter<ParamType, SamplingConfiguration>
 
template<typename ParamType>
using ModelParameter = AdvancedParameter<ParamType, ModelConfiguration>
 
template<typename ParamType>
using OpParam = ML::AdvancedParameter<ParamType, Operation>
 
using OperationFactory = Singleton<Registry<Factory<Operation, std::optional<const Properties>>>>
 Machine Learning Operation registry typedef.
 
using OperationSubFactory = Factory<Operation, std::optional<const Properties>>
 Sub-factories (e.g. C++, Python) for the main factory.
 
using FilterFunction = std::function<bool(const DataItem&)>
 
using FilterFunctionRegistry = Singleton<Registry<FilterFunction>>
 
using MapFunction = std::function<void(DataItem&)>
 
using MapFunctionRegistry = Singleton<Registry<MapFunction>>
 
using KeyMapping = std::unordered_map<size_t, DataItem::Field>
 Maps the indices in a DataList to field names to be used in the data item Note: the FileReader uses ML::open to load the content of a file, so in order to fill a DataItem with the data in the datalist we need to assign them to a field specified by the user.
 

Enumerations

enum class  ParamRequired { Yes , No }
 Enum to specify whether the parameter is required when configuring the parent class via the configure method.
 
enum class  ParamUnit { MM = 0 , Fraction = 1 , Voxel = 2 }
 Enum for the different types of parameter units. More...
 
enum class  Cardinality { Fixed = 0 , Dynamic = 1 , Infinite = 2 }
 Specifies the type of cardinality (or length) of a Dataset or a DataLoader, in particular whether the amount of produced items is fixed. More...
 
enum class  ExecutionProvider {
  CPU = 0 , Custom = 1 , CUDA = 2 , DirectML = 3 ,
  OpenVino = 4 , MPS = 5
}
 Options for acceleration providers used by engines.
 
enum class  ComputingDevice { ForceCPU = 0 , GPUIfGlImage , GPUIfOpenGl , ForceGPU }
 Computing device strategy. More...
 
enum class  Phase { Training = 1 , Validation = 2 , Inference = 4 , Always = Training | Validation | Inference }
 Various phases of a ML model - they can be used to control if some processing operations must be executed. More...
 
enum class  ModelType { Unknown = -1 , RandomForest , NeuralNetwork }
 Enum for different learning models. More...
 
enum class  PredictionType { Unknown = -1 , Classification , Regression , ObjectDetection }
 Types of prediction type. More...
 
enum class  PredictionOutput {
  Unknown = -1 , Vector , Image , Keypoints ,
  BoundingBoxes , Tensor
}
 Types of prediction output. More...
 
enum class  ElementType {
  Image = 0 , BoundingBox = 1 , Keypoint = 2 , Vector = 3 ,
  Tensor = 4
}
 Types of elements that a data item might contain. More...
 
enum class  InterleaveMode { Alternate , Proportional , Unknown }
 Enum used to determine the behaviour of the InterleaveDataLoader. More...
 
enum class  ResetCriterion { Fixed , SmallestLoader , LargestLoader , Unknown }
 Reset criterion determines when interleaving dataloaders are reset. More...
 
enum class  RecombineMode { Default = 0 , Weighted }
 Recombination mode for handling overlapping patches when reconstructing an image from patches. More...
 

Functions

std::string paramUnitToString (ParamUnit unit)
 
ParamUnit stringToParamUnit (const std::string &unitStr)
 
bool isCudaComputeCapabilitySupported (int deviceCCmajor, int deviceCCminor, int cudaRuntimeMajor, int cudaRuntimeMinor, const std::vector< CudaComputeCapability > &supportedComputeCapabilities)
 Check if the device is supported by the CUDA runtime.
 
Cardinality operator&& (Cardinality first, Cardinality second)
 
void debugMermaidOutput (DataLoader const &dataLoader, std::ostream &out)
 Output a Mermaid compatible flow graph to visualize the data flow.
 
std::optional< std::stringisPythonOperationUsed (const std::vector< std::string > &opNames)
 Utility function for checking whether a python operation is used.
 
std::vector< DataLoaderSpecspropertyToDataLoaderSpecs (const Properties &properties)
 
std::vector< DataLoaderSpecspropertyListToDataLoaderSpecs (const PropertyList &propertyList)
 
std::vector< std::unique_ptr< Properties > > dataLoaderSpecsToPropertyList (const std::vector< DataLoaderSpecs > &specs)
 
EngineSubFactorygetSubEngineFactory (const std::string &subFactoryName)
 Get (and create if it does not exist yet) a sub-factory from a name.
 
EngineSubFactorygetCppEngineFactory ()
 Helper function to get the C++ factory from the registry.
 
bool isNotEmpty (DataItem const &dataItem)
 Returns false if the input data item is empty.
 
bool hasNonZeroInputImage (DataItem const &dataItem)
 Returns false if any non-target SharedImageSets in the dataitem are images with only zeros in them, otherwise true.
 
bool hasNonZeroTargetImage (DataItem const &dataItem)
 Returns false if any target SharedImageSets in the dataitem are images with only zeros in them, otherwise true.
 
template<typename MetricType>
std::unique_ptr< MetricType > createMetric (const Properties &p)
 
OwningDataList open (const std::string &filename)
 Similar to ApplicationController::open but does not require an ApplicationController.
 
std::optional< KeypointSetloadKeypoints (const std::string &path)
 Helper methods to load keypoints and bounding boxes.
 
std::optional< BoundingBoxSetloadBoundingBoxes (const std::string &path)
 
bool saveKeypoints (const KeypointSet &keypoints, const std::string &path)
 
bool saveBoundingBoxes (const BoundingBoxSet &bboxes, const std::string &path)
 
bool landmarksToJson (const std::string &path, const KeypointSet &lms)
 Helper methods to load keypoints and bounding boxes from json files this allows to load keypoints and bboxes exported from ImFusionLabels as KeypointSet and BoundingBoxes.
 
bool boundingBoxesToJson (const std::string &path, const BoundingBoxSet &bbs)
 
std::optional< KeypointSetlandmarksFromJson (const std::string &path)
 
std::optional< BoundingBoxSetboundingBoxesFromJson (const std::string &path)
 
OperationSubFactorygetSubOperationFactory (const std::string &subFactoryName)
 Get (and create if it does not exist yet) a sub-factory from a name.
 
OperationSubFactorygetCppOperationFactory ()
 Helper function to get the C++ factory from the registry.
 
template<typename Op>
std::unique_ptr< Op > makeUniqueOperation (std::optional< const Properties > p)
 
template<typename Op>
std::shared_ptr< Op > makeOperation (std::optional< const Properties > p)
 
void recordOperationForInversion (Operation &op, DataElement *element)
 
std::vector< Operation::SpecspropertyToProcessingSpecs (const Properties &properties)
 
std::vector< Operation::SpecspropertyListToProcessingSpecs (const PropertyList &propertyList)
 
std::vector< std::unique_ptr< Properties > > processingSpecsToPropertyList (const std::vector< Operation::Specs > &specs)
 
bool isTarget (const SharedImageSet &input)
 Check if an image is marked as a target.
 
void tagAsTarget (SharedImageSet &input)
 Tag an image as a target.
 
void untagAsTarget (SharedImageSet &input)
 Untag an image as label.
 
bool isSemanticSegmentationMap (const SharedImageSet &input)
 Check if the image is a segmentation label map (with discrete values). This function should be used to determine how algorithms like downsampling/interpolation/etc. should treat this image, e.g. use nearest neighbor instead of linear interpolation.
 
ML::ComputingDevice stringToDevice (const std::string &s)
 Convert string input to a computing device.
 
std::string deviceToString (ML::ComputingDevice device)
 Convert computing device to string.
 
Phase stringToPhase (const std::string &s)
 Convert string input to a phase.
 
std::string phaseToString (Phase phase)
 Convert phase to a string.
 
std::string modelTypeToString (ML::ModelType type)
 Convert prediction type to a string.
 
ML::ModelType stringToModelType (const std::string &type)
 Convert prediction type to a string.
 
std::string predictionTypeToString (ML::PredictionType type)
 Convert prediction type to a string.
 
ML::PredictionType stringToPredictionType (const std::string &type)
 Convert prediction type to a string.
 
std::string predictionOutputToString (ML::PredictionOutput type)
 Convert prediction output to a string.
 
ML::PredictionOutput stringToPredictionOutput (const std::string &type)
 Convert string to prediction output.
 
std::string elementTypeToString (ML::ElementType type)
 Convert ElementType to a string.
 
ML::ElementType stringToElementType (const std::string &type)
 Convert string to ElementType.
 
std::string interleaveModeToString (ML::InterleaveMode mode)
 Convert InterleaveMode to a string representation.
 
ML::InterleaveMode stringToInterleaveMode (const std::string &type)
 Convert string representation to a InterleaveMode.
 
std::string resetCriterionToString (ML::ResetCriterion mode)
 Convert ResetCriterion to a string representation.
 
ML::ResetCriterion stringToResetCriterion (const std::string &type)
 Convert string representation to a ResetCriterion.
 
bool shouldRunOnGPU (ML::ComputingDevice deviceStrategy, const SharedImageSet *image, bool allowMoreThan4Channels=false, std::function< void(std::string &&)> &&warnFunc=[](std::string &&) {})
 Return whether an algorithm should choose the GPU implementation.
 
std::map< std::string, std::vector< std::string > > readDataList (std::string path, std::vector< std::string > prependKeys={"dataPath", "labelPath"})
 Read a data list file from an exported Labels project.
 
std::vector< std::vector< float > > convertSharedImageSetToVectors (const SharedImageSet &input)
 Convert a shared image set to a vector of vector (useful for imagewise predictions)
 
std::string modelPathToAbsoluteIfNotResource (const std::string &path, const std::string &refConfigFile="")
 Convert a model path to an absolute path, taking into account multiple special behaviour (sanitize path obtained by copy/pasting and "copying as path" from Windows explorer, i.e.
 
std::string recombineModeToString (RecombineMode mode)
 Convert RecombineMode to a string.
 
RecombineMode stringToRecombineMode (const std::string &str)
 Convert a string to RecombineMode.
 
bool operator== (const PaddingDoneInfo &lhs, const PaddingDoneInfo &rhs)
 
bool operator!= (const PaddingDoneInfo &lhs, const PaddingDoneInfo &rhs)
 
bool operator== (const PatchInfo &lhs, const PatchInfo &rhs)
 
bool operator!= (const PatchInfo &lhs, const PatchInfo &rhs)
 

Typedef Documentation

◆ KeyMapping

Maps the indices in a DataList to field names to be used in the data item Note: the FileReader uses ML::open to load the content of a file, so in order to fill a DataItem with the data in the datalist we need to assign them to a field specified by the user.

Example1 : load(myfile.txt) -> DataList{sis1, sis2, sis3} a possible key mapping could be {{0, "data"}, {1, "label"}, {2, "mask"}}. The resulting DataItem will be: {{"data", sis1}, {"label", sis2}, {"mask", sis3}}

If you don't need all the data in the datalist, you can skip some by not specifying an index mapping for the data you want to skip

Example 2: load(myfile.txt) -> DataList{sis1, sis2, sis3} mapping: {{0, "data"}, {2, "mask"}}. The resulting DataItem will be: {{"data", sis1}, {"mask", sis3}}

Enumeration Type Documentation

◆ ParamUnit

enum class ParamUnit
strong

Enum for the different types of parameter units.

Enumerator
MM 

parameter provided in mm

Fraction 

parameter provided in fractional units of the image extent

Voxel 

parameter provided in voxel units

◆ Cardinality

enum class Cardinality
strong

Specifies the type of cardinality (or length) of a Dataset or a DataLoader, in particular whether the amount of produced items is fixed.

For instance, a data loader that splits a set of images into individual images cannot know in advance the number of items to be produced since it depends on the actual content of the loaded files.

Enumerator
Fixed 

The number of items to be produced can be determined in advance (i.e. without depending on the item content)

Dynamic 

The number of items to be produced cannot be determined in advance but is guaranteed to be finite.

Infinite 

The number of items to be produced is infinite.

◆ ComputingDevice

enum class ComputingDevice
strong

Computing device strategy.

Enumerator
ForceCPU 

Force computation on the CPU.

GPUIfGlImage 

Use GPU only if the image has already been uploaded to the GPU.

GPUIfOpenGl 

Use GPU only if an OpenGL context is available.

ForceGPU 

Force computation on the GPU (throws if not possible)

◆ Phase

enum class Phase
strong

Various phases of a ML model - they can be used to control if some processing operations must be executed.

For instance, input normalization should always be executed, but random augmentations would typically only be executed at training time.

Enumerator
Training 

Training of the model, i.e. when its parameter are optimized.

Validation 

Evaluation of the model during training (only to compute the metrics on a held out dataset)

Inference 

When the model is actually deployed and ran on a new input.

Always 

Convenience value to include all phases.

◆ ModelType

enum class ModelType
strong

Enum for different learning models.

Enumerator
Unknown 

Default, invalid value.

RandomForest 

Random forest (not supported anymore)

NeuralNetwork 

Neural network (standard value)

◆ PredictionType

enum class PredictionType
strong

Types of prediction type.

Enumerator
Unknown 

Default, invalid value.

Classification 

Prediction is categorical.

Regression 

Prediction is a continuous value.

ObjectDetection 

Prediction is a set of BoundingBox, plus optionally Keypoints and Masks.

◆ PredictionOutput

enum class PredictionOutput
strong

Types of prediction output.

Enumerator
Unknown 

Default, invalid value.

Vector 

Output size does not depend on the input size.

Image 

Output has the same size as the input.

Keypoints 

Output is a set of keypoints.

BoundingBoxes 

Output is a set of bounding boxes.

Tensor 

Output is a set of tensors.

◆ ElementType

enum class ElementType
strong

Types of elements that a data item might contain.

Enumerator
Image 

Element representing a set of 2D or 3D images.

BoundingBox 

Element representing a set of 2D or 3D bounding boxes.

Keypoint 

Element representing a set of 2D or 3D landmarks.

Vector 

Element representing a set of scalar (1D) values.

Tensor 

Element representing an arbitrary array of values, for instance used for graphs.

◆ InterleaveMode

enum class InterleaveMode
strong

Enum used to determine the behaviour of the InterleaveDataLoader.

Enumerator
Alternate 

Continuously interleaves each dataloader one dataitem at a time regardless of size until the reset criterion is met.

Proportional 

Interleaves dataloaders proportional to their size.

Unknown 

Default, invalid value.

◆ ResetCriterion

enum class ResetCriterion
strong

Reset criterion determines when interleaving dataloaders are reset.

Enumerator
Fixed 

Use a fixed parameter to control the epoch size.

SmallestLoader 

Stop as soon as the smallest loader is exhausted.

LargestLoader 

Stop when the largest loader is exhausted.

Unknown 

Default, invalid value.

◆ RecombineMode

enum class RecombineMode
strong

Recombination mode for handling overlapping patches when reconstructing an image from patches.

This determines how pixel values from overlapping patches are combined. See RecombinePatchesOperation for more details on each mode.

Enumerator
Default 

Simple averaging of patch voxels in overlapping regions.

Weighted 

Each patch is decayed at its borders with a Gaussian function.

Function Documentation

◆ isCudaComputeCapabilitySupported()

bool isCudaComputeCapabilitySupported ( int deviceCCmajor,
int deviceCCminor,
int cudaRuntimeMajor,
int cudaRuntimeMinor,
const std::vector< CudaComputeCapability > & supportedComputeCapabilities )

Check if the device is supported by the CUDA runtime.

Parameters
deviceCCmajorThe major version of the GPU
deviceCCminorThe minor version of the GPU
cudaRuntimeMajorThe major version of the CUDA runtime
cudaRuntimeMinorThe minor version of the CUDA runtime
supportedComputeCapabilitiesThe list of supported Compute Capabilities of the CUDA library

◆ open()

OwningDataList open ( const std::string & filename)

Similar to ApplicationController::open but does not require an ApplicationController.

Cannot open all files that ApplicationController supports (e.g. workspaces).

◆ isTarget()

bool isTarget ( const SharedImageSet & input)

Check if an image is marked as a target.

This function should be used to determine whether it is an input data or a target data. Note: if an image is tagged with deprecated LabelTag, this function consideres it a target and returns true.

◆ untagAsTarget()

void untagAsTarget ( SharedImageSet & input)

Untag an image as label.

Note: if an image is tagged with deprecated LabelTag, this function removes the LabelTag as well

◆ readDataList()

std::map< std::string, std::vector< std::string > > readDataList ( std::string path,
std::vector< std::string > prependKeys = {"dataPath", "labelPath"} )

Read a data list file from an exported Labels project.

Returns a string to vector map, where the keys are defined by the header of the file.

◆ modelPathToAbsoluteIfNotResource()

std::string modelPathToAbsoluteIfNotResource ( const std::string & path,
const std::string & refConfigFile = "" )

Convert a model path to an absolute path, taking into account multiple special behaviour (sanitize path obtained by copy/pasting and "copying as path" from Windows explorer, i.e.

remove file:/// prefix and double quotes, or prepending the ML default model path). When calling this function on a sidecar file, the original path to the configuration file can be provided so that the sidecar file can be searched in the same folder.

Search Tab / S to search, Esc to close