Medical Imaging Interaction Toolkit  2018.4.99-936b789b
Medical Imaging Interaction Toolkit
mitkImageLiveWireContourModelFilter.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 _mitkImageLiveWireContourModelFilter_h__
14 #define _mitkImageLiveWireContourModelFilter_h__
15 
16 #include "mitkCommon.h"
17 #include "mitkContourModel.h"
18 #include "mitkContourModelSource.h"
20 
21 #include <mitkImage.h>
22 #include <mitkImageAccessByItk.h>
23 #include <mitkImageCast.h>
24 
27 
28 namespace mitk
29 {
50  {
51  public:
53  itkFactorylessNewMacro(Self);
54  itkCloneMacro(Self);
55 
56  typedef ContourModel OutputType;
59 
60  typedef itk::Image<float, 2> InternalImageType;
63  typedef std::vector<itk::Index<2>> ShortestPathType;
64 
66  itkSetMacro(StartPoint, mitk::Point3D);
67  itkGetMacro(StartPoint, mitk::Point3D);
68 
70  itkSetMacro(EndPoint, mitk::Point3D);
71  itkGetMacro(EndPoint, mitk::Point3D);
72 
77  itkSetMacro(UseDynamicCostMap, bool);
78  itkGetMacro(UseDynamicCostMap, bool);
79 
82  itkSetMacro(TimeStep, unsigned int);
83  itkGetMacro(TimeStep, unsigned int);
84 
87  void ClearRepulsivePoints();
88 
91  void SetRepulsivePoints(const ShortestPathType &points);
92 
95  void AddRepulsivePoint(const itk::Index<2> &idx);
96 
99  void RemoveRepulsivePoint(const itk::Index<2> &idx);
100 
101  virtual void SetInput(const InputType *input);
102 
103  using Superclass::SetInput;
104  virtual void SetInput(unsigned int idx, const InputType *input);
105 
106  const InputType *GetInput(void);
107 
108  const InputType *GetInput(unsigned int idx);
109 
110  virtual OutputType *GetOutput();
111 
112  virtual void DumpMaskImage();
113 
115  bool CreateDynamicCostMap(mitk::ContourModel *path = nullptr);
116 
117  protected:
119 
121 
122  void GenerateOutputInformation() override{};
123 
124  void GenerateData() override;
125 
126  void UpdateLiveWire();
127 
130 
133 
136 
139 
142 
145 
148 
149  unsigned int m_TimeStep;
150 
151  template <typename TPixel, unsigned int VImageDimension>
152  void ItkPreProcessImage(const itk::Image<TPixel, VImageDimension> *inputImage);
153 
154  template <typename TPixel, unsigned int VImageDimension>
155  void CreateDynamicCostMapByITK(const itk::Image<TPixel, VImageDimension> *inputImage,
156  mitk::ContourModel *path = nullptr);
157 
158  InternalImageType::Pointer m_InternalImage;
159  };
160 }
161 
162 #endif
mitk::Point3D m_EndPoint
end point in woorldcoordinates
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
CostFunctionType::Pointer m_CostFunction
The cost function to compute costs between two pixels.
Superclass of all classes generating some kind of mitk::BaseData.
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
Superclass of all classes generating ContourModels.
ShortestPathImageFilterType::Pointer m_ShortestPathFilter
Shortest path filter according to cost function m_CostFunction.
mitk::Point3D m_StartPoint
start point in worldcoordinates
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Image class for storing images.
Definition: mitkImage.h:72
itk::ShortestPathImageFilter< InternalImageType, InternalImageType > ShortestPathImageFilterType
Calculates a LiveWire contour between two points in an image.
bool m_UseDynamicCostMap
Flag to use a dynmic cost map or not.
Cost function for LiveWire purposes. Specific features are considered to calculate cummulative costs ...
itk::ShortestPathCostFunctionLiveWire< InternalImageType > CostFunctionType
mitk::Point3D m_StartPointInIndex
Start point in index.