Medical Imaging Interaction Toolkit  2024.06.00
Medical Imaging Interaction Toolkit
mitkExtractDirectedPlaneImageFilter.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 mitkExtractDirectedPlaneImageFilter_h
14 #define mitkExtractDirectedPlaneImageFilter_h
15 
16 #include "mitkImageToImageFilter.h"
18 
20 #include "vtkImageReslice.h"
21 
22 #define setMacro(name, type) \
23  virtual void Set##name(type _arg) \
24  { \
25  if (this->m_##name != _arg) \
26  { \
27  this->m_##name = _arg; \
28  } \
29  }
30 
31 #define getMacro(name, type) \
32  virtual type Get##name() { return m_##name; }
33 class vtkPoints;
34 
35 namespace mitk
36 {
61  {
62  public:
64  itkFactorylessNewMacro(Self);
65  itkCloneMacro(Self);
66  itkSetMacro(WorldGeometry, PlaneGeometry *);
67 
68  // The Reslicer is accessible to configure the desired interpolation;
69  // (See vtk::ImageReslice class for documentation).
70  // Misusage is at your own risk...
71  itkGetMacro(Reslicer, vtkImageReslice *);
72 
73  // The target timestep in a 4D image from which the 2D plane is supposed
74  // to be extracted.
75  itkSetMacro(TargetTimestep, unsigned int);
76  itkGetMacro(TargetTimestep, unsigned int);
77 
78  itkSetMacro(InPlaneResampleExtentByGeometry, bool);
79  itkGetMacro(InPlaneResampleExtentByGeometry, bool);
80 
81  setMacro(ResliceInterpolationProperty, VtkResliceInterpolationProperty *);
82  itkGetMacro(ResliceInterpolationProperty, VtkResliceInterpolationProperty *);
83 
84  setMacro(IsMapperMode, bool);
85  getMacro(IsMapperMode, bool);
86 
87  protected:
88  ExtractDirectedPlaneImageFilter(); // purposely hidden
90 
91  void GenerateData() override;
92  void GenerateOutputInformation() override;
93 
94  bool CalculateClippedPlaneBounds(const BaseGeometry *boundingGeometry,
95  const PlaneGeometry *planeGeometry,
96  double *bounds);
97  bool LineIntersectZero(vtkPoints *points, int p1, int p2, double *bounds);
98 
100  vtkImageReslice *m_Reslicer;
101 
102  unsigned int m_TargetTimestep;
107 
109  };
110 
111 } // namespace mitk
112 
113 #endif
mitkImageToImageFilter.h
mitk::PlaneGeometry
Describes a two-dimensional, rectangular plane.
Definition: mitkPlaneGeometry.h:78
mitk::ExtractDirectedPlaneImageFilter::m_ResliceInterpolationProperty
VtkResliceInterpolationProperty * m_ResliceInterpolationProperty
Definition: mitkExtractDirectedPlaneImageFilter.h:108
mitk::ExtractDirectedPlaneImageFilter::m_IsMapperMode
bool m_IsMapperMode
Definition: mitkExtractDirectedPlaneImageFilter.h:106
mitk::ExtractDirectedPlaneImageFilter::m_Reslicer
vtkImageReslice * m_Reslicer
Definition: mitkExtractDirectedPlaneImageFilter.h:100
mitk
Find image slices visible on a given plane.
Definition: RenderingTests.dox:1
getMacro
#define getMacro(name, type)
Definition: mitkExtractDirectedPlaneImageFilter.h:31
mitk::BaseDataSource
Superclass of all classes generating some kind of mitk::BaseData.
Definition: mitkBaseDataSource.h:71
mitk::ExtractDirectedPlaneImageFilter::m_ThickSlicesMode
int m_ThickSlicesMode
Definition: mitkExtractDirectedPlaneImageFilter.h:104
mitk::PlaneClipping::CalculateClippedPlaneBounds
static bool CalculateClippedPlaneBounds(const BaseGeometry *boundingGeometry, const PlaneGeometry *planeGeometry, double *bounds)
Calculate the bounding box of the resliced image. This is necessary for arbitrarily rotated planes in...
Definition: mitkPlaneClipping.h:65
mitk::ExtractDirectedPlaneImageFilter
Extracts a 2D slice of arbitrary geometry from a 3D or 4D image.
Definition: mitkExtractDirectedPlaneImageFilter.h:60
mitk::PlaneClipping::LineIntersectZero
static bool LineIntersectZero(vtkPoints *points, int p1, int p2, double *bounds)
Internal helper method for intersection testing used only in CalculateClippedPlaneBounds()
Definition: mitkPlaneClipping.h:27
mitk::BaseGeometry
BaseGeometry Describes the geometry of a data object.
Definition: mitkBaseGeometry.h:94
setMacro
#define setMacro(name, type)
Definition: mitkExtractDirectedPlaneImageFilter.h:22
mitkVtkResliceInterpolationProperty.h
MITKIMAGEEXTRACTION_EXPORT
#define MITKIMAGEEXTRACTION_EXPORT
Definition: MitkImageExtractionExports.h:15
mitk::ExtractDirectedPlaneImageFilter::m_WorldGeometry
const PlaneGeometry * m_WorldGeometry
Definition: mitkExtractDirectedPlaneImageFilter.h:99
mitk::VtkResliceInterpolationProperty
Definition: mitkVtkResliceInterpolationProperty.h:33
mitk::ExtractDirectedPlaneImageFilter::m_InPlaneResampleExtentByGeometry
bool m_InPlaneResampleExtentByGeometry
Definition: mitkExtractDirectedPlaneImageFilter.h:103
mitkClassMacro
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:36
MitkImageExtractionExports.h
mitk::ImageToImageFilter
Superclass of all classes having one or more Images as input and generating Images as output.
Definition: mitkImageToImageFilter.h:25
mitk::ExtractDirectedPlaneImageFilter::m_TargetTimestep
unsigned int m_TargetTimestep
Definition: mitkExtractDirectedPlaneImageFilter.h:102
mitk::ExtractDirectedPlaneImageFilter::m_ThickSlicesNum
int m_ThickSlicesNum
Definition: mitkExtractDirectedPlaneImageFilter.h:105