Medical Imaging Interaction Toolkit  2025.12.02
Medical Imaging Interaction Toolkit
mitkComputeContourSetNormalsFilter.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 mitkComputeContourSetNormalsFilter_h
14 #define mitkComputeContourSetNormalsFilter_h
15 
16 #include "mitkProgressBar.h"
17 #include "mitkSurface.h"
20 
21 #include "vtkCellArray.h"
22 #include "vtkCellData.h"
23 #include "vtkDoubleArray.h"
24 #include "vtkLine.h"
25 #include "vtkMath.h"
26 #include "vtkPolyData.h"
27 #include "vtkSmartPointer.h"
28 
29 #include "mitkImage.h"
30 
31 namespace mitk
32 {
51  {
52  public:
54  itkFactorylessNewMacro(Self);
55  itkCloneMacro(Self);
56 
57  /*
58  \brief Returns the computed normals as a surface
59  */
60  mitk::Surface::Pointer GetNormalsAsSurface();
61 
62  // Resets the filter, i.e. removes all inputs and outputs
63  void Reset();
64 
65  void SetMaxSpacing(double);
66 
72  void SetUseProgressBar(bool);
73 
79  void SetProgressStepSize(unsigned int stepSize);
80 
81  void SetSegmentationBinaryImage(mitk::Image *segmentationImage) { m_SegmentationBinaryImage = segmentationImage; }
82  protected:
85  void GenerateData() override;
86  void GenerateOutputInformation() override;
87 
88  private:
89  // The segmentation out of which the contours were extracted. Can be used to determine the direction of the normals
90  mitk::Image::Pointer m_SegmentationBinaryImage;
91  double m_MaxSpacing;
92 
93  unsigned int m_NegativeNormalCounter;
94  unsigned int m_PositiveNormalCounter;
95 
96  bool m_UseProgressBar;
97  unsigned int m_ProgressStepSize;
98 
99  }; // class
100 
101 } // namespace
102 #endif
#define MITKSURFACEINTERPOLATION_EXPORT
Filter to compute the normals for contours based on vtkPolygons.
void SetUseProgressBar(bool)
Set whether the mitkProgressBar should be used.
mitkClassMacro(ComputeContourSetNormalsFilter, SurfaceToSurfaceFilter)
void SetProgressStepSize(unsigned int stepSize)
Set the stepsize which the progress bar should proceed.
void SetSegmentationBinaryImage(mitk::Image *segmentationImage)
mitk::Surface::Pointer GetNormalsAsSurface()
Image class for storing images.
Definition: mitkImage.h:70
Superclass of all classes getting surfaces (instances of class Surface) as input and generating surfa...
Find image slices visible on a given plane.