Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkLabelSetImageToSurfaceFilter.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 mitkLabelSetImageToSurfaceFilter_h
14 #define mitkLabelSetImageToSurfaceFilter_h
15 
16 #include <MitkMultilabelExports.h>
17 #include <mitkLabelSetImage.h>
18 #include <mitkSurface.h>
19 #include <mitkSurfaceSource.h>
20 
21 #include <vtkMatrix4x4.h>
22 
23 #include <itkImage.h>
24 
25 #include <map>
26 
27 namespace mitk
28 {
41  {
42  public:
44 
45  itkNewMacro(Self);
46 
49 
51  typedef std::map<LabelType, unsigned long> LabelMapType;
52 
54  typedef std::map<unsigned int, LabelType> IndexToLabelMapType;
55 
60  const mitk::Image *GetInput(void);
61 
66  using ProcessObject::SetInput;
67  virtual void SetInput(const mitk::Image *image);
68 
69  // virtual void SetObserver(mitk::ProcessObserver::Pointer observer);
70 
74  itkSetMacro(GenerateAllLabels, bool);
75 
80  itkGetMacro(GenerateAllLabels, bool);
81  itkBooleanMacro(GenerateAllLabels);
82 
88  itkSetMacro(RequestedLabel, int);
89 
95  itkGetMacro(RequestedLabel, int);
96 
101  itkSetMacro(BackgroundLabel, int);
102 
107  itkGetMacro(BackgroundLabel, int);
108 
112  itkSetMacro(UseSmoothing, int);
113 
117  itkSetMacro(Sigma, float);
118 
119  protected:
121 
123 
127  template <class T1, class T2, class T3>
128  inline void mitkVtkLinearTransformPoint(T1 matrix[4][4], T2 in[3], T3 out[3])
129  {
130  T3 x = matrix[0][0] * in[0] + matrix[0][1] * in[1] + matrix[0][2] * in[2] + matrix[0][3];
131  T3 y = matrix[1][0] * in[0] + matrix[1][1] * in[1] + matrix[1][2] * in[2] + matrix[1][3];
132  T3 z = matrix[2][0] * in[0] + matrix[2][1] * in[1] + matrix[2][2] * in[2] + matrix[2][3];
133  out[0] = x;
134  out[1] = y;
135  out[2] = z;
136  }
137 
138  mitk::Image::Pointer m_ResultImage;
139 
140  template <typename TPixel, unsigned int VImageDimension>
141  void InternalProcessing(const itk::Image<TPixel, VImageDimension> *input, mitk::Surface *surface);
142 
144 
146 
148 
150 
151  float m_Sigma;
152 
154 
156 
158 
159  void GenerateData() override;
160 
161  void GenerateOutputInformation() override;
162 
163  // mitk::ProcessObserver::Pointer m_Observer;
164  };
165 
166 } // end of namespace mitk
167 
168 #endif
#define MITKMULTILABEL_EXPORT
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
Filter that generates surface meshes from a MultiLabelSegmentation image.
virtual void SetInput(const mitk::Image *image)
void InternalProcessing(const itk::Image< TPixel, VImageDimension > *input, mitk::Surface *surface)
std::map< unsigned int, LabelType > IndexToLabelMapType
Map from output index to label value.
std::map< LabelType, unsigned long > LabelMapType
Map from label value to count/size.
const mitk::Image * GetInput(void)
Returns a const pointer to the input image.
mitkClassMacro(LabelSetImageToSurfaceFilter, SurfaceSource)
void mitkVtkLinearTransformPoint(T1 matrix[4][4], T2 in[3], T3 out[3])
void GenerateOutputInformation() override
MultiLabelSegmentation::LabelValueType LabelType
Type for label pixel values.
mitk::Label::PixelType LabelValueType
Superclass of all classes generating surfaces (instances of class Surface) as output.
Data class for storing polygonal surfaces (vtkPolyData).
Definition: mitkSurface.h:37
Find image slices visible on a given plane.