Medical Imaging Interaction Toolkit  2026.06.00
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 {
49  {
50  public:
52  itkFactorylessNewMacro(Self);
53  itkCloneMacro(Self);
54 
61  mitk::Surface::Pointer GetNormalsAsSurface();
62 
64  void Reset();
65 
72  void SetMaxSpacing(double maxSpacing);
73 
77  void SetUseProgressBar(bool status);
78 
82  void SetProgressStepSize(unsigned int stepSize);
83 
91  void SetSegmentationBinaryImage(mitk::Image *segmentationImage) { m_SegmentationBinaryImage = segmentationImage; }
92  protected:
95  void GenerateData() override;
96  void GenerateOutputInformation() override;
97 
98  private:
99  // The segmentation out of which the contours were extracted. Can be used to determine the direction of the normals
100  mitk::Image::Pointer m_SegmentationBinaryImage;
101  double m_MaxSpacing;
102 
103  unsigned int m_NegativeNormalCounter;
104  unsigned int m_PositiveNormalCounter;
105 
106  bool m_UseProgressBar;
107  unsigned int m_ProgressStepSize;
108 
109  }; // class
110 
111 } // namespace
112 #endif
#define MITKSURFACEINTERPOLATION_EXPORT
Filter that computes surface normals for contour edge points.
mitkClassMacro(ComputeContourSetNormalsFilter, SurfaceToSurfaceFilter)
void SetUseProgressBar(bool status)
Enable or disable the MITK progress bar during computation.
void SetMaxSpacing(double maxSpacing)
Set the maximum voxel spacing of the original image.
void SetProgressStepSize(unsigned int stepSize)
Set the step size by which the progress bar advances per contour.
void Reset()
Reset the filter by removing all inputs and outputs.
void SetSegmentationBinaryImage(mitk::Image *segmentationImage)
Set the segmentation binary image for normal direction validation.
mitk::Surface::Pointer GetNormalsAsSurface()
Return the computed normals as a mitk::Surface.
Image class for storing multi-dimensional medical image data.
Definition: mitkImage.h:76
Superclass of all classes getting surfaces (instances of class Surface) as input and generating surfa...
Find image slices visible on a given plane.