STIR  6.2.0
Shape3D.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2000- 2007, Hammersmith Imanet Ltd
5  This file is part of STIR.
6 
7  SPDX-License-Identifier: Apache-2.0
8 
9  See STIR/LICENSE.txt for details
10 */
21 #ifndef __stir_Shape_Shape3D_h__
22 #define __stir_Shape_Shape3D_h__
23 
24 #include "stir/RegisteredObject.h"
25 #include "stir/ParsingObject.h"
27 
28 START_NAMESPACE_STIR
29 
30 template <typename elemT>
31 class VoxelsOnCartesianGrid;
32 
65 class Shape3D : public RegisteredObject<Shape3D>
66 {
67 public:
68  ~Shape3D() override {}
69 
71 
78  virtual inline bool operator==(const Shape3D&) const = 0;
79 
81  inline bool operator!=(const Shape3D&) const;
82 
100  virtual float get_voxel_weight(const CartesianCoordinate3D<float>& voxel_centre,
101  const CartesianCoordinate3D<float>& voxel_size,
102  const CartesianCoordinate3D<int>& num_samples) const;
103 
105 
113  virtual bool is_inside_shape(const CartesianCoordinate3D<float>& coord) const = 0;
114 
116 
120  virtual void translate(const CartesianCoordinate3D<float>& direction);
122 
135  virtual void scale(const CartesianCoordinate3D<float>& scale3D) = 0;
136 
138  inline void scale_around_origin(const CartesianCoordinate3D<float>& scale3D);
139 
154  virtual void construct_volume(VoxelsOnCartesianGrid<float>& image, const CartesianCoordinate3D<int>& num_samples) const;
155  // virtual void construct_slice(PixelsOnCartesianGrid<float> &plane, const CartesianCoordinate3D<int>& num_samples) const;
156 
158 
162  virtual float get_geometric_volume() const;
163 #if 0
164 
169  virtual float get_geometric_area() const;
170 #endif
171 
172  // TODO get_bounding_box() const;
173 
175  inline CartesianCoordinate3D<float> get_origin() const;
177  virtual void set_origin(const CartesianCoordinate3D<float>&);
178 
180  virtual Shape3D* clone() const = 0;
181 
182  // need to overload this to avoid ambiguity between Object::parameter_info and ParsingObject::parameter_info()
183  std::string parameter_info() override;
184 
185 protected:
186  inline Shape3D();
187  inline explicit Shape3D(const CartesianCoordinate3D<float>& origin);
188 
190 
191  void set_defaults() override;
192  void initialise_keymap() override;
194 private:
197 };
198 
199 END_NAMESPACE_STIR
200 
201 #include "stir/Shape/Shape3D.inl"
202 
203 #endif
This class is used to represent voxelised densities on a cuboid grid (3D).
Definition: FBP3DRPReconstruction.h:43
Inline-implementations of class stir::Shape3D.
Declaration of class stir::ParsingObject.
The base class for all 3 dimensional shapes.
Definition: Shape3D.h:65
Declaration of class stiir::RegisteredObject.
Helper class to provide registry mechanisms to a Base classSuppose you have a hierarchy of classes wi...
Definition: RegisteredObject.h:95
defines the stir::CartesianCoordinate3D<coordT> class