medpy.filter.IntensityRangeStandardization.IntensityRangeStandardization.transform

IntensityRangeStandardization.transform(image, surpress_mapping_check=False)[source]

Transform an images intensity values to the learned standard intensity space.

Note that the passed image should be masked to contain only the foreground.

The transformation is guaranteed to be lossless i.e. a one-to-one mapping between old and new intensity values exists. In cases where this does not hold, an error is thrown. This can be suppressed by setting surpress_mapping_check to ‘True’. Do this only if you know what you are doing.

Parameters:

image : array_like

The image to transform.

surpress_mapping_check : bool

Whether to ensure a lossless transformation or not.

Returns:

image : ndarray

The transformed image

Raises:

InformationLossException

If a lossless transformation can not be ensured

Exception

If no model has been trained before