Medical Imaging Interaction Toolkit  2023.04.00
Medical Imaging Interaction Toolkit
mitkMorphologicalOperations.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkMorphologicalOperations_h
14 #define mitkMorphologicalOperations_h
15 
17 #include <mitkImage.h>
18 
19 namespace mitk
20 {
24  {
25  public:
27  {
28  Ball = 7,
29  Ball_Axial = 1,
30  Ball_Sagittal = 2,
31  Ball_Coronal = 4,
32 
33  Cross = 56,
34  Cross_Axial = 8,
35  Cross_Sagittal = 16,
36  Cross_Coronal = 32
37 
38  };
39 
41 
43  static void Closing(mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement);
44  static void Erode(mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement);
45  static void Dilate(mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement);
46  static void Opening(mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement);
47  static void FillHoles(mitk::Image::Pointer &image);
49 
50  private:
52 
53  template <class TStructuringElement>
54  static TStructuringElement CreateStructuringElement(StructuralElementType structuralElementFlag, int factor);
55 
57 
59  template <typename TPixel, unsigned int VDimension>
60  static void itkClosing(itk::Image<TPixel, VDimension> *sourceImage,
61  mitk::Image::Pointer &resultImage,
62  int factor,
63  StructuralElementType structuralElement);
64 
65  template <typename TPixel, unsigned int VDimension>
66  static void itkErode(itk::Image<TPixel, VDimension> *sourceImage,
67  mitk::Image::Pointer &resultImage,
68  int factor,
69  StructuralElementType structuralElement);
70 
71  template <typename TPixel, unsigned int VDimension>
72  static void itkDilate(itk::Image<TPixel, VDimension> *sourceImage,
73  mitk::Image::Pointer &resultImage,
74  int factor,
75  StructuralElementType structuralElement);
76 
77  template <typename TPixel, unsigned int VDimension>
78  static void itkOpening(itk::Image<TPixel, VDimension> *sourceImage,
79  mitk::Image::Pointer &resultImage,
80  int factor,
81  StructuralElementType structuralElement);
82 
83  template <typename TPixel, unsigned int VDimension>
84  static void itkFillHoles(itk::Image<TPixel, VDimension> *sourceImage, mitk::Image::Pointer &resultImage);
86  };
87 }
88 
89 #endif
mitk::MorphologicalOperations::StructuralElementType
StructuralElementType
Definition: mitkMorphologicalOperations.h:26
mitkImage.h
itk::SmartPointer
Definition: mitkIFileReader.h:30
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
MITKSEGMENTATION_EXPORT
#define MITKSEGMENTATION_EXPORT
Definition: MitkSegmentationExports.h:15
MitkSegmentationExports.h
mitk::MorphologicalOperations
Encapsulates several morphological operations that can be performed on segmentations.
Definition: mitkMorphologicalOperations.h:23