Medical Imaging Interaction Toolkit  2024.06.99-60d9b802
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 {
35  {
36  public:
38 
39  itkNewMacro(Self);
40 
42 
43  typedef std::map<LabelType, unsigned long> LabelMapType;
44 
45  typedef std::map<unsigned int, LabelType> IndexToLabelMapType;
46 
50  const mitk::Image *GetInput(void);
51 
55  using ProcessObject::SetInput;
56  virtual void SetInput(const mitk::Image *image);
57 
58  // virtual void SetObserver(mitk::ProcessObserver::Pointer observer);
59 
63  itkSetMacro(GenerateAllLabels, bool);
64 
69  itkGetMacro(GenerateAllLabels, bool);
70  itkBooleanMacro(GenerateAllLabels);
71 
77  itkSetMacro(RequestedLabel, int);
78 
84  itkGetMacro(RequestedLabel, int);
85 
90  itkSetMacro(BackgroundLabel, int);
91 
96  itkGetMacro(BackgroundLabel, int);
97 
101  itkSetMacro(UseSmoothing, int);
102 
106  itkSetMacro(Sigma, float);
107 
108  protected:
110 
111  ~LabelSetImageToSurfaceFilter() override;
112 
116  template <class T1, class T2, class T3>
117  inline void mitkVtkLinearTransformPoint(T1 matrix[4][4], T2 in[3], T3 out[3])
118  {
119  T3 x = matrix[0][0] * in[0] + matrix[0][1] * in[1] + matrix[0][2] * in[2] + matrix[0][3];
120  T3 y = matrix[1][0] * in[0] + matrix[1][1] * in[1] + matrix[1][2] * in[2] + matrix[1][3];
121  T3 z = matrix[2][0] * in[0] + matrix[2][1] * in[1] + matrix[2][2] * in[2] + matrix[2][3];
122  out[0] = x;
123  out[1] = y;
124  out[2] = z;
125  }
126 
128 
129  template <typename TPixel, unsigned int VImageDimension>
130  void InternalProcessing(const itk::Image<TPixel, VImageDimension> *input, mitk::Surface *surface);
131 
133 
135 
137 
139 
140  float m_Sigma;
141 
143 
145 
147 
148  void GenerateData() override;
149 
150  void GenerateOutputInformation() override;
151 
152  // mitk::ProcessObserver::Pointer m_Observer;
153  };
154 
155 } // end of namespace mitk
156 
157 #endif
MITKMULTILABEL_EXPORT
#define MITKMULTILABEL_EXPORT
Definition: MitkMultilabelExports.h:15
mitk::LabelSetImageToSurfaceFilter::m_Sigma
float m_Sigma
Definition: mitkLabelSetImageToSurfaceFilter.h:140
mitk::LabelSetImageToSurfaceFilter
Definition: mitkLabelSetImageToSurfaceFilter.h:34
mitkSurfaceSource.h
mitk::LabelSetImageToSurfaceFilter::m_UseSmoothing
int m_UseSmoothing
Definition: mitkLabelSetImageToSurfaceFilter.h:138
mitk::LabelSetImageToSurfaceFilter::LabelMapType
std::map< LabelType, unsigned long > LabelMapType
Definition: mitkLabelSetImageToSurfaceFilter.h:43
mitk::LabelSetImageToSurfaceFilter::m_AvailableLabels
LabelMapType m_AvailableLabels
Definition: mitkLabelSetImageToSurfaceFilter.h:142
mitk::Image
Image class for storing images.
Definition: mitkImage.h:69
itk::SmartPointer< Self >
mitk::Surface
Class for storing surfaces (vtkPolyData).
Definition: mitkSurface.h:28
mitk::LabelSetImageToSurfaceFilter::m_BackgroundLabel
int m_BackgroundLabel
Definition: mitkLabelSetImageToSurfaceFilter.h:136
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
mitkSurface.h
mitk::LabelSetImageToSurfaceFilter::m_InputImageSpacing
mitk::Vector3D m_InputImageSpacing
Definition: mitkLabelSetImageToSurfaceFilter.h:146
mitk::BaseDataSource
Superclass of all classes generating some kind of mitk::BaseData.
Definition: mitkBaseDataSource.h:71
mitk::LabelSetImageToSurfaceFilter::m_IndexToLabels
IndexToLabelMapType m_IndexToLabels
Definition: mitkLabelSetImageToSurfaceFilter.h:144
mitk::LabelSetImageToSurfaceFilter::IndexToLabelMapType
std::map< unsigned int, LabelType > IndexToLabelMapType
Definition: mitkLabelSetImageToSurfaceFilter.h:45
mitk::Vector< ScalarType, 3 >
mitk::LabelSetImageToSurfaceFilter::m_RequestedLabel
int m_RequestedLabel
Definition: mitkLabelSetImageToSurfaceFilter.h:134
mitk::LabelSetImageToSurfaceFilter::LabelType
LabelSetImage::PixelType LabelType
Definition: mitkLabelSetImageToSurfaceFilter.h:39
mitk::LabelSetImageToSurfaceFilter::m_GenerateAllLabels
bool m_GenerateAllLabels
Definition: mitkLabelSetImageToSurfaceFilter.h:132
mitk::LabelSetImageToSurfaceFilter::mitkVtkLinearTransformPoint
void mitkVtkLinearTransformPoint(T1 matrix[4][4], T2 in[3], T3 out[3])
Definition: mitkLabelSetImageToSurfaceFilter.h:117
mitk::SurfaceSource
Superclass of all classes generating surfaces (instances of class Surface) as output.
Definition: mitkSurfaceSource.h:33
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
mitk::LabelSetImageToSurfaceFilter::m_ResultImage
mitk::Image::Pointer m_ResultImage
Definition: mitkLabelSetImageToSurfaceFilter.h:127
mitk::LabelSetImage::PixelType
mitk::Label::PixelType PixelType
Definition: mitkLabelSetImage.h:70
MitkMultilabelExports.h
mitkLabelSetImage.h