STIR  6.2.0
LmToProjDataNiftyPET.h
Go to the documentation of this file.
1 #pragma once
2 //
3 //
23 /*
24  Copyright (C) 2020, University College of London
25  This file is part of STIR.
26 
27  SPDX-License-Identifier: Apache-2.0
28 
29  See STIR/LICENSE.txt for details
30 */
31 
33 #include "stir/error.h"
34 
35 START_NAMESPACE_STIR
36 
44 class ProjData;
45 
46 class LmToProjDataNiftyPET : public LmToProjDataAbstract
47 {
48 public:
50  LmToProjDataNiftyPET();
51 
53  virtual ~LmToProjDataNiftyPET() {}
54 
56  void set_span(const int span) { _span = span; }
57 
59  void set_cuda_device(const char cuda_device) { _cuda_device = cuda_device; }
60 
62  void set_cuda_verbosity(const bool cuda_verbosity) { _cuda_verbosity = cuda_verbosity; }
63 
65  void set_start_time(const int start_time) { _start_time = start_time; }
66 
68  void set_stop_time(const int stop_time) { _stop_time = stop_time; }
69 
71  void set_listmode_binary_file(const std::string& listmode_binary_file) { _listmode_binary_file = listmode_binary_file; }
72 
74  void set_norm_binary_file(const std::string& norm_binary_file) { _norm_binary_file = norm_binary_file; }
75 
77  virtual void process_data();
78 
80  shared_ptr<const ProjData> get_prompts_sptr() const { return _prompts_sptr; }
81 
83  shared_ptr<const ProjData> get_delayeds_sptr() const { return _delayeds_sptr; }
84 
86  shared_ptr<const ProjData> get_randoms_sptr() const { return _randoms_sptr; }
87 
89  shared_ptr<const ProjData> get_norm_sptr() const
90  {
91  if (_norm_binary_file.empty())
92  error("Set norm binary filename before extracting listmode.");
93  return _norm_sptr;
94  }
95 
96 private:
98  void check_input() const;
99 
100  int _span;
101  char _cuda_device;
102  bool _cuda_verbosity;
103  int _start_time, _stop_time;
104  std::string _listmode_binary_file;
105  std::string _norm_binary_file;
106  shared_ptr<ProjData> _prompts_sptr;
107  shared_ptr<ProjData> _delayeds_sptr;
108  shared_ptr<ProjData> _randoms_sptr;
109  shared_ptr<ProjData> _norm_sptr;
110 };
111 
112 END_NAMESPACE_STIR
Declaration of stir::error()
void error(const char *const s,...)
Print error with format string a la printf and throw exception.
Definition: error.cxx:42
Abstract base class for listmode to projection data conversion.