STIR  6.2.0
InterfileHeaderSiemens.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2020, 2021, 2023 University College London
3  Copyright (C) 2018 STFC
4  This file is part of STIR.
5 
6  SPDX-License-Identifier: Apache-2.0
7 
8  See STIR/LICENSE.txt for details
9 */
22 #ifndef __stir_InterfileHeaderSiemens_H__
23 #define __stir_InterfileHeaderSiemens_H__
24 
25 #include "stir/ByteOrder.h"
26 #include "stir/NumericInfo.h"
29 #include "stir/ExamInfo.h"
30 
31 START_NAMESPACE_STIR
32 
33 class ProjDataInfo;
34 
41 class InterfileHeaderSiemens : public InterfileHeader
42 {
43 public:
45  static const double double_value_not_set;
46 
47  InterfileHeaderSiemens();
48 
49  ~InterfileHeaderSiemens() override {}
50 
51 protected:
52  // Returns false if OK, true if not.
53  bool post_processing() override;
55 
66  void ignore_Siemens_date_and_time_keys(const std::string& keyword);
67 
68 private:
69  // TODO the next few ones should be made static members
70  // Lists of possible values for some keywords
71  // ASCIIlist_type number_format_values;
72  ASCIIlist_type byte_order_values;
73  ASCIIlist_type patient_position_values;
74 
75  // Corresponding variables here
76 
77  // int number_format_index;
78  int byte_order_index;
79  int patient_position_index;
80 
81  void set_type_of_data();
82 
83 protected:
84  void read_scan_data_types();
85 };
86 
87 #if 0 // probably not necessary
88 
93 class InterfileImageHeader : public InterfileHeaderSiemens
94 {
95  private:
96  typedef InterfileHeaderSiemens base_type;
97 
98 public:
99  InterfileImageHeader();
100  std::vector<double> first_pixel_offsets;
101 
102 protected:
103  virtual void read_matrix_info();
105  virtual bool post_processing();
106 
107 };
108 
109 #endif
110 
117 class InterfileRawDataHeaderSiemens : public InterfileHeaderSiemens
118 {
119 public:
120  InterfileRawDataHeaderSiemens();
121 
122 protected:
124  bool post_processing() override;
125  // need this to be false for the listmode data
126  bool is_arccorrected;
127 
128 public:
129  ProjDataFromStream::StorageOrder storage_order;
130  std::vector<int> segment_sequence;
131  std::vector<int> timing_poss_sequence;
132  shared_ptr<ProjDataInfo> data_info_ptr;
133 
134 private:
135  void resize_segments_and_set();
136  // void read_frames_info();
137 
138  // int find_storage_order();
139 
140 protected:
141  int axial_compression;
142  int maximum_ring_difference;
143  int tof_mash_factor;
144 
145  std::vector<int> segment_table;
146  int num_segments;
147  int num_rings;
148  int num_views;
149  int num_bins;
150  int num_tof_bins;
151 };
152 
159 class InterfilePDFSHeaderSiemens : public InterfileRawDataHeaderSiemens
160 {
161 public:
162  InterfilePDFSHeaderSiemens();
163 
164 protected:
166  bool post_processing() override;
167 
168 public:
169  std::vector<std::string> applied_corrections;
170  bool compression;
171 
172 private:
173  void resize_segments_and_set();
174 
175  int find_storage_order();
176 
177  int num_scan_data_types;
178  std::vector<std::string> scan_data_types;
179  void read_scan_data_types();
180  int total_num_sinograms;
181  std::string compression_as_string;
182 
183  int num_buckets;
184  std::vector<int> bucket_singles_rates;
185  void read_bucket_singles_rates();
186 };
187 
194 class InterfileListmodeHeaderSiemens : public InterfileRawDataHeaderSiemens
195 {
196 public:
197  InterfileListmodeHeaderSiemens();
198 
199 protected:
201  bool post_processing() override;
202 
203 public:
205  int get_axial_compression() const;
207  int get_maximum_ring_difference() const;
209  int get_num_views() const;
211  int get_num_projections() const;
212 
213 private:
214  int find_storage_order();
215 };
216 
223 class InterfileNormHeaderSiemens : public InterfileRawDataHeaderSiemens
224 {
225 public:
226  InterfileNormHeaderSiemens();
227 
228 protected:
230  bool post_processing() override;
231 
232 public:
233  float calib_factor;
234  float cross_calib_factor;
235  int num_buckets;
236 
237 private:
238  int num_components;
239  std::vector<std::vector<int>> number_of_dimensions;
240  void read_num_components();
241 };
242 
243 END_NAMESPACE_STIR
244 
245 #endif // __stir_InterfileHeaderSiemens_H__
This file declares the stir::ByteOrder class.
This file declares the class stir::ExamInfo.
This file declares the classes stir::InterfileHeader, stir::InterfileImageHeader, stir::InterfilePDFS...
Declaration of class stir::ProjDataFromStream.
This file declares the class stir::NumericInfo.