STIR  6.2.0
GatedSpatialTransformation.h
Go to the documentation of this file.
1 //
2 /*
3  Copyright (C) 2009 - 2013, King's College London
4  This file is part of STIR.
5 
6  SPDX-License-Identifier: Apache-2.0
7 
8  See STIR/LICENSE.txt for details
9  */
18 #ifndef __stir_spatial_transformation_GatedSpatialTransformation_H__
19 #define __stir_spatial_transformation_GatedSpatialTransformation_H__
20 
26 #include "stir/Succeeded.h"
27 #include <fstream>
28 #include <iostream>
29 
30 START_NAMESPACE_STIR
31 
33 
36 class GatedSpatialTransformation : public RegisteredParsingObject<GatedSpatialTransformation, SpatialTransformation>
37 {
38 public:
39  static const char* const registered_name;
40 
42  ~GatedSpatialTransformation() override;
43  GatedSpatialTransformation(const TimeGateDefinitions& time_gate_definitions,
45  const shared_ptr<DiscretisedDensity<3, float>>& density_sptr);
46 
47  void read_from_files(const std::string input_string);
48  void write_to_files(const std::string output_string);
49 
51  GatedDiscretisedDensity get_spatial_transformation_z() const;
52  GatedDiscretisedDensity get_spatial_transformation_y() const;
53  GatedDiscretisedDensity get_spatial_transformation_x() const;
54  const TimeGateDefinitions& get_time_gate_definitions() const;
57  void set_spatial_transformations(const GatedDiscretisedDensity& motion_z,
58  const GatedDiscretisedDensity& motion_y,
59  const GatedDiscretisedDensity& motion_x);
60  void set_gate_defs(const TimeGateDefinitions& gate_defs);
62 
64  void warp_image(GatedDiscretisedDensity& new_gated_image, const GatedDiscretisedDensity& gated_image) const;
65  void warp_image(DiscretisedDensity<3, float>& new_reference_image, const GatedDiscretisedDensity& gated_image) const;
66  void warp_image(GatedDiscretisedDensity& gated_image, const DiscretisedDensity<3, float>& reference_image) const;
67  void accumulate_warp_image(DiscretisedDensity<3, float>& new_reference_image, const GatedDiscretisedDensity& gated_image) const;
68  void set_defaults() override;
69  Succeeded set_up() override;
71 private:
73  void initialise_keymap() override;
74  bool post_processing() override;
75  std::string _transformation_filename_prefix;
76  GatedDiscretisedDensity _spatial_transformation_z;
77  GatedDiscretisedDensity _spatial_transformation_y;
78  GatedDiscretisedDensity _spatial_transformation_x;
79  std::string _spline_level_number;
80  bool _spatial_transformations_are_stored;
81  BSpline::BSplineType _spline_type;
82  std::string _time_gate_definition_filename;
83  TimeGateDefinitions _gate_defs;
84 };
85 
86 END_NAMESPACE_STIR
87 #endif
Declaration of class stir::Succeeded.
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.
Class for spatial transformations for gated images.
Definition: GatedSpatialTransformation.h:36
defines the stir::DiscretisedDensity class
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
Class used for storing time gate durations.
Definition: TimeGateDefinitions.h:42
Definition of class stir::SpatialTransformation.
Class of multiple image gates.
Definition: GatedDiscretisedDensity.h:34
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
Declaration of class stir::RegisteredParsingObject.
Implementation of class stir::GatedDiscretisedDensity.