Medical Imaging Interaction Toolkit  2021.02.99-b9f34b51
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_Included
14 #define mitkExtractDirectedPlaneImageFilter_h_Included
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 // mitkExtractDirectedPlaneImageFilter_h_Included
#define getMacro(name, type)
#define setMacro(name, type)
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...
Superclass of all classes generating some kind of mitk::BaseData.
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKIMAGEEXTRACTION_EXPORT
VtkResliceInterpolationProperty * m_ResliceInterpolationProperty
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
Superclass of all classes having one or more Images as input and generating Images as output...
static bool LineIntersectZero(vtkPoints *points, int p1, int p2, double *bounds)
Internal helper method for intersection testing used only in CalculateClippedPlaneBounds() ...
Describes a two-dimensional, rectangular plane.
Extracts a 2D slice of arbitrary geometry from a 3D or 4D image.
BaseGeometry Describes the geometry of a data object.