Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
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 {
26  {
27  public:
29  {
30  Ball = 7,
31  Ball_Axial = 1,
32  Ball_Sagittal = 2,
33  Ball_Coronal = 4,
34 
35  Cross = 56,
36  Cross_Axial = 8,
37  Cross_Sagittal = 16,
38  Cross_Coronal = 32
39 
40  };
41 
43 
45  static void Closing(mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement);
46  static void Erode(mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement);
47  static void Dilate(mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement);
48  static void Opening(mitk::Image::Pointer &image, int factor, StructuralElementType structuralElement);
49  static void FillHoles(mitk::Image::Pointer &image);
51 
52  private:
54 
55  template <class TStructuringElement>
56  static TStructuringElement CreateStructuringElement(StructuralElementType structuralElementFlag, int factor);
57 
59 
61  template <typename TPixel, unsigned int VDimension>
62  static void itkClosing(itk::Image<TPixel, VDimension> *sourceImage,
63  mitk::Image::Pointer &resultImage,
64  int factor,
65  StructuralElementType structuralElement);
66 
67  template <typename TPixel, unsigned int VDimension>
68  static void itkErode(itk::Image<TPixel, VDimension> *sourceImage,
69  mitk::Image::Pointer &resultImage,
70  int factor,
71  StructuralElementType structuralElement);
72 
73  template <typename TPixel, unsigned int VDimension>
74  static void itkDilate(itk::Image<TPixel, VDimension> *sourceImage,
75  mitk::Image::Pointer &resultImage,
76  int factor,
77  StructuralElementType structuralElement);
78 
79  template <typename TPixel, unsigned int VDimension>
80  static void itkOpening(itk::Image<TPixel, VDimension> *sourceImage,
81  mitk::Image::Pointer &resultImage,
82  int factor,
83  StructuralElementType structuralElement);
84 
85  template <typename TPixel, unsigned int VDimension>
86  static void itkFillHoles(itk::Image<TPixel, VDimension> *sourceImage, mitk::Image::Pointer &resultImage);
88  };
89 }
90 
91 #endif
mitk::MorphologicalOperations::StructuralElementType
StructuralElementType
Definition: mitkMorphologicalOperations.h:28
mitkImage.h
itk::SmartPointer
Definition: mitkIFileReader.h:30
mitk
Find image slices visible on a given plane.
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:25