|
STIR 6.4.0
|
The (abstract) base class for the projection data. More...
#include "stir/ProjData.h"

Public Member Functions | |
| ProjData () | |
| Empty constructor. | |
| ProjData (const shared_ptr< const ExamInfo > &exam_info_sptr, const shared_ptr< const ProjDataInfo > &proj_data_info_ptr) | |
| construct by specifying info. Data will be undefined. | |
| 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. | |
| Viewgram< float > | get_viewgram (const ViewgramIndices &) const |
| Get viewgram. | |
| virtual Succeeded | set_viewgram (const Viewgram< float > &)=0 |
| Set viewgram. | |
| 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. | |
| Sinogram< float > | get_sinogram (const SinogramIndices &) const |
| Get sinogram. | |
| virtual Succeeded | set_sinogram (const Sinogram< float > &)=0 |
| Set sinogram. | |
| unique_ptr< ProjDataInMemory > | get_subset (const std::vector< int > &views) const |
| construct projection data that stores a subset of the views | |
| Viewgram< float > | get_empty_viewgram (const ViewgramIndices &) const |
| Get empty viewgram. | |
| Viewgram< float > | get_empty_viewgram (const int view, const int segment_num, const bool make_num_tangential_poss_odd=false, const int timing_pos=0) const |
| Get empty viewgram. | |
| Sinogram< float > | get_empty_sinogram (const SinogramIndices &) const |
| Get empty_sinogram. | |
| Sinogram< float > | get_empty_sinogram (const int ax_pos_num, const int segment_num, const bool make_num_tangential_poss_odd=false, const int timing_pos=0) const |
| Get empty_sinogram. | |
| SegmentByView< float > | get_empty_segment_by_view (const SegmentIndices &) const |
| Get empty segment by view. | |
| SegmentBySinogram< float > | get_empty_segment_by_sinogram (const SegmentIndices &) const |
| Get empty segment by sino. | |
| SegmentByView< float > | get_empty_segment_by_view (const int segment_num, const bool make_num_tangential_poss_odd=false, const int timing_pos=0) const |
| Get empty segment view. | |
| SegmentBySinogram< float > | get_empty_segment_by_sinogram (const int segment_num, const bool make_num_tangential_poss_odd=false, const int timing_pos=0) const |
| Get empty segment sino. | |
| virtual SegmentBySinogram< float > | get_segment_by_sinogram (const int segment_num, const int timing_pos=0) const |
| Get segment by sinogram. | |
| SegmentBySinogram< float > | get_segment_by_sinogram (const SegmentIndices &) const |
| Get segment by sinogram. | |
| virtual SegmentByView< float > | get_segment_by_view (const int segment_num, const int timing_pos=0) const |
| Get segment by view. | |
| SegmentByView< float > | get_segment_by_view (const SegmentIndices &) const |
| Get segment by view. | |
| virtual Succeeded | set_segment (const SegmentBySinogram< float > &) |
| Set segment by sinogram. | |
| virtual Succeeded | set_segment (const SegmentByView< float > &) |
| Set segment by view. | |
| 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. | |
| virtual Succeeded | set_related_viewgrams (const RelatedViewgrams< float > &viewgrams) |
| Set related viewgrams. | |
| 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. | |
| virtual void | fill (const float value) |
| set all bins to the same value | |
| virtual void | fill (const ProjData &) |
| set all bins from another ProjData object | |
| template<typename iterT> | |
| iterT | fill_from (iterT array_iter) |
| set all bins from an array iterator | |
| template<typename iterT> | |
| iterT | copy_to (iterT array_iter) const |
| Copy all bins to a range specified by a (forward) iterator. | |
| int | get_num_sinograms () const |
| Get the total number of sinograms. | |
| int | get_num_non_tof_sinograms () const |
| Get the number of non-tof sinograms. | |
| std::size_t | size_all () const |
| Get the total size of the data. | |
| std::vector< int > | get_original_view_nums () const |
| forward ProjDataInfo::get_original_view_nums() | |
| Succeeded | write_to_file (const std::string &filename) const |
| writes data to a file in Interfile format | |
arithmetic operations | |
return sum of all elements | |
| virtual float | sum () const |
| virtual float | find_max () const |
| return maximum value of all elements | |
| virtual float | find_min () const |
| return minimum value of all elements | |
| virtual double | norm () const |
| return L2-norm (sqrt of sum of squares) | |
| virtual double | norm_squared () const |
| return L2-norm squared (sum of squares) | |
| virtual self_type & | operator+= (const self_type &v) |
adding elements of v to the current data | |
| virtual self_type & | operator-= (const self_type &v) |
subtracting elements of v from the current data | |
| virtual self_type & | operator*= (const self_type &v) |
multiplying elements of the current data with elements of v | |
| virtual self_type & | operator/= (const self_type &v) |
dividing all elements of the current data by elements of v | |
| virtual self_type & | operator+= (const float v) |
adding an float to the elements of the current data | |
| virtual self_type & | operator-= (const float v) |
subtracting an float from the elements of the current data | |
| virtual self_type & | operator*= (const float v) |
multiplying the elements of the current data with an float | |
| virtual self_type & | operator/= (const float v) |
dividing the elements of the current data by an float | |
| virtual STIR_DEPRECATED void | axpby (const float a, const ProjData &x, const float b, const ProjData &y) |
| virtual void | xapyb (const ProjData &x, const float a, const ProjData &y, const float b) |
| set values of the array to x*a+y*b, where a and b are scalar, and x and y are ProjData | |
| virtual void | xapyb (const ProjData &x, const ProjData &a, const ProjData &y, const ProjData &b) |
| set values of the array to x*a+y*b, where a, b, x and y are ProjData | |
| virtual void | sapyb (const float a, const ProjData &y, const float b) |
| set values of the array to self*a+y*b where a and b are scalar, y is ProjData | |
| virtual void | sapyb (const ProjData &a, const ProjData &y, const ProjData &b) |
| set values of the array to self*a+y*b where a, b and y are ProjData | |
Public Member Functions inherited from stir::ExamData | |
| ExamData () | |
| ExamData. | |
| ExamData (const shared_ptr< const ExamInfo > &_this_exam) | |
| virtual const ExamInfo & | get_exam_info () const |
| virtual shared_ptr< const ExamInfo > | get_exam_info_sptr () const |
| Get shared pointer to exam info. | |
| virtual void | set_exam_info (ExamInfo const &) |
| change exam info | |
| void | set_exam_info_sptr (shared_ptr< const ExamInfo > new_exam_info_sptr) |
Public Member Functions inherited from stir::DataWithProjDataInfo | |
| DataWithProjDataInfo () | |
| Default constructor sets internal member to 0. | |
| DataWithProjDataInfo (const shared_ptr< const ProjDataInfo > &proj_data_info_sptr_v) | |
| virtual const ProjDataInfo & | get_proj_data_info () const |
| virtual shared_ptr< const ProjDataInfo > | get_proj_data_info_sptr () const |
| Get shared pointer to ProjData info. | |
| int | get_num_segments () const |
| Get number of segments. | |
| int | get_num_axial_poss (const int segment_num) const |
| Get number of axial positions per segment. | |
| int | get_num_views () const |
| Get number of views. | |
| int | get_num_tangential_poss () const |
| Get number of tangential positions. | |
| int | get_num_tof_poss () const |
| Get number of TOF positions. | |
| int | get_min_tof_pos_num () const |
| Get the index of the first timing position. | |
| int | get_max_tof_pos_num () const |
| Get the index of the last timing position. | |
| int | get_tof_mash_factor () const |
| Get TOG mash factor. | |
| int | get_min_segment_num () const |
| Get minimum segment number. | |
| int | get_max_segment_num () const |
| Get maximum segment number. | |
| int | get_min_axial_pos_num (const int segment_num) const |
| Get mininum axial position per segmnet. | |
| int | get_max_axial_pos_num (const int segment_num) const |
| Get maximum axial position per segment. | |
| int | get_min_view_num () const |
| Get minimum view number. | |
| int | get_max_view_num () const |
| Get maximum view number. | |
| int | get_min_tangential_pos_num () const |
| Get minimum tangential position number. | |
| int | get_max_tangential_pos_num () const |
| Get maximum tangential position number. | |
Static Public Member Functions | |
| 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. | |
| static std::vector< int > | standard_segment_sequence (const ProjDataInfo &pdi) |
| Return a vector with segment numbers in a standard order. | |
Additional Inherited Members | |
Protected Attributes inherited from stir::ExamData | |
| shared_ptr< const ExamInfo > | exam_info_sptr |
Protected Attributes inherited from stir::DataWithProjDataInfo | |
| shared_ptr< const ProjDataInfo > | proj_data_info_sptr |
The (abstract) base class for the projection data.
Projection data are supposed to be indexed by 4 coordinates (corresponding to the most general case of projection data in all directions of a 3D volume):
segment_num : indexes polar angle theta, or ring difference (segment_num==0 are the projections orthogonal to the scanner axis) view_num : indexes azimuthal angle phi axial_pos_num : indexes different positions along the scanner axis (corresponding to 'z', or different rings) tangential_pos_num : indexes different positions in a direction tangential to the scanner cylinder. (sometimes called 'bin' or 'element') timing_pos_num : indexes different positions in the LOR, based on the photon detection time difference. The number of axial positions is allowed to depend on segment_num.
Different 'subsets' of the 4D data are possible by fixing one or more of the 4 coordinates. Currently we support the following cases
This abstract class provides the general interface for accessing the projection data. This works with get_ and set_ pairs. (Generally, the 4D dataset might be too big to be kept in memory.) In addition, there are get_empty_ functions that just create the corresponding object of appropriate sizes etc. but filled with 0.
One important member of this class is get_proj_data_info_sptr() which allows access to a ProjDataInfo object, which describes the dimensions of the data, the scanner type, the geometry ...
|
static |
A static member to get the projection data from a file.
This function will attempt to determine the type of projection data in the file, construct an object of the appropriate type, and return a pointer to the object.
The return value is a shared_ptr, to make sure that the caller will delete the object.
If more than 1 projection data set is in the file, only the first is read.
When the file is not readable for some reason, the program is aborted by calling error().
Currently supported:
Developer's note: ideally the return value would be an stir::unique_ptr.
References stir::GE::RDF_HDF5::GEHDF5Wrapper::check_GE_signature(), stir::error(), stir::FileSignature::get_signature(), stir::info(), stir::ecat::ecat7::is_ECAT7_attenuation_file(), stir::ecat::ecat7::is_ECAT7_emission_file(), stir::ecat::ecat7::is_ECAT7_file(), stir::is_interfile_signature(), read_from_file(), and stir::read_interfile_PDFS().
Referenced by stir::CListModeDataSAFIR< CListRecordT >::CListModeDataSAFIR(), stir::ReconstructionTests< TargetT >::construct_input_data(), stir::AnalyticReconstruction::post_processing(), stir::FindMCNormFactors::post_processing(), stir::LmToProjData::post_processing(), stir::MoveProjData::post_processing(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< TargetT >::post_processing(), stir::ProjDataRebinning::post_processing(), stir::ScatterEstimation::post_processing(), read_from_file(), stir::ProjDataInMemory::read_from_file(), stir::DataSymmetriesForBins_PET_CartesianGridTests::run_tests(), stir::ProjMatrixByBinUsingInterpolationTests::run_tests(), stir::stir_mathTests::run_tests(), stir::TestDataProcessorProjectors::run_tests(), stir::TestProjDataInfoSubsets::run_tests(), stir::TestProjDataInfoSubsetsSPECTUB::run_tests(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjData< DiscretisedDensity< 3, float > >::set_num_subsets(), and stir::ScatterEstimation::set_up().
|
pure virtual |
Get viewgram.
Implemented in stir::ProjDataFromStream, and stir::ProjDataInMemory.
References get_viewgram().
Referenced by get_related_viewgrams(), get_segment_by_sinogram(), get_segment_by_view(), get_subset(), get_viewgram(), and get_viewgram().
Set viewgram.
Implemented in stir::ProjDataFromStream, and stir::ProjDataInMemory.
Referenced by set_related_viewgrams(), set_segment(), and set_segment().
|
pure virtual |
Get sinogram.
Implemented in stir::ProjDataFromStream, and stir::ProjDataInMemory.
References get_sinogram().
Referenced by stir::get_scale_factors_per_sinogram(), get_sinogram(), get_sinogram(), stir::inverse_SSRB(), stir::ecat::ecat6::ProjData_to_ECAT6(), stir::scale_sinograms(), and stir::SSRB().
Set sinogram.
Implemented in stir::ProjDataFromStream, and stir::ProjDataInMemory.
References fill(), get_empty_related_viewgrams(), get_empty_segment_by_sinogram(), get_empty_segment_by_view(), get_empty_sinogram(), get_empty_viewgram(), get_related_viewgrams(), get_segment_by_sinogram(), get_segment_by_view(), get_subset(), ProjData(), set_related_viewgrams(), set_segment(), and standard_segment_sequence().
Referenced by stir::inverse_SSRB(), stir::scale_sinograms(), and stir::SSRB().
| Viewgram< float > stir::ProjData::get_empty_viewgram | ( | const int | view, |
| const int | segment_num, | ||
| const bool | make_num_tangential_poss_odd = false, | ||
| const int | timing_pos = 0 ) const |
Get empty viewgram.
References get_empty_viewgram().
| Sinogram< float > stir::ProjData::get_empty_sinogram | ( | const int | ax_pos_num, |
| const int | segment_num, | ||
| const bool | make_num_tangential_poss_odd = false, | ||
| const int | timing_pos = 0 ) const |
Get empty_sinogram.
References get_empty_sinogram().
| SegmentByView< float > stir::ProjData::get_empty_segment_by_view | ( | const int | segment_num, |
| const bool | make_num_tangential_poss_odd = false, | ||
| const int | timing_pos = 0 ) const |
Get empty segment view.
References get_empty_segment_by_view().
| SegmentBySinogram< float > stir::ProjData::get_empty_segment_by_sinogram | ( | const int | segment_num, |
| const bool | make_num_tangential_poss_odd = false, | ||
| const int | timing_pos = 0 ) const |
Get empty segment sino.
References get_empty_segment_by_sinogram().
|
virtual |
Get segment by sinogram.
Reimplemented in stir::ProjDataFromStream, and stir::ProjDataInMemory.
References stir::DataWithProjDataInfo::get_max_view_num(), stir::DataWithProjDataInfo::get_min_view_num(), get_segment_by_sinogram(), get_viewgram(), and stir::SegmentBySinogram< elemT >::set_viewgram().
Referenced by copy_to(), find_max(), find_min(), get_segment_by_sinogram(), get_segment_by_sinogram(), stir::interpolate_blocks_on_cylindrical_projdata(), norm_squared(), set_sinogram(), xapyb(), and xapyb().
|
virtual |
Get segment by view.
Reimplemented in stir::ProjDataFromStream, and stir::ProjDataInMemory.
References stir::DataWithProjDataInfo::get_max_view_num(), stir::DataWithProjDataInfo::get_min_view_num(), get_segment_by_view(), get_viewgram(), and stir::SegmentByView< elemT >::set_viewgram().
Referenced by fill(), get_segment_by_view(), get_segment_by_view(), set_sinogram(), and stir::transform_3d_object().
|
virtual |
Set segment by sinogram.
Reimplemented in stir::ProjDataFromStream, and stir::ProjDataInMemory.
References stir::DataWithProjDataInfo::get_max_view_num(), stir::DataWithProjDataInfo::get_min_view_num(), stir::SegmentBySinogram< elemT >::get_viewgram(), set_segment(), and set_viewgram().
Referenced by fill(), fill(), fill_from(), stir::interpolate_blocks_on_cylindrical_projdata(), set_segment(), set_segment(), set_sinogram(), stir::transform_3d_object(), xapyb(), and xapyb().
|
virtual |
Set segment by view.
Reimplemented in stir::ProjDataFromStream, and stir::ProjDataInMemory.
References stir::DataWithProjDataInfo::get_max_view_num(), stir::DataWithProjDataInfo::get_min_view_num(), stir::SegmentByView< elemT >::get_viewgram(), set_segment(), and set_viewgram().
|
virtual |
set all bins to the same value
will call error() if setting failed
Reimplemented in stir::ProjDataInMemory.
References stir::error(), stir::Array< num_dimensions, elemT >::fill(), fill(), get_empty_segment_by_view(), stir::DataWithProjDataInfo::get_max_segment_num(), stir::DataWithProjDataInfo::get_max_tof_pos_num(), stir::DataWithProjDataInfo::get_min_segment_num(), stir::DataWithProjDataInfo::get_min_tof_pos_num(), and set_segment().
Referenced by fill(), fill(), stir::ProjDataInMemory::fill(), stir::ForwardProjectorByBin::forward_project(), set_sinogram(), stir::ScatterEstimation::upsample_and_fit_scatter_estimate(), and write_to_file().
|
virtual |
set all bins from another ProjData object
will call error() if setting failed or if the 'source' proj_data is not compatible. The current check requires at least the same segment numbers (but the source can have more), all other geometric parameters have to be the same.
Reimplemented in stir::ProjDataInMemory.
References stir::error(), fill(), stir::DataWithProjDataInfo::get_max_segment_num(), stir::DataWithProjDataInfo::get_max_tof_pos_num(), stir::DataWithProjDataInfo::get_min_segment_num(), stir::DataWithProjDataInfo::get_min_tof_pos_num(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), get_segment_by_view(), ProjData(), and set_segment().
|
static |
Return a vector with segment numbers in a standard order.
This returns a vector filled as ![$ [0, 1, -1, 2, -2, ...] $](form_58.png)
![$ [0, 1, -1, 2, 3 ] $](form_59.png)
References stir::ProjDataInfo::get_max_segment_num(), stir::ProjDataInfo::get_min_segment_num(), and stir::ProjDataInfo::get_num_segments().
Referenced by copy_to(), fill_from(), stir::ProjDataInMemory::ProjDataInMemory(), stir::ProjDataInMemory::ProjDataInMemory(), and set_sinogram().
|
inline |
set all bins from an array iterator
std::copy)Data are filled by SegmentBySinogram, with the TOF index running slowest (from - to +) and segment order given by standard_segment_sequence().
This order would be useful to fill data from a 4D array constructed as follows:
References get_empty_segment_by_sinogram(), stir::DataWithProjDataInfo::get_min_tof_pos_num(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), set_segment(), and standard_segment_sequence().
|
inline |
Copy all bins to a range specified by a (forward) iterator.
std::copy)Data are filled by SegmentBySinogram, with TOF index running slowest (from - to +) and segment order given by standard_segment_sequence().
References stir::DataWithProjDataInfo::get_min_tof_pos_num(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), get_segment_by_sinogram(), and standard_segment_sequence().
|
inline |
Get the total number of sinograms.
Note that this will count TOF sinograms as well.
References get_num_sinograms().
Referenced by get_num_sinograms().
|
inline |
Get the number of non-tof sinograms.
Note that this is the sum of the number of axial poss over all segments.
References get_num_non_tof_sinograms().
Referenced by get_num_non_tof_sinograms().
|
virtual |
return maximum value of all elements
Reimplemented in stir::ProjDataInMemory.
References stir::DataWithProjDataInfo::get_max_segment_num(), stir::DataWithProjDataInfo::get_max_tof_pos_num(), stir::DataWithProjDataInfo::get_min_segment_num(), stir::DataWithProjDataInfo::get_min_tof_pos_num(), and get_segment_by_sinogram().
|
virtual |
return minimum value of all elements
Reimplemented in stir::ProjDataInMemory.
References stir::DataWithProjDataInfo::get_max_segment_num(), stir::DataWithProjDataInfo::get_max_tof_pos_num(), stir::DataWithProjDataInfo::get_min_segment_num(), stir::DataWithProjDataInfo::get_min_tof_pos_num(), and get_segment_by_sinogram().
|
virtual |
return L2-norm (sqrt of sum of squares)
Reimplemented in stir::ProjDataInMemory.
References norm_squared().
|
virtual |
return L2-norm squared (sum of squares)
Reimplemented in stir::ProjDataInMemory.
References stir::DataWithProjDataInfo::get_max_segment_num(), stir::DataWithProjDataInfo::get_max_tof_pos_num(), stir::DataWithProjDataInfo::get_min_segment_num(), stir::DataWithProjDataInfo::get_min_tof_pos_num(), get_segment_by_sinogram(), and stir::norm_squared().
Referenced by norm().
adding elements of v to the current data
Reimplemented in stir::ProjDataInMemory.
References ProjData().
Referenced by stir::ProjDataInMemory::operator+=().
subtracting elements of v from the current data
Reimplemented in stir::ProjDataInMemory.
References ProjData().
Referenced by stir::ProjDataInMemory::operator-=().
multiplying elements of the current data with elements of v
Reimplemented in stir::ProjDataInMemory.
References ProjData().
Referenced by stir::ProjDataInMemory::operator*=().
dividing all elements of the current data by elements of v
Reimplemented in stir::ProjDataInMemory.
References ProjData().
Referenced by stir::ProjDataInMemory::operator/=().
|
virtual |
adding an float to the elements of the current data
Reimplemented in stir::ProjDataInMemory.
|
virtual |
subtracting an float from the elements of the current data
Reimplemented in stir::ProjDataInMemory.
|
virtual |
multiplying the elements of the current data with an float
Reimplemented in stir::ProjDataInMemory.
|
virtual |
dividing the elements of the current data by an float
Reimplemented in stir::ProjDataInMemory.
|
virtual |
Reimplemented in stir::ProjDataInMemory.
References ProjData(), and xapyb().
|
virtual |
set values of the array to x*a+y*b, where a and b are scalar, and x and y are ProjData
Reimplemented in stir::ProjDataInMemory.
References stir::error(), get_empty_segment_by_sinogram(), stir::DataWithProjDataInfo::get_max_segment_num(), stir::DataWithProjDataInfo::get_max_tof_pos_num(), stir::DataWithProjDataInfo::get_min_segment_num(), stir::DataWithProjDataInfo::get_min_tof_pos_num(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), get_segment_by_sinogram(), ProjData(), and set_segment().
Referenced by axpby(), sapyb(), sapyb(), stir::ProjDataInMemory::xapyb(), and stir::ProjDataInMemory::xapyb().
|
virtual |
set values of the array to x*a+y*b, where a, b, x and y are ProjData
Reimplemented in stir::ProjDataInMemory.
References stir::error(), get_empty_segment_by_sinogram(), stir::DataWithProjDataInfo::get_max_segment_num(), stir::DataWithProjDataInfo::get_max_tof_pos_num(), stir::DataWithProjDataInfo::get_min_segment_num(), stir::DataWithProjDataInfo::get_min_tof_pos_num(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), get_segment_by_sinogram(), ProjData(), and set_segment().
|
virtual |
set values of the array to self*a+y*b where a and b are scalar, y is ProjData
Reimplemented in stir::ProjDataInMemory.
References ProjData(), and xapyb().
set values of the array to self*a+y*b where a, b and y are ProjData
Reimplemented in stir::ProjDataInMemory.
References ProjData(), and xapyb().