22 #ifndef __stir_ProjData_H__ 23 #define __stir_ProjData_H__ 43 template <
typename elemT>
44 class RelatedViewgrams;
45 class DataSymmetriesForViewSegmentNumbers;
46 template <
typename elemT>
47 class SegmentBySinogram;
48 template <
typename elemT>
50 template <
typename elemT>
52 template <
typename elemT>
55 class ProjDataInMemory;
112 static shared_ptr<ProjData>
read_from_file(
const std::string& filename,
const std::ios::openmode open_mode = std::ios::in);
117 ProjData(
const shared_ptr<const ExamInfo>& exam_info_sptr,
const shared_ptr<const ProjDataInfo>& proj_data_info_ptr);
129 inline shared_ptr<const ProjDataInfo> get_proj_data_info_sptr()
const;
135 const int segment_num,
136 const bool make_num_tangential_poss_odd =
false,
137 const int timing_pos = 0)
const = 0;
148 const int segment_num,
149 const bool make_num_tangential_poss_odd =
false,
150 const int timing_pos = 0)
const = 0;
160 unique_ptr<ProjDataInMemory> get_subset(
const std::vector<int>& views)
const;
170 const int segment_num,
171 const bool make_num_tangential_poss_odd =
false,
172 const int timing_pos = 0)
const;
182 const int segment_num,
183 const bool make_num_tangential_poss_odd =
false,
184 const int timing_pos = 0)
const;
195 const bool make_num_tangential_poss_odd =
false,
196 const int timing_pos = 0)
const;
202 const bool make_num_tangential_poss_odd =
false,
203 const int timing_pos = 0)
const;
218 virtual SegmentByView<float> get_segment_by_view(
const int segment_num,
const int timing_pos = 0)
const;
231 const shared_ptr<DataSymmetriesForViewSegmentNumbers>&,
232 const bool make_num_tangential_poss_odd =
false,
233 const int timing_pos = 0)
const;
242 const shared_ptr<DataSymmetriesForViewSegmentNumbers>& symmetries_ptr,
243 const bool make_num_tangential_poss_odd =
false,
244 const int timing_pos = 0)
const;
248 virtual void fill(
const float value);
263 static std::vector<int> standard_segment_sequence(
const ProjDataInfo& pdi);
280 template <
typename iterT>
286 for (
int k = this->get_proj_data_info_sptr()->get_min_tof_pos_num();
287 k <= this->get_proj_data_info_sptr()->get_max_tof_pos_num();
290 for (
int s : standard_segment_sequence(*this->get_proj_data_info_sptr()))
292 auto segment = this->get_empty_segment_by_sinogram(s,
false, k);
294 for (
auto seg_iter = segment.begin_all(); seg_iter != segment.end_all();
296 *seg_iter++ = *array_iter++;
297 this->set_segment(segment);
313 template <
typename iterT>
316 for (
int k = this->get_proj_data_info_sptr()->get_min_tof_pos_num();
317 k <= this->get_proj_data_info_sptr()->get_max_tof_pos_num();
320 for (
int s : standard_segment_sequence(*this->get_proj_data_info_sptr()))
322 const auto segment = this->get_segment_by_sinogram(s, k);
323 array_iter = std::copy(segment.begin_all_const(), segment.end_all_const(), array_iter);
330 inline int get_num_segments()
const;
332 inline int get_num_axial_poss(
const int segment_num)
const;
334 inline int get_num_views()
const;
336 inline int get_num_tangential_poss()
const;
338 inline int get_num_tof_poss()
const;
340 inline int get_min_tof_pos_num()
const;
342 inline int get_max_tof_pos_num()
const;
344 inline int get_tof_mash_factor()
const;
346 inline int get_min_segment_num()
const;
348 inline int get_max_segment_num()
const;
350 inline int get_min_axial_pos_num(
const int segment_num)
const;
352 inline int get_max_axial_pos_num(
const int segment_num)
const;
354 inline int get_min_view_num()
const;
356 inline int get_max_view_num()
const;
358 inline int get_min_tangential_pos_num()
const;
360 inline int get_max_tangential_pos_num()
const;
365 inline int get_num_sinograms()
const;
370 inline int get_num_non_tof_sinograms()
const;
372 inline std::size_t size_all()
const;
374 inline std::vector<int> get_original_view_nums()
const;
382 virtual float sum()
const;
385 virtual float find_max()
const;
388 virtual float find_min()
const;
391 virtual double norm()
const;
397 virtual self_type& operator+=(
const self_type& v);
400 virtual self_type& operator-=(
const self_type& v);
403 virtual self_type& operator*=(
const self_type& v);
406 virtual self_type& operator/=(
const self_type& v);
409 virtual self_type& operator+=(
const float v);
412 virtual self_type& operator-=(
const float v);
415 virtual self_type& operator*=(
const float v);
418 virtual self_type& operator/=(
const float v);
424 virtual void xapyb(
const ProjData& x,
const float a,
const ProjData& y,
const float b);
430 virtual void sapyb(
const float a,
const ProjData& y,
const float b);
437 shared_ptr<const ProjDataInfo> proj_data_info_sptr;
#define STIR_DEPRECATED
Deprecation macro.
Definition: deprecated.h:19
iterT fill_from(iterT array_iter)
set all bins from an array iterator
Definition: ProjData.h:281
A class for 2d projection data.
Definition: FBP3DRPReconstruction.h:39
Declaration of class stir::Succeeded.
~ProjData() override
Destructor.
Definition: ProjData.h:126
A very simple class to store segment numbers and any other indices that define a segment.
Definition: SegmentIndices.h:33
Declaration of class stir::ProjDataInfo.
Definition of class stir::SegmentIndices.
A class for storing (3d) projection data with fixed SegmentIndices.
Definition: FBP3DRPReconstruction.h:41
declaration of stir::ExamData
Definition of class stir::SinogramIndices.
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast (or corresponding b...
Implementations for inline functions of class stir::ProjData.
iterT copy_to(iterT array_iter) const
Copy all bins to a range specified by a (forward) iterator.
Definition: ProjData.h:314
defines the Array class for multi-dimensional (numeric) arrays
A class for storing (3d) projection data with fixed SegmentIndices.
Definition: ArcCorrection.h:40
unique_ptr< DataT > read_from_file(const FileSignature &signature, FileT file)
Function that reads data from file using the default InputFileFormatRegistry, using the provided File...
Definition: read_from_file.h:46
std::string write_to_file(const std::string &filename, const DataT &data)
Function that writes data to file using the default OutputFileFormat.
Definition: write_to_file.h:47
Definition of class stir::ViewgramIndices.
double norm_squared(const BasicCoordinate< num_dimensions, coordT > &p1)
compute (inner_product(p1,p1))
Definition: BasicCoordinate.inl:415
Declaration of class stir::SegmentByView.
double norm(const BasicCoordinate< num_dimensions, coordT > &p1)
compute sqrt(inner_product(p1,p1))
Definition: BasicCoordinate.inl:426
A very simple class to store all dincies to get a (2D) Sinogram.
Definition: SinogramIndices.h:33
An (abstract base) class that contains information on the projection data.
Definition: ProjDataInfo.h:69
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
A very simple class to store all dincies to get a (2D) Viewgram.
Definition: ViewgramIndices.h:32
elemT sum(IterT start, IterT end, elemT init)
Compute the sum of a sequence using operator+=(), using an initial value.
Definition: more_algorithms.inl:52
The (abstract) base class for the projection data.
Definition: ProjData.h:103
Declaration of class stir::SegmentBySinogram.
base class for data objects such as ProjData etcProvides an ExamInfo member.
Definition: ExamData.h:33