Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit
mitkGeometryClipImageFilter.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 mitkGeometryClipImageFilter_h
14 #define mitkGeometryClipImageFilter_h
15 
17 #include <mitkCommon.h>
18 #include <mitkGeometryData.h>
19 #include <mitkImageTimeSelector.h>
20 #include <mitkImageToImageFilter.h>
21 
22 namespace itk
23 {
24  template <class TPixel, unsigned int VImageDimension>
25  class ITK_EXPORT Image;
26 }
27 
28 namespace mitk
29 {
49  {
50  public:
52 
53  itkFactorylessNewMacro(Self);
54 
55  itkCloneMacro(Self);
56 
61  void SetClippingGeometry(const mitk::BaseGeometry *aClippingGeometry);
62 
70  void SetClippingGeometry(const mitk::TimeGeometry *aClippingGeometry);
71 
77 
83 
88  itkGetConstMacro(ClipPartAboveGeometry, bool);
89 
94  itkSetMacro(ClipPartAboveGeometry, bool);
95 
97  itkBooleanMacro(ClipPartAboveGeometry);
98 
106  itkSetMacro(OutsideValue, ScalarType);
107 
112  itkGetConstMacro(OutsideValue, ScalarType);
113 
118  itkSetMacro(AutoOutsideValue, bool);
119 
124  itkGetConstMacro(AutoOutsideValue, bool);
125 
127  itkBooleanMacro(AutoOutsideValue);
128 
133  itkSetMacro(AutoOrientLabels, bool);
134 
139  itkGetConstMacro(AutoOrientLabels, bool);
140 
149  itkSetMacro(LabelBothSides, bool);
150 
155  itkGetConstMacro(LabelBothSides, bool);
156 
158  itkBooleanMacro(LabelBothSides);
159 
167  itkSetMacro(AboveGeometryLabel, ScalarType);
168 
173  itkGetConstMacro(AboveGeometryLabel, ScalarType);
174 
182  itkSetMacro(BelowGeometryLabel, ScalarType);
183 
188  itkGetConstMacro(BelowGeometryLabel, ScalarType);
189 
190  protected:
192 
194 
196 
197  void GenerateOutputInformation() override;
198 
199  void GenerateData() override;
200 
201  template <typename TPixel, unsigned int VImageDimension>
202  void _InternalComputeClippedImage(itk::Image<TPixel, VImageDimension> *itkImage,
203  mitk::GeometryClipImageFilter *geometryClipper,
204  const mitk::PlaneGeometry *clippingPlaneGeometry);
205 
206  mitk::BaseGeometry::ConstPointer m_ClippingGeometry;
207  mitk::GeometryData::Pointer m_ClippingGeometryData;
208  mitk::TimeGeometry::ConstPointer m_TimeClippingGeometry;
209  mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
210  mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
211 
214 
219 
222 
227 
232 
235 
238 
241  };
242 
243 } // namespace mitk
244 
245 #endif
#define MITKALGORITHMSEXT_EXPORT
Abstract base class describing the geometry of a data object.
Filter for clipping an image with a PlaneGeometry.
ScalarType m_OutsideValue
Value for outside pixels (default: 0). Used only if m_AutoOutsideValue is false.
ScalarType m_BelowGeometryLabel
Label value for pixels below the geometry when m_LabelBothSides is on.
const mitk::TimeGeometry * GetClippingTimeGeometry() const
Get the clipping time geometry (if set).
bool m_LabelBothSides
If true, all pixels above and below the geometry are labeled with m_AboveGeometryLabel and m_BelowGeo...
ScalarType m_AboveGeometryLabel
Label value for pixels above the geometry when m_LabelBothSides is on.
void _InternalComputeClippedImage(itk::Image< TPixel, VImageDimension > *itkImage, mitk::GeometryClipImageFilter *geometryClipper, const mitk::PlaneGeometry *clippingPlaneGeometry)
mitkClassMacro(GeometryClipImageFilter, ImageToImageFilter)
mitk::TimeGeometry::ConstPointer m_TimeClippingGeometry
void SetClippingGeometry(const mitk::TimeGeometry *aClippingGeometry)
Set the clipping geometry as a TimeGeometry.
mitk::GeometryData::Pointer m_ClippingGeometryData
void GenerateOutputInformation() override
bool m_AutoOutsideValue
If true, the minimum of the output pixel type is used as outside value (default: false).
mitk::ImageTimeSelector::Pointer m_InputTimeSelector
void GenerateInputRequestedRegion() override
mitk::BaseGeometry::ConstPointer m_ClippingGeometry
itk::TimeStamp m_TimeOfHeaderInitialization
Time when header was last initialized.
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector
bool m_AutoOrientLabels
Orient above like vtkPolyDataNormals does with AutoOrientNormals.
bool m_ClipPartAboveGeometry
Defines whether the part above or below the geometry shall be clipped (default: true).
void SetClippingGeometry(const mitk::BaseGeometry *aClippingGeometry)
Set the clipping geometry (must be a PlaneGeometry).
const mitk::BaseGeometry * GetClippingGeometry() const
Get the clipping geometry for a single time step.
Superclass of all classes having one or more Images as input and generating Images as output.
Describes the geometry of a plane object.
class ITK_EXPORT Image
Find image slices visible on a given plane.
double ScalarType
Scalar type used throughout MITK for geometric computations.