Intensity transforms
intensity_transforms
#
ClipIntensity
dataclass
#
Bases: imgtools.transforms.intensity_transforms.IntensityTransform
ClipIntensity operation class.
A callable class that clips image grey level intensities to specified range.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
float
|
The lower bound on grey level intensity. Voxels with lower intensity will be set to this value. |
required |
|
float
|
The upper bound on grey level intensity. Voxels with higer intensity will be set to this value. |
required |
Methods:
| Name | Description |
|---|---|
supports_reference |
Return whether this transform supports reference images. |
IntensityTransform
#
Bases: imgtools.transforms.base_transform.BaseTransform
Base class for intensity transforms.
Intensity transforms modify the pixel/voxel intensity values of an image without changing its spatial properties.
All intensity transforms operate on individual pixel/voxel values independently, leaving the image dimensions, spacing, and orientation unchanged.
Examples:
>>> # This is an abstract base class and cannot be instantiated directly.
>>> # Use one of its subclasses like ClipIntensity or WindowIntensity.
Methods:
| Name | Description |
|---|---|
supports_reference |
Return whether this transform supports reference images. |
N4BiasFieldCorrection
dataclass
#
Bases: imgtools.transforms.intensity_transforms.IntensityTransform
N4BiasFieldCorrection operation class.
A callable class that applies N4 bias field correction to reduce smooth intensity inhomogeneities (bias fields) commonly found in MR imaging. This transform corrects voxel intensities while preserving image geometry (spacing, orientation, and dimensions).
The correction uses SimpleITK's N4BiasFieldCorrectionImageFilter, which implements the N4 algorithm (Tustison et al., 2010).
Notes
- This transform is computationally intensive and may take several seconds to minutes depending on image size.
- Best suited for MR images; application to other modalities is typically not meaningful.
- No rotation, translation, or scaling is applied.
Methods:
| Name | Description |
|---|---|
supports_reference |
Return whether this transform supports reference images. |
WindowIntensity
dataclass
#
Bases: imgtools.transforms.intensity_transforms.IntensityTransform
WindowIntensity operation class.
A callable class that restricts image grey level intensities to a given window and level. This is commonly used in medical imaging to enhance visibility of specific tissue types (e.g., bone window, lung window in CT).
The window/level parameters define a range centered at the 'level' value with a width of 'window'. All intensities outside this range are clipped.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
|
float
|
The width of the intensity window. Must be positive. |
required |
|
float
|
The mid-point of the intensity window. |
required |
Methods:
| Name | Description |
|---|---|
supports_reference |
Return whether this transform supports reference images. |