Medical Imaging Interaction Toolkit  2018.4.99-3e3f1a6e
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 
232  virtual void InitializePlanes(const mitk::BaseGeometry *geometry3D,
233  mitk::PlaneGeometry::PlaneOrientation planeorientation,
234  bool top = true,
235  bool frontside = true,
236  bool rotated = false);
237 
238  void SetImageGeometry(const bool isAnImageGeometry) override;
239 
240  void ExecuteOperation(Operation *operation) override;
241 
242  static double CalculateSpacing(const mitk::Vector3D &spacing, const mitk::Vector3D &d);
243 
244  protected:
246 
247  SlicedGeometry3D(const SlicedGeometry3D &other);
248 
249  ~SlicedGeometry3D() override;
250 
264  virtual void ReinitializePlanes(const Point3D &center, const Point3D &referencePoint);
265 
266  ScalarType GetLargestExtent(const BaseGeometry *geometry);
267 
268  void PrintSelf(std::ostream &os, itk::Indent indent) const override;
269 
274  double CalculateSpacing(const mitk::Vector3D &direction) const;
275 
280  mitk::Vector3D AdjustNormal(const mitk::Vector3D &normal) const;
281 
285  mutable std::vector<PlaneGeometry::Pointer> m_PlaneGeometries;
286 
297 
305 
307  unsigned int m_Slices;
308 
311 
314  // mitk::NavigationController *m_NavigationController;
316 
317  //##Documentation
318  //## @brief PreSetSpacing
319  //##
320  //## These virtual function allows a different beahiour in subclasses.
321  //## Do implement them in every subclass of BaseGeometry. If not needed, use
322  //## {Superclass::PreSetSpacing();};
323  void PreSetSpacing(const mitk::Vector3D &aSpacing) override;
324  };
325 } // namespace mitk
326 
327 #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.