STIR  6.2.0
NonRigidObjectTransformationUsingBSplines.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2005- 2009 , Hammersmith Imanet Ltd
5  For internal GE use only
6 */
16 #ifndef __stir_motion_NonRigidObjectTransformationUsingBSplines_H__
17 #define __stir_motion_NonRigidObjectTransformationUsingBSplines_H__
18 
21 #include "stir/numerics/BSplines.h"
24 #include "stir/shared_ptr.h"
25 //#include "stir/DiscretisedDensityOnCartesianGrid.h"
26 
27 START_NAMESPACE_STIR
28 class Succeeded;
29 
30 template <int num_dimensions, class elemT>
31 class DeformationFieldOnCartesianGrid : public BasicCoordinate<num_dimensions, Array<num_dimensions, elemT>>
32 // public DiscretisedDensityOnCartesianGrid<num_dimensions, BasicCoordinate<num_dimensions, elemT> >
33 {
34 public:
35  DeformationFieldOnCartesianGrid() {}
36 };
37 
42 template <int num_dimensions, class elemT>
44  : public RegisteredParsingObject<NonRigidObjectTransformationUsingBSplines<num_dimensions, elemT>,
45  ObjectTransformation<num_dimensions, elemT>,
46  ObjectTransformation<num_dimensions, elemT>>
47 {
48 public:
49  static const char* const registered_name;
50 
51  // Default constructor
53 
56  NonRigidObjectTransformationUsingBSplines(const std::string& filename_x,
57  const std::string& filename_y,
58  const std::string& filename_z,
59  const int bspline_order);
60 
62  NonRigidObjectTransformationUsingBSplines(const std::string& filename, const int bspline_order);
63 
65  virtual BasicCoordinate<num_dimensions, elemT> transform_point(const BasicCoordinate<num_dimensions, elemT>& point) const;
66 
67  float jacobian(const BasicCoordinate<num_dimensions, elemT>& point) const;
68 
69  virtual void set_defaults();
70  virtual void initialise_keymap();
71  virtual bool post_processing();
72  virtual void set_key_values();
73 
74 private:
76  // BasicCoordinate<num_dimensions,elemT> _grid_spacing;
77  // BasicCoordinate<num_dimensions,elemT> _origin;
78  CartesianCoordinate3D<elemT> _grid_spacing;
80  BSpline::BSplineType _bspline_type;
81 
82  // use for parsing only
83  shared_ptr<DeformationFieldOnCartesianGrid<num_dimensions, elemT>> deformation_field_sptr;
84  int _bspline_order;
85  // for NCAT only
86  std::string _deformation_field_from_NCAT_file;
87  CartesianCoordinate3D<int> _deformation_field_from_NCAT_size;
88  // from file
89  std::string _deformation_field_from_file_x;
90  std::string _deformation_field_from_file_y;
91  std::string _deformation_field_from_file_z;
92  // multicomponent filename
93  std::string _deformation_field_multicomponent_filename;
94 };
95 #if 0
96 
99 std::ostream&
100 operator<<(std::ostream& out,
101  const NonRigidObjectTransformationUsingBSplines& rigid_object_transformation);
103 
105 std::istream&
106 operator>>(std::istream& ,
107  NonRigidObjectTransformationUsingBSplines& rigid_object_transformation);
108 #endif
109 
110 END_NAMESPACE_STIR
111 
112 #endif
BSplineType
enum providing constants to define the type of B-Spline used for interpolation
Definition: BSplines.h:37
Implementation of the n-dimensional B-Splines Interpolation.
Declaration of class stir::ObjectTransformation.
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
Class to perform non-rigid object transformations in arbitrary dimensions.
Definition: NonRigidObjectTransformationUsingBSplines.h:43
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
Implementation of the basic components and declarations for B-Splines Interpolation.
defines the stir::CartesianCoordinate3D<coordT> class
Declaration of class stir::RegisteredParsingObject.