STIR  6.2.0
LmToProjData.h
Go to the documentation of this file.
1 #ifndef __stir_listmode_LmToProjData_H__
2 #define __stir_listmode_LmToProjData_H__
3 //
4 //
17 /*
18  Copyright (C) 2000- 2009, Hammersmith Imanet Ltd
19  Copyright (C) 2017, University of Hull
20  Copyright (C) 2019, National Physical Laboratory
21  Copyright (C) 2019, 2021, University College of London
22  This file is part of STIR.
23 
24  SPDX-License-Identifier: Apache-2.0
25 
26  See STIR/LICENSE.txt for details
27 */
28 
30 #include "stir/ProjDataInfo.h"
32 #include "stir/ParsingObject.h"
34 
36 
37 START_NAMESPACE_STIR
38 
39 class ListEvent;
40 class ListTime;
41 
163 {
164 public:
166 
167  LmToProjData(const char* const par_filename);
168 
170 
171  LmToProjData();
172 
179  void set_template_proj_data_info_sptr(shared_ptr<const ProjDataInfo>);
180  shared_ptr<ProjDataInfo> get_template_proj_data_info_sptr();
181 
183 
184  virtual void set_input_data(const shared_ptr<ExamData>&);
186 
187  virtual void set_input_data(const std::string& filename);
188 #if 0
189 
191  virtual ListModeData& get_input_data() const;
192 #endif
193 
194  void set_output_filename_prefix(const std::string&);
195  std::string get_output_filename_prefix() const;
196 
198 
199  void set_output_projdata_sptr(shared_ptr<ProjData>&);
200 
201  void set_store_prompts(bool);
202  bool get_store_prompts() const;
203  void set_store_delayeds(bool);
204  bool get_store_delayeds() const;
205  void set_num_segments_in_memory(int);
206  int get_num_segments_in_memory() const;
207  void set_num_events_to_store(long int);
208  long int get_num_events_to_store() const;
209  void set_time_frame_definitions(const TimeFrameDefinitions&);
210  const TimeFrameDefinitions& get_time_frame_definitions() const;
212 
214 
215  Succeeded set_up() override;
216 
220  void process_data() override;
221 
222 #if 0
223  void run_tof_test_function();
228 #endif
229 
230 protected:
232 
233  virtual void start_new_time_frame(const unsigned int new_frame_num);
234 
236  virtual void process_new_time_event(const ListTime&);
237 
239 
244  virtual void get_bin_from_event(Bin& bin, const ListEvent&) const;
245 
247 
250  int get_compression_count(const Bin& bin) const;
251 
253 
256  void do_post_normalisation(Bin& bin) const;
257 
259 
260  void set_defaults() override;
261  void initialise_keymap() override;
262  bool post_processing() override;
264 
266  //{@
267  std::string input_filename;
268  std::string output_filename_prefix;
269  std::string template_proj_data_name;
271 
273  bool do_pre_normalisation;
274  bool store_prompts;
275  bool store_delayeds;
276 
277  int num_segments_in_memory;
278  int num_timing_poss_in_memory;
279  long int num_events_to_store;
280  int max_segment_num_to_process;
281 
283 
285 
286  shared_ptr<ProjDataInfo> template_proj_data_info_ptr;
288  shared_ptr<BinNormalisation> normalisation_ptr;
290  shared_ptr<BinNormalisation> post_normalisation_ptr;
292  shared_ptr<ProjData> output_proj_data_sptr;
293 
295 
297  shared_ptr<ListModeData> lm_data_ptr;
298 
301 
303  double current_time;
305 
306  unsigned int current_frame_num;
307 
309 
310  shared_ptr<const ProjDataInfo> proj_data_info_cyl_uncompressed_ptr;
311 
318 
321 };
322 
323 END_NAMESPACE_STIR
324 
325 #endif
shared_ptr< const ProjDataInfo > proj_data_info_cyl_uncompressed_ptr
Internal variable that will be used for pre-normalisation.
Definition: LmToProjData.h:310
bool do_time_frame
variable that will be set according to if we are using time frames or num_events_to_store ...
Definition: LmToProjData.h:315
Class used for storing time frame durations.
Definition: TimeFrameDefinitions.h:38
This class is the abstract base class fir binning listmode data to projection data, i.e. (3d) sinograms.
Definition: LmToProjDataAbstract.h:38
bool interactive
Toggle readable output on stdout or actual projdata.
Definition: LmToProjData.h:284
Declaration of class stir::TimeFrameDefinitions.
This class is used to bin listmode data to projection data, i.e. (3d) sinograms.
Definition: LmToProjData.h:162
Declaration of class stir::ProjDataInfo.
Declaration of class stir::ParsingObject.
shared_ptr< BinNormalisation > post_normalisation_ptr
This will be used for post-normalisation.
Definition: LmToProjData.h:290
int delayed_increment
A variable that will be set to 1,0 or -1, according to store_prompts and store_delayeds.
Definition: LmToProjData.h:317
The base class for reading list mode data.
Definition: ListModeData.h:123
Declaration of class stir::BinNormalisation.
double current_time
stores the time (in secs) recorded in the previous timing event
Definition: LmToProjData.h:303
shared_ptr< BinNormalisation > normalisation_ptr
This will be used for pre-normalisation.
Definition: LmToProjData.h:288
Class for storing and using gamma events from a list mode file.
Definition: ListEvent.h:45
A class for storing coordinates and value of a single projection bin.
Definition: Bin.h:48
shared_ptr< ListModeData > lm_data_ptr
Pointer to the actual data.
Definition: LmToProjData.h:297
bool _already_setup
an internal bool variable to check if the object has been set-up or not
Definition: LmToProjData.h:320
std::string frame_definition_filename
frame definitions
Definition: LmToProjData.h:272
shared_ptr< ProjData > output_proj_data_sptr
This will be used to return the output directly, if set.
Definition: LmToProjData.h:292
Abstract base class for listmode to projection data conversion.
Declaration of class stir::ListModeData.
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
TimeFrameDefinitions frame_defs
Time frames.
Definition: LmToProjData.h:300
A class for storing and using a timing record from a listmode file.
Definition: ListTime.h:46
unsigned int current_frame_num
stores the current frame number
Definition: LmToProjData.h:306