Medical Imaging Interaction Toolkit  2016.11.0
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,
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 _mitkImageLiveWireContourModelFilter_h__
18 #define _mitkImageLiveWireContourModelFilter_h__
19 
20 #include "mitkCommon.h"
21 #include "mitkContourModel.h"
22 #include "mitkContourModelSource.h"
24 
25 #include <mitkImage.h>
26 #include <mitkImageAccessByItk.h>
27 #include <mitkImageCast.h>
28 
31 
32 namespace mitk
33 {
54  {
55  public:
57  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
58 
60  typedef OutputType::Pointer OutputTypePointer;
61  typedef mitk::Image InputType;
62 
63  typedef itk::Image<float, 2> InternalImageType;
64  typedef itk::ShortestPathImageFilter<InternalImageType, InternalImageType> ShortestPathImageFilterType;
65  typedef itk::ShortestPathCostFunctionLiveWire<InternalImageType> CostFunctionType;
66  typedef std::vector<itk::Index<2>> ShortestPathType;
67 
69  itkSetMacro(StartPoint, mitk::Point3D);
70  itkGetMacro(StartPoint, mitk::Point3D);
71 
73  itkSetMacro(EndPoint, mitk::Point3D);
74  itkGetMacro(EndPoint, mitk::Point3D);
75 
80  itkSetMacro(UseDynamicCostMap, bool);
81  itkGetMacro(UseDynamicCostMap, bool);
82 
85  itkSetMacro(TimeStep, unsigned int);
86  itkGetMacro(TimeStep, unsigned int);
87 
90  void ClearRepulsivePoints();
91 
94  void SetRepulsivePoints(const ShortestPathType &points);
95 
98  void AddRepulsivePoint(const itk::Index<2> &idx);
99 
102  void RemoveRepulsivePoint(const itk::Index<2> &idx);
103 
104  virtual void SetInput(const InputType *input);
105 
106  using Superclass::SetInput;
107  virtual void SetInput(unsigned int idx, const InputType *input);
108 
109  const InputType *GetInput(void);
110 
111  const InputType *GetInput(unsigned int idx);
112 
113  virtual OutputType *GetOutput();
114 
115  virtual void DumpMaskImage();
116 
118  bool CreateDynamicCostMap(mitk::ContourModel *path = NULL);
119 
120  protected:
122 
123  virtual ~ImageLiveWireContourModelFilter();
124 
125  void GenerateOutputInformation() override{};
126 
127  void GenerateData() override;
128 
129  void UpdateLiveWire();
130 
133 
136 
139 
142 
145 
148 
151 
152  unsigned int m_TimeStep;
153 
154  template <typename TPixel, unsigned int VImageDimension>
155  void ItkPreProcessImage(const itk::Image<TPixel, VImageDimension> *inputImage);
156 
157  template <typename TPixel, unsigned int VImageDimension>
158  void CreateDynamicCostMapByITK(const itk::Image<TPixel, VImageDimension> *inputImage,
159  mitk::ContourModel *path = NULL);
160 
162  };
163 }
164 
165 #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...
itk::SmartPointer< Self > Pointer
CostFunctionType::Pointer m_CostFunction
The cost function to compute costs between two pixels.
Superclass of all classes generating some kind of mitk::BaseData.
STL namespace.
#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:44
Image class for storing images.
Definition: mitkImage.h:76
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 ...
mitk::Point3D m_StartPointInIndex
Start point in index.
itk::ProcessObject Superclass