4 #ifndef __stir_gpu_NiftyPETHelper_h__ 5 #define __stir_gpu_NiftyPETHelper_h__ 48 template <
int num_dimensions,
typename elemT>
49 class DiscretisedDensity;
51 template <
typename elemT>
53 template <
typename elemT>
54 class VoxelsOnCartesianGrid;
65 : _already_set_up(false),
69 _scanner_type(
Scanner::Unknown_scanner)
79 void set_span(
const char span) { _span = span; }
82 void set_att(
const char att) { _att = att; }
94 static std::vector<float> create_niftyPET_image();
97 static shared_ptr<VoxelsOnCartesianGrid<float>> create_stir_im();
100 std::vector<float> create_niftyPET_sinogram_no_gaps()
const;
103 std::vector<float> create_niftyPET_sinogram_with_gaps()
const;
112 void convert_proj_data_stir_to_niftyPET(std::vector<float>& np_vec,
const ProjData& stir)
const;
115 void convert_viewgram_stir_to_niftyPET(std::vector<float>& np_vec,
const Viewgram<float>& viewgram)
const;
118 void convert_proj_data_niftyPET_to_stir(
ProjData& stir_sptr,
const std::vector<float>& np_vec)
const;
121 void remove_gaps(std::vector<float>& sino_no_gaps,
const std::vector<float>& sino_w_gaps)
const;
124 void put_gaps(std::vector<float>& sino_w_gaps,
const std::vector<float>& sino_no_gaps)
const;
127 void back_project(std::vector<float>& image,
const std::vector<float>& sino_no_gaps)
const;
130 void forward_project(std::vector<float>& sino_no_gaps,
const std::vector<float>& image)
const;
133 static shared_ptr<ProjData> create_stir_sino();
136 void lm_to_proj_data(shared_ptr<ProjData>& prompts_sptr,
137 shared_ptr<ProjData>& delayeds_sptr,
138 shared_ptr<ProjData>& randoms_sptr,
139 shared_ptr<ProjData>& norm_sptr,
142 const std::string& lm_binary_file,
143 const std::string& norm_binary_file =
"")
const;
147 void check_set_up()
const;
150 void permute(std::vector<float>& output_array,
151 const std::vector<float>& orig_array,
152 const unsigned output_dims[3],
153 const unsigned* permute_order)
const;
156 unsigned convert_NiftyPET_proj_3d_to_1d_idx(
const unsigned ang,
const unsigned bins,
const unsigned sino)
const;
159 void convert_NiftyPET_proj_1d_to_3d_idx(
unsigned& ang,
unsigned& bins,
unsigned& sino,
const unsigned idx)
const;
161 bool _already_set_up;
164 shared_ptr<Cnst> _cnt_sptr;
167 std::vector<int> _isub;
170 shared_ptr<txLUTs> _txlut_sptr;
171 shared_ptr<axialLUT> _axlut_sptr;
173 std::vector<float> _crs;
174 std::vector<short> _s2c;
177 std::vector<float> _li2rng;
178 std::vector<short> _li2sn;
179 std::vector<char> _li2nos;
184 #endif // __stir_gpu_NiftyPETHelper_h__ Namespace for the STIR library (and some/most of its applications)
Definition: General_Reconstruction.cxx:6
NiftyPETHelper()
Default constructor.
Definition: NiftyPETHelper.h:64
Type
enum for all predefined scanners
Definition: Scanner.h:140
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
A class for storing some info on the scanner.
Definition: Scanner.h:107
Declaration of class stir::Scanner.
Helper class for the wrapped NiftyPET projectors.
Definition: NiftyPETHelper.h:60
void set_span(const char span)
Set span.
Definition: NiftyPETHelper.h:79
void set_scanner_type(const Scanner::Type scanner_type)
Set scanner type.
Definition: NiftyPETHelper.h:88
void set_cuda_device_id(const int devid)
Set CUDA device ID.
Definition: NiftyPETHelper.h:76
void set_verbose(const bool verbose)
Set verbosity level for CUDA output.
Definition: NiftyPETHelper.h:85
The (abstract) base class for the projection data.
Definition: ProjData.h:103
void set_att(const char att)
Set emission (0) or transmission (1) - whether to exp{-result} for attenuation maps.
Definition: NiftyPETHelper.h:82