STIR  6.2.0
ProjMatrixByBinFromFile.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2004- 2008, 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 */
20 #ifndef __stir_recon_buildblock_ProjMatrixByBinFromFile__
21 #define __stir_recon_buildblock_ProjMatrixByBinFromFile__
22 
25 #include "stir/ProjDataInfo.h"
27 #include "stir/IndexRange.h"
28 #include "stir/shared_ptr.h"
29 #include <iostream>
30 
31 START_NAMESPACE_STIR
32 
33 template <int num_dimensions, typename elemT>
34 class DiscretisedDensity;
35 class Bin;
71 class ProjMatrixByBinFromFile : public RegisteredParsingObject<ProjMatrixByBinFromFile, ProjMatrixByBin, ProjMatrixByBin>
72 {
73 public:
75  static const char* const registered_name;
76 
78 
82  static Succeeded write_to_file(const std::string& output_filename_prefix,
83  const ProjMatrixByBin& proj_matrix,
84  const shared_ptr<const ProjDataInfo>& proj_data_info_sptr,
85  const DiscretisedDensity<3, float>& template_density);
86 
89 
91  void set_up(const shared_ptr<const ProjDataInfo>& proj_data_info_ptr,
92  const shared_ptr<const DiscretisedDensity<3, float>>& density_info_ptr // TODO should be Info only
93  ) override;
94 
95  ProjMatrixByBinFromFile* clone() const override;
96 
97 private:
98  std::string parsed_version;
99  std::string template_density_filename;
100  std::string template_proj_data_filename;
101  std::string data_filename;
102 
103  std::string symmetries_type;
104  // should be in symmetries
105  bool do_symmetry_90degrees_min_phi;
106  bool do_symmetry_180degrees_min_phi;
107  bool do_symmetry_swap_segment;
108  bool do_symmetry_swap_s;
109  bool do_symmetry_shift_z;
110 
111  // TODO this only works as long as we only have VoxelsOnCartesianGrid
112  // explicitly list necessary members for image details (should use an Info object instead)
113  CartesianCoordinate3D<float> voxel_size;
115  IndexRange<3> densel_range;
116 
117  shared_ptr<const ProjDataInfo> proj_data_info_ptr;
118 
119  void calculate_proj_matrix_elems_for_one_bin(ProjMatrixElemsForOneBin&) const override;
120 
121  void set_defaults() override;
122  void initialise_keymap() override;
123  bool post_processing() override;
124 
126 };
127 
128 END_NAMESPACE_STIR
129 
130 #endif
Declaration of class stir::ProjDataInfo.
Reads/writes a projection matrix from/to file.
Definition: ProjMatrixByBinFromFile.h:71
This is the (abstract) base class for all projection matrices which are organised by &#39;bin&#39;...
Definition: ProjMatrixByBin.h:78
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
declaration of stir::ProjMatrixByBin and its helpers classes
std::string write_to_file(const std::string &filename, const DataT &data)
Function that writes data to file using the default OutputFileFormat.
Definition: write_to_file.h:47
Succeeded read_data(IStreamT &s, Array< num_dimensions, elemT > &data, const ByteOrder byte_order=ByteOrder::native)
Read the data of an Array from file.
Definition: read_data.inl:63
static const char *const registered_name
Name which will be used when parsing a ProjMatrixByBin object.
Definition: ProjMatrixByBinFromFile.h:75
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files...
Definition: RegisteredParsingObject.h:77
This file defines the stir::IndexRange class.
This stores the non-zero projection matrix elements for every &#39;densel&#39; that contributes to a given bi...
Definition: ProjMatrixElemsForOneBin.h:68
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
defines the stir::CartesianCoordinate3D<coordT> class
Declaration of class stir::RegisteredParsingObject.