Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkCorrectorAlgorithm.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 mitkCorrectorAlgorithmhIncluded
18 #define mitkCorrectorAlgorithmhIncluded
19 
20 #include "ipSegmentation.h"
21 #include "mitkContourModel.h"
22 #include "mitkImageToImageFilter.h"
24 #include <mitkLabel.h>
25 
26 #include <itkImage.h>
27 
28 #define multilabelSegmentationType unsigned short
29 namespace mitk
30 {
44  {
45  public:
47  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
48 
50 
54  void SetContour(ContourModel *contour) { this->m_Contour = contour; }
55  itkSetMacro(FillColor, int);
56  itkGetConstMacro(FillColor, int);
57 
58  itkSetMacro(EraseColor, int);
59  itkGetConstMacro(EraseColor, int);
63  // itkGetObjectMacro(DifferenceImage, Image);
64 
65  // used by TobiasHeimannCorrectionAlgorithm
66  typedef struct
67  {
68  int lineStart;
69  int lineEnd;
70  bool modified;
71 
72  std::vector<itk::Index<2>> points;
73  } TSegData;
74 
75  protected:
77  virtual ~CorrectorAlgorithm();
78 
79  // does the actual processing
80  virtual void GenerateData() override;
81 
82  bool ImprovedHeimannCorrectionAlgorithm(itk::Image<DefaultSegmentationDataType, 2>::Pointer pic);
83  bool ModifySegment(const TSegData &segment, itk::Image<DefaultSegmentationDataType, 2>::Pointer pic);
84 
88 
91 
92  private:
93  template <typename ScalarType>
94  itk::Index<2> ensureIndexInImage(ScalarType i0, ScalarType i1);
95 
96  void ColorSegment(const mitk::CorrectorAlgorithm::TSegData &segment,
100  itk::Index<2> GetFirstPoint(const mitk::CorrectorAlgorithm::TSegData &segment,
102  std::vector<itk::Index<2>> FindSeedPoints(
103  const mitk::CorrectorAlgorithm::TSegData &segment,
105  int FillRegion(const std::vector<itk::Index<2>> &seedPoints,
109  };
110 }
111 
112 #endif
ContourModel is a structure of linked vertices defining a contour in 3D space. The vertices are store...
itk::SmartPointer< Self > Pointer
mitk::Label::PixelType DefaultSegmentationDataType
double ScalarType
Superclass of all classes generating some kind of mitk::BaseData.
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
A data structure describing a label.
Definition: mitkLabel.h:35
ContourModel::Pointer m_Contour
Calculated difference image.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Superclass of all classes having one or more Images as input and generating Images as output...
std::vector< itk::Index< 2 > > points
Class for defining the data type of pixels.
Definition: mitkPixelType.h:55