Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkExtractDirectedPlaneImageFilter_h_Included
18 #define mitkExtractDirectedPlaneImageFilter_h_Included
19 
20 #include "mitkImageToImageFilter.h"
22 
24 #include "vtkImageReslice.h"
25 
26 #define setMacro(name, type) \
27  virtual void Set##name(type _arg) \
28  { \
29  if (this->m_##name != _arg) \
30  { \
31  this->m_##name = _arg; \
32  } \
33  }
34 
35 #define getMacro(name, type) \
36  virtual type Get##name() { return m_##name; }
37 class vtkPoints;
38 
39 namespace mitk
40 {
65  {
66  public:
68  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
69 
70  itkSetMacro(WorldGeometry, PlaneGeometry *);
71 
72  // The Reslicer is accessible to configure the desired interpolation;
73  // (See vtk::ImageReslice class for documentation).
74  // Misusage is at your own risk...
75  itkGetMacro(Reslicer, vtkImageReslice *);
76 
77  // The target timestep in a 4D image from which the 2D plane is supposed
78  // to be extracted.
79  itkSetMacro(TargetTimestep, unsigned int);
80  itkGetMacro(TargetTimestep, unsigned int);
81 
82  itkSetMacro(InPlaneResampleExtentByGeometry, bool);
83  itkGetMacro(InPlaneResampleExtentByGeometry, bool);
84 
85  setMacro(ResliceInterpolationProperty, VtkResliceInterpolationProperty *);
86  itkGetMacro(ResliceInterpolationProperty, VtkResliceInterpolationProperty *);
87 
88  setMacro(IsMapperMode, bool);
89  getMacro(IsMapperMode, bool);
90 
91  protected:
92  ExtractDirectedPlaneImageFilter(); // purposely hidden
94 
95  virtual void GenerateData() override;
96  virtual void GenerateOutputInformation() override;
97 
98  bool CalculateClippedPlaneBounds(const BaseGeometry *boundingGeometry,
99  const PlaneGeometry *planeGeometry,
100  double *bounds);
101  bool LineIntersectZero(vtkPoints *points, int p1, int p2, double *bounds);
102 
104  vtkImageReslice *m_Reslicer;
105 
106  unsigned int m_TargetTimestep;
111 
113  };
114 
115 } // namespace mitk
116 
117 #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:44
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.