|
Medical Imaging Interaction Toolkit
2026.06.00
Medical Imaging Interaction Toolkit
|
Collection of static utility functions for classification and image processing. More...
#include <mitkCLUtil.h>
Public Types | |
| enum | MorphologicalDimensions { Axial , Coronal , Sagittal , All } |
| Specifies the anatomical plane for morphological operations. More... | |
Static Public Member Functions | |
| static void | CreateCheckerboardMask (mitk::Image::Pointer image, mitk::Image::Pointer &outimage) |
| Create a checkerboard mask from the given image. More... | |
| static void | InterpolateCheckerboardPrediction (mitk::Image::Pointer checkerboard_prediction, mitk::Image::Pointer &checkerboard_mask, mitk::Image::Pointer &outimage) |
| Interpolate a prediction using a checkerboard pattern. More... | |
| static void | CountVoxel (mitk::Image::Pointer image, std::map< unsigned int, unsigned int > &map) |
| Count voxels per label in an image. More... | |
| static void | CountVoxel (mitk::Image::Pointer image, unsigned int label, unsigned int &count) |
| Count the number of voxels with a specific label value. More... | |
| static void | CountVoxel (mitk::Image::Pointer image, unsigned int &count) |
| Count the total number of non-zero voxels. More... | |
| static void | SumVoxelForLabel (mitk::Image::Pointer image, const mitk::Image::Pointer &source, unsigned int label, double &val) |
| Sum intensity values from a source image for voxels matching a given label. More... | |
| static void | SqSumVoxelForLabel (mitk::Image::Pointer image, const mitk::Image::Pointer &source, unsigned int label, double &val) |
| Sum squared intensity values from a source image for voxels matching a given label. More... | |
| static void | LogicalAndImages (const Image::Pointer &image1, const Image::Pointer &image2, Image::Pointer &outimage) |
| Compute the logical AND of two binary images. More... | |
| static void | GaussianFilter (mitk::Image::Pointer image, mitk::Image::Pointer &smoothed, double sigma) |
| Apply a Gaussian smoothing filter to an image. More... | |
| static void | DifferenceOfGaussianFilter (mitk::Image::Pointer image, mitk::Image::Pointer &smoothed, double sigma1, double sigma2) |
| Compute the Difference of Gaussians (DoG) of an image. More... | |
| static void | LaplacianOfGaussianFilter (mitk::Image::Pointer image, mitk::Image::Pointer &smoothed, double sigma1) |
| Compute the Laplacian of Gaussian (LoG) of an image. More... | |
| static void | HessianOfGaussianFilter (mitk::Image::Pointer image, std::vector< mitk::Image::Pointer > &out, double sigma) |
| Compute the Hessian of Gaussian for an image. More... | |
| static void | LocalHistogram (mitk::Image::Pointer image, std::vector< mitk::Image::Pointer > &out, int Bins, int NeighbourhoodSize) |
| Compute local histograms for each voxel in an image. More... | |
| template<typename TMatrixElementType > | |
| static mitk::Image::Pointer | Transform (const Eigen::Matrix< TMatrixElementType, Eigen::Dynamic, Eigen::Dynamic > &matrix, const mitk::Image::Pointer &mask) |
| Transform an Eigen matrix back to an MITK image using a mask. More... | |
| template<typename TMatrixElementType > | |
| static Eigen::Matrix< TMatrixElementType, Eigen::Dynamic, Eigen::Dynamic > | Transform (const mitk::Image::Pointer &img, const mitk::Image::Pointer &mask) |
| Transform an MITK image into an Eigen column matrix using a mask. More... | |
| static void | DilateBinary (mitk::Image::Pointer &sourceImage, mitk::Image::Pointer &resultImage, int radius, MorphologicalDimensions d) |
| Dilate a binary image using a ball structuring element. More... | |
| static void | ErodeBinary (mitk::Image::Pointer &sourceImage, mitk::Image::Pointer &resultImage, int radius, MorphologicalDimensions d) |
| Erode a binary image using a ball structuring element. More... | |
| static void | ClosingBinary (mitk::Image::Pointer &sourceImage, mitk::Image::Pointer &resultImage, int radius, MorphologicalDimensions d) |
| Perform morphological closing on a binary image. More... | |
| static void | MergeLabels (mitk::Image::Pointer &img, const std::map< unsigned int, unsigned int > &map) |
| Merge labels in a label image according to a mapping. More... | |
| static void | ConnectedComponentsImage (mitk::Image::Pointer &image, mitk::Image::Pointer &mask, mitk::Image::Pointer &outimage, unsigned int &num_components) |
| Compute connected components of a label image. More... | |
| static void | GrabLabel (mitk::Image::Pointer &image, mitk::Image::Pointer &outimage, unsigned int label) |
| Extract a single label from a label image into a binary mask. More... | |
| static void | InsertLabel (mitk::Image::Pointer &image, mitk::Image::Pointer &maskImage, unsigned int label) |
| Insert a label value into an output image at positions defined by a mask. More... | |
| static void | ErodeGrayscale (mitk::Image::Pointer &image, unsigned int radius, mitk::CLUtil::MorphologicalDimensions d, mitk::Image::Pointer &outimage) |
| Perform grayscale erosion using a ball structuring element. More... | |
| static void | DilateGrayscale (mitk::Image::Pointer &image, unsigned int radius, mitk::CLUtil::MorphologicalDimensions d, mitk::Image::Pointer &outimage) |
| Perform grayscale dilation using a ball structuring element. More... | |
| static void | FillHoleGrayscale (mitk::Image::Pointer &image, mitk::Image::Pointer &outimage) |
| Fill holes in a grayscale image. More... | |
| static void | ProbabilityMap (const mitk::Image::Pointer &sourceImage, double mean, double std_dev, mitk::Image::Pointer &resultImage) |
| Create a probability map based on Gaussian distribution parameters. More... | |
| template<class TImageType > | |
| static void | itkCountVoxel (TImageType *image, std::map< unsigned int, unsigned int > &map) |
| template<class TImageType > | |
| static void | itkCountVoxel (TImageType *image, typename TImageType::PixelType label, unsigned int &count) |
| template<typename TImageType > | |
| static void | itkCountVoxel (TImageType *mask, unsigned int &n_numSamples) |
| template<class TImageType1 , class TImageType2 > | |
| static void | itkSampleLabel (TImageType1 *image, TImageType2 *output, double acceptrate, unsigned int label) |
| template<class TImageType > | |
| static void | itkSampleLabel (TImageType *image, mitk::Image::Pointer &output, unsigned int n_samples_drawn) |
Collection of static utility functions for classification and image processing.
CLUtil provides convenience methods for voxel counting, morphological operations, image filtering (Gaussian, DoG, LoG, Hessian), label manipulation, and conversion between Eigen matrices and MITK images.
Definition at line 39 of file mitkCLUtil.h.
Specifies the anatomical plane for morphological operations.
| Enumerator | |
|---|---|
| Axial | Axial (transverse) plane. |
| Coronal | Coronal (frontal) plane. |
| Sagittal | Sagittal plane. |
| All | All three dimensions (3D operation). |
Definition at line 45 of file mitkCLUtil.h.
|
static |
Perform morphological closing on a binary image.
| sourceImage | The input binary image. |
| resultImage | The closed output image. |
| radius | Radius of the structuring element in voxels. |
| d | The anatomical dimension(s) for the operation. |
|
static |
Compute connected components of a label image.
| image | The input label image. |
| mask | Optional mask restricting the region. Can be nullptr. |
| outimage | The output image with unique labels per connected component. |
| num_components | The number of connected components found. |
|
static |
Count voxels per label in an image.
| [in] | image | The label image. |
| [out] | map | Map from label value to voxel count. |
Referenced by Transform().
|
static |
Count the total number of non-zero voxels.
| [in] | image | The input image. |
| [out] | count | The total count of voxels with value > 0. |
|
static |
Count the number of voxels with a specific label value.
| [in] | image | The label image. |
| [in] | label | The label value to count. |
| [out] | count | The number of voxels with the given label. |
|
static |
Create a checkerboard mask from the given image.
| [in] | image | The input image. |
| [out] | outimage | The resulting checkerboard mask. |
|
static |
Compute the Difference of Gaussians (DoG) of an image.
The result is the difference between two Gaussian-smoothed images with sigmas sigma1 and sigma2.
| [in] | image | The input image. |
| [out] | smoothed | The DoG output image. |
| [in] | sigma1 | Standard deviation of the first Gaussian. |
| [in] | sigma2 | Standard deviation of the second Gaussian. |
|
static |
Dilate a binary image using a ball structuring element.
| sourceImage | The input binary image. |
| resultImage | The dilated output image. |
| radius | Radius of the structuring element in voxels. |
| d | The anatomical dimension(s) for the operation. |
|
static |
Perform grayscale dilation using a ball structuring element.
| image | The input image. |
| radius | Radius of the structuring element in voxels. |
| d | The anatomical dimension(s) for the operation. |
| outimage | The dilated output image. |
|
static |
Erode a binary image using a ball structuring element.
| sourceImage | The input binary image. |
| resultImage | The eroded output image. |
| radius | Radius of the structuring element in voxels. |
| d | The anatomical dimension(s) for the operation. |
|
static |
Perform grayscale erosion using a ball structuring element.
| image | The input image. |
| radius | Radius of the structuring element in voxels. |
| d | The anatomical dimension(s) for the operation. |
| outimage | The eroded output image. |
|
static |
Fill holes in a grayscale image.
| image | The input image. |
| outimage | The output image with holes filled. |
|
static |
Apply a Gaussian smoothing filter to an image.
| [in] | image | The input image. |
| [out] | smoothed | The smoothed output image. |
| [in] | sigma | Standard deviation of the Gaussian kernel. |
|
static |
Extract a single label from a label image into a binary mask.
| image | The input label image. |
| outimage | The output binary image (1 where label matches, 0 otherwise). |
| label | The label value to extract. |
|
static |
Compute the Hessian of Gaussian for an image.
Produces multiple output images corresponding to the Hessian matrix components.
| [in] | image | The input image. |
| [out] | out | Vector of output images for each Hessian component. |
| [in] | sigma | Standard deviation of the Gaussian. |
|
static |
Insert a label value into an output image at positions defined by a mask.
| image | The output image to insert the label into (created if null). |
| maskImage | The mask defining where to insert the label. |
| label | The label value to insert. |
|
static |
Interpolate a prediction using a checkerboard pattern.
| [in] | checkerboard_prediction | The prediction computed on the checkerboard pattern. |
| [in,out] | checkerboard_mask | The checkerboard mask. |
| [out] | outimage | The interpolated full prediction. |
|
inlinestatic |
Definition at line 355 of file mitkCLUtil.h.
|
inlinestatic |
Definition at line 368 of file mitkCLUtil.h.
|
inlinestatic |
Definition at line 379 of file mitkCLUtil.h.
|
inlinestatic |
Definition at line 410 of file mitkCLUtil.h.
References mitk::CastToMitkImage().
|
inlinestatic |
Definition at line 391 of file mitkCLUtil.h.
|
static |
Compute the Laplacian of Gaussian (LoG) of an image.
| [in] | image | The input image. |
| [out] | smoothed | The LoG output image. |
| [in] | sigma1 | Standard deviation of the Gaussian. |
|
static |
Compute local histograms for each voxel in an image.
| [in] | image | The input image. |
| [out] | out | Vector of output images, one per histogram bin. |
| [in] | Bins | Number of histogram bins. |
| [in] | NeighbourhoodSize | Size of the local neighbourhood. |
|
static |
Compute the logical AND of two binary images.
| [in] | image1 | First binary image. |
| [in] | image2 | Second binary image. |
| [out] | outimage | The resulting AND image. |
|
static |
Merge labels in a label image according to a mapping.
| img | The label image to modify in place. |
| map | Map of source label to target label. Each occurrence of a source label is replaced by its target. |
|
static |
Create a probability map based on Gaussian distribution parameters.
| sourceImage | The input intensity image. |
| mean | The mean of the Gaussian distribution. |
| std_dev | The standard deviation of the Gaussian distribution. |
| resultImage | The output probability map image. |
|
static |
Sum squared intensity values from a source image for voxels matching a given label.
| [in] | image | The label image. |
| [in] | source | The intensity source image. |
| [in] | label | The label value to select voxels. |
| [out] | val | The sum of squared intensities for the selected voxels. |
|
static |
Sum intensity values from a source image for voxels matching a given label.
| [in] | image | The label image. |
| [in] | source | The intensity source image. |
| [in] | label | The label value to select voxels. |
| [out] | val | The sum of intensities for the selected voxels. |
|
inlinestatic |
Transform an Eigen matrix back to an MITK image using a mask.
Non-zero voxels in the mask are filled with values from the matrix in order.
| TMatrixElementType | Element type of the Eigen matrix. |
| [in] | matrix | The Eigen matrix of shape [n_masked_voxels, 1]. |
| [in] | mask | The mask image defining which voxels to populate. |
Definition at line 186 of file mitkCLUtil.h.
References mitk::CastToItkImage(), CountVoxel(), mitk::GrabItkImageMemory(), MITK_ERROR, and mitk::Image::New().
|
inlinestatic |
Transform an MITK image into an Eigen column matrix using a mask.
Extracts intensity values from masked (non-zero) voxels and stores them in a single-column Eigen matrix.
| TMatrixElementType | Element type of the Eigen matrix. |
| img | The input intensity image. |
| mask | The mask image defining which voxels to extract. |
Definition at line 235 of file mitkCLUtil.h.
References mitk::CastToItkImage(), and CountVoxel().