STIR 6.4.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
31START_NAMESPACE_STIR
32
33template <int num_dimensions, typename elemT>
34class DiscretisedDensity;
35class Bin;
70
71class ProjMatrixByBinFromFile : public RegisteredParsingObject<ProjMatrixByBinFromFile, ProjMatrixByBin, ProjMatrixByBin>
72{
73public:
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
97private:
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)
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
125 Succeeded read_data();
126};
127
128END_NAMESPACE_STIR
129
130#endif
defines the stir::CartesianCoordinate3D<coordT> class
This file defines the stir::IndexRange class.
Declaration of class stir::ProjDataInfo.
declaration of stir::ProjMatrixByBin and its helpers classes
Declaration of class stir::RegisteredParsingObject.
a templated class for 3-dimensional coordinates.
Definition CartesianCoordinate3D.h:53
This abstract class is the basis for all image representations.
Definition DiscretisedDensity.h:99
This class defines ranges which can be 'irregular'.
Definition IndexRange.h:69
ProjMatrixByBinFromFile()
Default constructor (calls set_defaults())
Definition ProjMatrixByBinFromFile.cxx:50
static const char *const registered_name
Name which will be used when parsing a ProjMatrixByBin object.
Definition ProjMatrixByBinFromFile.h:75
void set_up(const shared_ptr< const ProjDataInfo > &proj_data_info_ptr, const shared_ptr< const DiscretisedDensity< 3, float > > &density_info_ptr) override
Checks all necessary geometric info.
Definition ProjMatrixByBinFromFile.cxx:169
static Succeeded write_to_file(const std::string &output_filename_prefix, const ProjMatrixByBin &proj_matrix, const shared_ptr< const ProjDataInfo > &proj_data_info_sptr, const DiscretisedDensity< 3, float > &template_density)
Writes a projection matrix to file in a format such that this class can read it back.
Definition ProjMatrixByBinFromFile.cxx:333
This is the (abstract) base class for all projection matrices which are organised by 'bin'.
Definition ProjMatrixByBin.h:79
shared_ptr< const ProjDataInfo > proj_data_info_sptr
We need a local copy of the proj_data_info to get the integration boundaries and RayTracing.
Definition ProjMatrixByBin.h:192
This stores the non-zero projection matrix elements for every 'densel' that contributes to a given bi...
Definition ProjMatrixElemsForOneBin.h:69
Parent class for all leaves in a RegisteredObject hierarchy that do parsing of parameter files.
Definition RegisteredParsingObject.h:78
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...