Medical Imaging Interaction Toolkit  2021.02.99-121d8b57
Medical Imaging Interaction Toolkit
mitkSlicedGeometry3D.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 MITKSLICEDGEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD
14 #define MITKSLICEDGEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD
15 
16 #include "mitkBaseGeometry.h"
17 #include "mitkPlaneGeometry.h"
18 
19 namespace mitk
20 {
21  class SliceNavigationController;
22  class NavigationController;
23 
63  {
64  public:
66 
68  itkFactorylessNewMacro(Self);
69  itkCloneMacro(Self);
70 
92  virtual mitk::PlaneGeometry *GetPlaneGeometry(int s) const;
96  DEPRECATED(const PlaneGeometry *GetGeometry2D(int s)) { return GetPlaneGeometry(s); }
100  DEPRECATED(void SetGeometry2D(PlaneGeometry *geo, int s)) { SetPlaneGeometry(geo, s); }
101  //##Documentation
102  //## @brief When switching from an Image Geometry to a normal Geometry (and the other way around), you have to
103  //change
104  // the origin as well (See Geometry Documentation)! This function will change the "isImageGeometry" bool flag and
105  // changes the origin respectively.
106  void ChangeImageGeometryConsideringOriginOffset(const bool isAnImageGeometry) override;
107 
108  // virtual void SetTimeBounds( const mitk::TimeBounds& timebounds );
109  const mitk::BoundingBox *GetBoundingBox() const override;
110 
114  itkGetConstMacro(Slices, unsigned int);
115 
119  virtual bool SetPlaneGeometry(mitk::PlaneGeometry *geometry2D, int s);
120 
124  virtual bool IsValidSlice(int s = 0) const;
125 
126  virtual const BaseGeometry* GetReferenceGeometry() const;
127 
128  virtual void SetReferenceGeometry(const BaseGeometry *referenceGeometry);
129 
130  bool HasReferenceGeometry() const;
131 
139  virtual void SetSliceNavigationController(mitk::SliceNavigationController *snc);
140  mitk::SliceNavigationController *GetSliceNavigationController();
141 
154  itkGetConstMacro(EvenlySpaced, bool);
155 
156  virtual void SetEvenlySpaced(bool on = true);
157 
168  virtual void SetDirectionVector(const mitk::Vector3D &directionVector);
169  itkGetConstMacro(DirectionVector, const mitk::Vector3D &);
170 
171  itk::LightObject::Pointer InternalClone() const override;
172 
173 #ifndef SWIG
174 
175  static const std::string SLICES;
176  const static std::string DIRECTION_VECTOR;
177  const static std::string EVENLY_SPACED;
178 
179 #endif // !SWIG
180 
189  virtual void InitializeSlicedGeometry(unsigned int slices);
190 
199  virtual void InitializeEvenlySpaced(mitk::PlaneGeometry *geometry2D, unsigned int slices);
200 
210  virtual void InitializeEvenlySpaced(mitk::PlaneGeometry *geometry2D,
211  mitk::ScalarType zSpacing,
212  unsigned int slices);
213 
233  virtual void InitializePlanes(const mitk::BaseGeometry *geometry3D,
234  mitk::PlaneGeometry::PlaneOrientation planeorientation,
235  bool top = true,
236  bool frontside = true,
237  bool rotated = false);
238 
239  void SetImageGeometry(const bool isAnImageGeometry) override;
240 
241  void ExecuteOperation(Operation *operation) override;
242 
243  static double CalculateSpacing(const mitk::Vector3D &spacing, const mitk::Vector3D &d);
244 
245  protected:
247 
248  SlicedGeometry3D(const SlicedGeometry3D &other);
249 
250  ~SlicedGeometry3D() override;
251 
265  virtual void ReinitializePlanes(const Point3D &center, const Point3D &referencePoint);
266 
267  ScalarType GetLargestExtent(const BaseGeometry *geometry);
268 
269  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
270 
275  double CalculateSpacing(const mitk::Vector3D &direction) const;
276 
281  mitk::Vector3D AdjustNormal(const mitk::Vector3D &normal) const;
282 
286  mutable std::vector<PlaneGeometry::Pointer> m_PlaneGeometries;
287 
298 
306 
308  unsigned int m_Slices;
309 
312 
315  // mitk::NavigationController *m_NavigationController;
317 
318  //##Documentation
319  //## @brief PreSetSpacing
320  //##
321  //## These virtual function allows a different beahiour in subclasses.
322  //## Do implement them in every subclass of BaseGeometry. If not needed, use
323  //## {Superclass::PreSetSpacing();};
324  void PreSetSpacing(const mitk::Vector3D &aSpacing) override;
325  };
326 } // namespace mitk
327 
328 #endif /* MITKSLICEDGEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD */
itk::BoundingBox< unsigned long, 3, ScalarType > BoundingBox
Standard 3D-BoundingBox typedef.
mitk::SliceNavigationController * m_SliceNavigationController
#define MITKCORE_EXPORT
void SetGeometry2D(PlaneGeometry *geo, int s)
const PlaneGeometry * GetGeometry2D(int s)
Base class of all Operation-classes.
Definition: mitkOperation.h:29
double ScalarType
DataCollection - Class to facilitate loading/accessing structured data.
static const std::string EVENLY_SPACED
static const std::string SLICES
std::vector< PlaneGeometry::Pointer > m_PlaneGeometries
Controls the selection of the slice the associated BaseRenderer will display.
#define DEPRECATED(func)
Definition: mitkCommon.h:179
static const std::string DIRECTION_VECTOR
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:40
const mitk::BaseGeometry * m_ReferenceGeometry
Describes the geometry of a data object consisting of slices.
Describes a two-dimensional, rectangular plane.
BaseGeometry Describes the geometry of a data object.