Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkImageToContourFilter.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 mitkImageToContourFilter_h
14 #define mitkImageToContourFilter_h
15 
16 //#include "MitkSBExports.h"
18 #include <itkImage.h>
19 #include <mitkImage.h>
21 #include <mitkSurface.h>
22 #include <vtkCellArray.h>
23 #include <vtkPolyData.h>
24 #include <vtkPolygon.h>
26 
27 #include <mitkProgressBar.h>
28 
29 namespace mitk
30 {
42  {
43  public:
45  itkFactorylessNewMacro(Self);
46  itkCloneMacro(Self);
47 
54  itkSetMacro(SliceGeometry, BaseGeometry *);
55 
56  // typedef unsigned int VDimension;
57  typedef itk::PolyLineParametricPath<2> PolyLineParametricPath2D;
58  typedef PolyLineParametricPath2D::VertexListType ContourPath;
59 
65  void SetUseProgressBar(bool);
66 
72  void SetProgressStepSize(unsigned int stepSize);
73 
77  itkSetMacro (ContourValue, ScalarType);
78 
79  protected:
82  void GenerateData() override;
83  void GenerateOutputInformation() override;
84 
85  private:
86  const BaseGeometry *m_SliceGeometry;
87  bool m_UseProgressBar;
88  unsigned int m_ProgressStepSize;
89  ScalarType m_ContourValue;
90 
91  template <typename TPixel, unsigned int VImageDimension>
92  void Itk2DContourExtraction(const itk::Image<TPixel, VImageDimension> *sliceImage);
93 
94  }; // class
95 
96 } // namespace
97 #endif
#define MITKSEGMENTATION_EXPORT
Abstract base class describing the geometry of a data object.
A filter that can extract contours out of a 2D binary image.
mitkClassMacro(ImageToContourFilter, ImageToSurfaceFilter)
void GenerateData() override
void SetProgressStepSize(unsigned int stepSize)
Set the stepsize which the progress bar should proceed.
void SetUseProgressBar(bool)
Set whether the mitkProgressBar should be used.
PolyLineParametricPath2D::VertexListType ContourPath
void GenerateOutputInformation() override
itk::PolyLineParametricPath< 2 > PolyLineParametricPath2D
Converts pixel data to surface data by using a threshold.
Find image slices visible on a given plane.
double ScalarType
Scalar type used throughout MITK for geometric computations.