Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
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 
142  LabelMapType m_AvailableLabels;
143 
144  IndexToLabelMapType m_IndexToLabels;
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 //_mitkLabelSetImageToSurfaceFilter_H_
Superclass of all classes generating surfaces (instances of class Surface) as output.
Class for storing surfaces (vtkPolyData).
Definition: mitkSurface.h:28
std::map< unsigned int, LabelType > IndexToLabelMapType
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
std::map< LabelType, unsigned long > LabelMapType
#define MITKMULTILABEL_EXPORT
void mitkVtkLinearTransformPoint(T1 matrix[4][4], T2 in[3], T3 out[3])
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Image class for storing images.
Definition: mitkImage.h:72
mitk::Label::PixelType PixelType
mitk::Image::Pointer image
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)
Definition: jsoncpp.cpp:244