22#ifndef __stir_ProjData_H__
23#define __stir_ProjData_H__
44template <
typename elemT>
45class RelatedViewgrams;
46class DataSymmetriesForViewSegmentNumbers;
47template <
typename elemT>
48class SegmentBySinogram;
49template <
typename elemT>
51template <
typename elemT>
53template <
typename elemT>
56class ProjDataInMemory;
106#ifdef STIR_COMPILING_SWIG_WRAPPER
113 static shared_ptr<ProjData>
read_from_file(
const std::string& filename,
const std::ios::openmode open_mode = std::ios::in);
118 ProjData(
const shared_ptr<const ExamInfo>& exam_info_sptr,
const shared_ptr<const ProjDataInfo>& proj_data_info_ptr);
131 const int segment_num,
132 const bool make_num_tangential_poss_odd =
false,
133 const int timing_pos = 0)
const = 0;
144 const int segment_num,
145 const bool make_num_tangential_poss_odd =
false,
146 const int timing_pos = 0)
const = 0;
156 unique_ptr<ProjDataInMemory>
get_subset(
const std::vector<int>& views)
const;
166 const int segment_num,
167 const bool make_num_tangential_poss_odd =
false,
168 const int timing_pos = 0)
const;
178 const int segment_num,
179 const bool make_num_tangential_poss_odd =
false,
180 const int timing_pos = 0)
const;
191 const bool make_num_tangential_poss_odd =
false,
192 const int timing_pos = 0)
const;
198 const bool make_num_tangential_poss_odd =
false,
199 const int timing_pos = 0)
const;
227 const shared_ptr<DataSymmetriesForViewSegmentNumbers>&,
228 const bool make_num_tangential_poss_odd =
false,
229 const int timing_pos = 0)
const;
238 const shared_ptr<DataSymmetriesForViewSegmentNumbers>& symmetries_ptr,
239 const bool make_num_tangential_poss_odd =
false,
240 const int timing_pos = 0)
const;
244 virtual void fill(
const float value);
276 template <
typename iterT>
290 for (
auto seg_iter = segment.begin_all(); seg_iter != segment.end_all();
292 *seg_iter++ = *array_iter++;
309 template <
typename iterT>
319 array_iter = std::copy(segment.begin_all_const(), segment.end_all_const(), array_iter);
329 inline int get_num_sinograms()
const;
334 inline int get_num_non_tof_sinograms()
const;
336 inline std::size_t size_all()
const;
338 inline std::vector<int> get_original_view_nums()
const;
346 virtual float sum()
const;
349 virtual float find_max()
const;
352 virtual float find_min()
const;
355 virtual double norm()
const;
361 virtual self_type& operator+=(
const self_type& v);
364 virtual self_type& operator-=(
const self_type& v);
367 virtual self_type& operator*=(
const self_type& v);
370 virtual self_type& operator/=(
const self_type& v);
373 virtual self_type& operator+=(
const float v);
376 virtual self_type& operator-=(
const float v);
379 virtual self_type& operator*=(
const float v);
382 virtual self_type& operator/=(
const float v);
388 virtual void xapyb(
const ProjData& x,
const float a,
const ProjData& y,
const float b);
394 virtual void sapyb(
const float a,
const ProjData& y,
const float b);
defines the stir::Array class for multi-dimensional (numeric) arrays
declaration of stir::DataWithProjDataInfo
declaration of stir::ExamData
Declaration of class stir::ProjDataInfo.
Implementations for inline functions of class stir::ProjData.
Declaration of class stir::SegmentBySinogram.
Declaration of class stir::SegmentByView.
Definition of class stir::SegmentIndices.
Definition of class stir::SinogramIndices.
Declaration of class stir::Succeeded.
Definition of class stir::ViewgramIndices.
virtual shared_ptr< const ProjDataInfo > get_proj_data_info_sptr() const
Get shared pointer to ProjData info.
Definition DataWithProjDataInfo.cxx:37
int get_min_tof_pos_num() const
Get the index of the first timing position.
Definition DataWithProjDataInfo.inl:105
DataWithProjDataInfo()
Default constructor sets internal member to 0.
Definition DataWithProjDataInfo.cxx:20
ExamData()
ExamData.
Definition ExamData.cxx:21
An (abstract base) class that contains information on the projection data.
Definition ProjDataInfo.h:70
The (abstract) base class for the projection data.
Definition ProjData.h:105
Viewgram< float > get_empty_viewgram(const ViewgramIndices &) const
Get empty viewgram.
Definition ProjData.cxx:189
virtual SegmentByView< float > get_segment_by_view(const int segment_num, const int timing_pos=0) const
Get segment by view.
Definition ProjData.cxx:329
SegmentBySinogram< float > get_empty_segment_by_sinogram(const SegmentIndices &) const
Get empty segment by sino.
Definition ProjData.cxx:233
virtual SegmentBySinogram< float > get_segment_by_sinogram(const int segment_num, const int timing_pos=0) const
Get segment by sinogram.
Definition ProjData.cxx:319
Sinogram< float > get_empty_sinogram(const SinogramIndices &) const
Get empty_sinogram.
Definition ProjData.cxx:195
SegmentByView< float > get_empty_segment_by_view(const SegmentIndices &) const
Get empty segment by view.
Definition ProjData.cxx:239
virtual Succeeded set_sinogram(const Sinogram< float > &)=0
Set sinogram.
virtual Succeeded set_related_viewgrams(const RelatedViewgrams< float > &viewgrams)
Set related viewgrams.
Definition ProjData.cxx:295
virtual RelatedViewgrams< float > get_related_viewgrams(const ViewgramIndices &, const shared_ptr< DataSymmetriesForViewSegmentNumbers > &, const bool make_num_tangential_poss_odd=false, const int timing_pos=0) const
Get related viewgrams.
Definition ProjData.cxx:256
iterT copy_to(iterT array_iter) const
Copy all bins to a range specified by a (forward) iterator.
Definition ProjData.h:310
unique_ptr< ProjDataInMemory > get_subset(const std::vector< int > &views) const
construct projection data that stores a subset of the views
Definition ProjData.cxx:166
iterT fill_from(iterT array_iter)
set all bins from an array iterator
Definition ProjData.h:277
virtual Succeeded set_segment(const SegmentBySinogram< float > &)
Set segment by sinogram.
Definition ProjData.cxx:339
virtual Succeeded set_viewgram(const Viewgram< float > &)=0
Set viewgram.
RelatedViewgrams< float > get_empty_related_viewgrams(const ViewgramIndices &viewgram_indices, const shared_ptr< DataSymmetriesForViewSegmentNumbers > &symmetries_ptr, const bool make_num_tangential_poss_odd=false, const int timing_pos=0) const
Get empty related viewgrams, where the symmetries_ptr specifies the symmetries to use.
Definition ProjData.cxx:245
virtual void fill(const float value)
set all bins to the same value
Definition ProjData.cxx:361
virtual Viewgram< float > get_viewgram(const int view, const int segment_num, const bool make_num_tangential_poss_odd=false, const int timing_pos=0) const =0
Get viewgram.
static shared_ptr< ProjData > read_from_file(const std::string &filename, const std::ios::openmode open_mode=std::ios::in)
A static member to get the projection data from a file.
Definition ProjData.cxx:89
virtual Sinogram< float > get_sinogram(const int ax_pos_num, const int segment_num, const bool make_num_tangential_poss_odd=false, const int timing_pos=0) const =0
Get sinogram.
ProjData()
Empty constructor.
Definition ProjData.cxx:394
static std::vector< int > standard_segment_sequence(const ProjDataInfo &pdi)
Return a vector with segment numbers in a standard order.
Definition ProjData.cxx:641
A class for storing (3d) projection data with fixed SegmentIndices.
Definition SegmentBySinogram.h:51
A class for storing (3d) projection data with fixed SegmentIndices.
Definition SegmentByView.h:52
A very simple class to store segment numbers and any other indices that define a segment.
Definition SegmentIndices.h:34
A very simple class to store all dincies to get a (2D) Sinogram.
Definition SinogramIndices.h:34
A class for 2d projection data.
Definition Sinogram.h:47
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition Succeeded.h:44
A very simple class to store all dincies to get a (2D) Viewgram.
Definition ViewgramIndices.h:33
A class for 2d projection data.
Definition Viewgram.h:49
#define STIR_DEPRECATED
Deprecation macro.
Definition deprecated.h:21
double norm(const BasicCoordinate< num_dimensions, coordT > &p1)
compute sqrt(inner_product(p1,p1))
Definition BasicCoordinate.inl:426
double norm_squared(const BasicCoordinate< num_dimensions, coordT > &p1)
compute (inner_product(p1,p1))
Definition BasicCoordinate.inl:415
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:46
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
Import of std::shared_ptr, std::dynamic_pointer_cast and std::static_pointer_cast into the stir names...