STIR 6.4.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*/
21
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
31START_NAMESPACE_STIR
32
33class ProjDataInfo;
34
41class InterfileHeaderSiemens : public InterfileHeader
42{
43public:
45 static const double double_value_not_set;
46
47 InterfileHeaderSiemens();
48
49 ~InterfileHeaderSiemens() override {}
50
51protected:
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
68private:
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
83protected:
84 void read_scan_data_types();
85};
86
87#if 0 // probably not necessary
93class InterfileImageHeader : public InterfileHeaderSiemens
94{
95 private:
96 typedef InterfileHeaderSiemens base_type;
97
98public:
99 InterfileImageHeader();
100 std::vector<double> first_pixel_offsets;
101
102protected:
103 virtual void read_matrix_info();
105 virtual bool post_processing();
106
107};
108
109#endif
110
117class InterfileRawDataHeaderSiemens : public InterfileHeaderSiemens
118{
119public:
120 InterfileRawDataHeaderSiemens();
121
122protected:
124 bool post_processing() override;
125 // need this to be false for the listmode data
126 bool is_arccorrected;
127
128public:
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
134private:
135 void resize_segments_and_set();
136 // void read_frames_info();
137
138 // int find_storage_order();
139
140protected:
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
159class InterfilePDFSHeaderSiemens : public InterfileRawDataHeaderSiemens
160{
161public:
162 InterfilePDFSHeaderSiemens();
163
164protected:
166 bool post_processing() override;
167
168public:
169 std::vector<std::string> applied_corrections;
170 bool compression;
171
172private:
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
194class InterfileListmodeHeaderSiemens : public InterfileRawDataHeaderSiemens
195{
196public:
197 InterfileListmodeHeaderSiemens();
198
199protected:
201 bool post_processing() override;
202
203public:
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
213private:
214 int find_storage_order();
215};
216
223class InterfileNormHeaderSiemens : public InterfileRawDataHeaderSiemens
224{
225public:
226 InterfileNormHeaderSiemens();
227
228protected:
230 bool post_processing() override;
231
232public:
233 float calib_factor;
234 float cross_calib_factor;
235 int num_buckets;
236
237private:
238 int num_components;
239 std::vector<std::vector<int>> number_of_dimensions;
240 void read_num_components();
241};
242
243END_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...
This file declares the class stir::NumericInfo.
Declaration of class stir::ProjDataFromStream.
static const double double_value_not_set
A value that can be used to signify that a variable has not been set during parsing.
Definition InterfileHeaderSiemens.h:45
int get_num_projections() const
Gat the num of projections.
Definition InterfileHeaderSiemens.cxx:569
bool post_processing() override
Returns false if OK, true if not.
Definition InterfileHeaderSiemens.cxx:575
int get_num_views() const
Get the num of views.
Definition InterfileHeaderSiemens.cxx:564
int get_maximum_ring_difference() const
Get the maximum ring difference.
Definition InterfileHeaderSiemens.cxx:559
int get_axial_compression() const
Get axial compression.
Definition InterfileHeaderSiemens.cxx:554
bool post_processing() override
Returns false if OK, true if not.
Definition InterfileHeaderSiemens.cxx:668
bool post_processing() override
Returns false if OK, true if not.
Definition InterfileHeaderSiemens.cxx:422
bool post_processing() override
Returns false if OK, true if not.
Definition InterfileHeaderSiemens.cxx:263