Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _mitkLabelSetImageToSurfaceFilter_H_
18 #define _mitkLabelSetImageToSurfaceFilter_H_
19 
20 #include "MitkMultilabelExports.h"
21 #include "mitkLabelSetImage.h"
22 #include "mitkSurface.h"
23 #include <mitkSurfaceSource.h>
24 
25 #include <vtkMatrix4x4.h>
26 
27 #include <itkImage.h>
28 
29 #include <map>
30 
31 namespace mitk
32 {
39  {
40  public:
42 
43  itkNewMacro(Self);
44 
46 
47  typedef std::map<LabelType, unsigned long> LabelMapType;
48 
49  typedef std::map<unsigned int, LabelType> IndexToLabelMapType;
50 
54  const mitk::Image *GetInput(void);
55 
59  using ProcessObject::SetInput;
60  virtual void SetInput(const mitk::Image *image);
61 
62  // virtual void SetObserver(mitk::ProcessObserver::Pointer observer);
63 
67  itkSetMacro(GenerateAllLabels, bool);
68 
73  itkGetMacro(GenerateAllLabels, bool);
74  itkBooleanMacro(GenerateAllLabels);
75 
81  itkSetMacro(RequestedLabel, int);
82 
88  itkGetMacro(RequestedLabel, int);
89 
94  itkSetMacro(BackgroundLabel, int);
95 
100  itkGetMacro(BackgroundLabel, int);
101 
105  itkSetMacro(UseSmoothing, int);
106 
110  itkSetMacro(Sigma, float);
111 
112  protected:
114 
115  virtual ~LabelSetImageToSurfaceFilter();
116 
120  template <class T1, class T2, class T3>
121  inline void mitkVtkLinearTransformPoint(T1 matrix[4][4], T2 in[3], T3 out[3])
122  {
123  T3 x = matrix[0][0] * in[0] + matrix[0][1] * in[1] + matrix[0][2] * in[2] + matrix[0][3];
124  T3 y = matrix[1][0] * in[0] + matrix[1][1] * in[1] + matrix[1][2] * in[2] + matrix[1][3];
125  T3 z = matrix[2][0] * in[0] + matrix[2][1] * in[1] + matrix[2][2] * in[2] + matrix[2][3];
126  out[0] = x;
127  out[1] = y;
128  out[2] = z;
129  }
130 
132 
133  template <typename TPixel, unsigned int VImageDimension>
134  void InternalProcessing(const itk::Image<TPixel, VImageDimension> *input, mitk::Surface *surface);
135 
137 
139 
141 
143 
144  float m_Sigma;
145 
146  LabelMapType m_AvailableLabels;
147 
148  IndexToLabelMapType m_IndexToLabels;
149 
151 
152  virtual void GenerateData() override;
153 
154  virtual void GenerateOutputInformation() override;
155 
156  // mitk::ProcessObserver::Pointer m_Observer;
157  };
158 
159 } // end of namespace mitk
160 
161 #endif //_mitkLabelSetImageToSurfaceFilter_H_
Superclass of all classes generating surfaces (instances of class Surface) as output.
Class for storing surfaces (vtkPolyData).
Definition: mitkSurface.h:32
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:44
Image class for storing images.
Definition: mitkImage.h:76
mitk::Label::PixelType PixelType
static bool in(Reader::Char c, Reader::Char c1, Reader::Char c2, Reader::Char c3, Reader::Char c4)
Definition: jsoncpp.cpp:244