|
STIR 6.4.0
|
A class which reads/writes projection data from/to memory. More...
#include "stir/ProjDataInMemory.h"

Public Types | |
iterator typedefs | |
iterator typedefs | |
| typedef Array< 1, float >::iterator | iterator |
| typedef Array< 1, float >::const_iterator | const_iterator |
| typedef Array< 1, float >::full_iterator | full_iterator |
| typedef Array< 1, float >::const_full_iterator | const_full_iterator |
Public Member Functions | |
| ProjDataInMemory (shared_ptr< const ExamInfo > const &exam_info_sptr, shared_ptr< const ProjDataInfo > const &proj_data_info_ptr, const bool initialise_with_0=true) | |
| constructor with only info, but no data | |
| ProjDataInMemory (shared_ptr< const ExamInfo > const &exam_info_sptr, shared_ptr< const ProjDataInfo > const &proj_data_info_ptr, Array< 1, float > &&buffer) | |
| constructor using externally allocated storage | |
| ProjDataInMemory (const ProjData &proj_data) | |
| constructor that copies data from another ProjData | |
| ProjDataInMemory (const ProjDataInMemory &proj_data) | |
| Copy constructor. | |
| Viewgram< float > | get_viewgram (const int view_num, const int segment_num, const bool make_num_tangential_poss_odd=false, const int timing_pos=0) const override |
| Get viewgram. | |
| Succeeded | set_viewgram (const Viewgram< float > &v) override |
| Set viewgram. | |
| 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 override |
| Get sinogram. | |
| Succeeded | set_sinogram (const Sinogram< float > &s) override |
| Set sinogram. | |
| SegmentBySinogram< float > | get_segment_by_sinogram (const int segment_num, const int timing_pos=0) const override |
| Get all sinograms for the given segment. | |
| SegmentByView< float > | get_segment_by_view (const int segment_num, const int timing_pos=0) const override |
| Get all viewgrams for the given segment. | |
| Succeeded | set_segment (const SegmentBySinogram< float > &) override |
| Set all sinograms for the given segment. | |
| Succeeded | set_segment (const SegmentByView< float > &) override |
| Set all viewgrams for the given segment. | |
| void | fill (const float value) override |
| set all bins to the same value | |
| void | fill (const ProjData &) override |
| set all bins from another ProjData object | |
| ~ProjDataInMemory () override | |
| destructor deallocates all memory the object owns | |
| float | get_bin_value (const Bin &bin) const |
| Returns a value of a bin. | |
| void | set_bin_value (const Bin &bin) |
| iterator | begin () |
| start value for iterating through all elements in the array, see iterator | |
| const_iterator | begin () const |
| start value for iterating through all elements in the (const) array, see iterator | |
| iterator | end () |
| end value for iterating through all elements in the array, see iterator | |
| const_iterator | end () const |
| end value for iterating through all elements in the (const) array, see iterator | |
| iterator | begin_all () |
| start value for iterating through all elements in the array, see iterator | |
| const_iterator | begin_all () const |
| start value for iterating through all elements in the (const) array, see iterator | |
| iterator | end_all () |
| end value for iterating through all elements in the array, see iterator | |
| const_iterator | end_all () const |
| end value for iterating through all elements in the (const) array, see iterator | |
arithmetic operations | |
return sum of all elements | |
| float | sum () const override |
| float | find_max () const override |
| return maximum value of all elements | |
| float | find_min () const override |
| return minimum value of all elements | |
| double | norm () const override |
| return L2-norm (sqrt of sum of squares) | |
| double | norm_squared () const override |
| return L2-norm squared (sum of squares) | |
| self_type | operator+ (const self_type &iv) const |
| elem by elem addition | |
| self_type | operator- (const self_type &iv) const |
| elem by elem subtraction | |
| self_type | operator* (const self_type &iv) const |
| elem by elem multiplication | |
| self_type | operator/ (const self_type &iv) const |
| elem by elem division | |
| self_type | operator+ (const float a) const |
| addition with a 'float' | |
| self_type | operator- (const float a) const |
| subtraction with a 'float' | |
| self_type | operator* (const float a) const |
| multiplication with a 'float' | |
| self_type | operator/ (const float a) const |
| division with a 'float' | |
| self_type & | operator+= (const base_type &v) override |
adding elements of v to the current data | |
| self_type & | operator-= (const base_type &v) override |
subtracting elements of v from the current data | |
| self_type & | operator*= (const base_type &v) override |
multiplying elements of the current data with elements of v | |
| self_type & | operator/= (const base_type &v) override |
dividing all elements of the current data by elements of v | |
| self_type & | operator+= (const float v) override |
adding an float to the elements of the current data | |
| self_type & | operator-= (const float v) override |
subtracting an float from the elements of the current data | |
| self_type & | operator*= (const float v) override |
multiplying the elements of the current data with an float | |
| self_type & | operator/= (const float v) override |
dividing the elements of the current data by an float | |
| STIR_DEPRECATED void | axpby (const float a, const ProjData &x, const float b, const ProjData &y) override |
| void | xapyb (const ProjData &x, const float a, const ProjData &y, const float b) override |
| set values of the array to x*a+y*b, where a and b are scalar, and x and y are ProjData. This implementation requires that x and y are ProjDataInMemory (else falls back on general method) | |
| void | xapyb (const ProjData &x, const ProjData &a, const ProjData &y, const ProjData &b) override |
| set values of the array to x*a+y*b, where a, b, x and y are ProjData. This implementation requires that a, b, x and y are ProjDataInMemory (else falls back on general method) | |
| void | sapyb (const float a, const ProjData &y, const float b) override |
| set values of the array to self*a+y*b where a and b are scalar, y is ProjData This implementation requires that a, b and y are ProjDataInMemory (else falls back on general method) | |
| void | sapyb (const ProjData &a, const ProjData &y, const ProjData &b) override |
| set values of the array to self*a+y*b where a, b and y are ProjData This implementation requires that a, b and y are ProjDataInMemory (else falls back on general method) | |
Public Member Functions inherited from stir::ProjData | |
| 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. | |
| Viewgram< float > | get_viewgram (const ViewgramIndices &) const |
| Get viewgram. | |
| Sinogram< float > | get_sinogram (const SinogramIndices &) const |
| Get 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. | |
| SegmentBySinogram< float > | get_segment_by_sinogram (const SegmentIndices &) const |
| Get segment by sinogram. | |
| SegmentByView< float > | get_segment_by_view (const SegmentIndices &) const |
| Get 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. | |
| 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 | |
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< ProjDataInMemory > | read_from_file (const std::string &filename) |
| A static member to get the projection data in memory from a file. | |
Static Public Member Functions inherited from stir::ProjData | |
| 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 |
A class which reads/writes projection data from/to memory.
Mainly useful for temporary storage of projection data.
| stir::ProjDataInMemory::ProjDataInMemory | ( | shared_ptr< const ExamInfo > const & | exam_info_sptr, |
| shared_ptr< const ProjDataInfo > const & | proj_data_info_ptr, | ||
| const bool | initialise_with_0 = true ) |
constructor with only info, but no data
| proj_data_info_ptr | object specifying all sizes etc. The ProjDataInfo object pointed to will not be modified. |
| initialise_with_0 | specifies if the data should be set to 0. If false, the data is undefined until you set it yourself. |
References stir::ProjData::ProjData(), ProjDataInMemory(), and stir::ProjData::standard_segment_sequence().
Referenced by fill(), operator*(), operator*(), operator*=(), operator+(), operator+(), operator+=(), operator-(), operator-(), operator-=(), operator/(), operator/(), operator/=(), ProjDataInMemory(), ProjDataInMemory(), ProjDataInMemory(), xapyb(), and xapyb().
| stir::ProjDataInMemory::ProjDataInMemory | ( | shared_ptr< const ExamInfo > const & | exam_info_sptr, |
| shared_ptr< const ProjDataInfo > const & | proj_data_info_ptr, | ||
| Array< 1, float > && | buffer ) |
constructor using externally allocated storage
The supplied buffer must have exactly size_all() elements for the projection-data geometry.
References stir::error(), stir::ProjData::ProjData(), and stir::ProjData::standard_segment_sequence().
|
overridevirtual |
Get viewgram.
Implements stir::ProjData.
References stir::Bin::axial_pos_num(), stir::DataWithProjDataInfo::get_max_axial_pos_num(), stir::DataWithProjDataInfo::get_max_tangential_pos_num(), stir::DataWithProjDataInfo::get_min_axial_pos_num(), stir::DataWithProjDataInfo::get_min_tangential_pos_num(), stir::DataWithProjDataInfo::get_num_tangential_poss(), and stir::Viewgram< elemT >::grow().
Set viewgram.
Implements stir::ProjData.
References stir::Bin::axial_pos_num(), stir::DataWithProjDataInfo::get_max_axial_pos_num(), stir::DataWithProjDataInfo::get_min_axial_pos_num(), stir::DataWithProjDataInfo::get_min_tangential_pos_num(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), stir::Viewgram< elemT >::get_segment_num(), stir::Viewgram< elemT >::get_timing_pos_num(), stir::Viewgram< elemT >::get_view_num(), and stir::warning().
|
overridevirtual |
Get sinogram.
Implements stir::ProjData.
References stir::DataWithProjDataInfo::get_max_tangential_pos_num(), stir::DataWithProjDataInfo::get_max_view_num(), stir::DataWithProjDataInfo::get_min_tangential_pos_num(), stir::DataWithProjDataInfo::get_min_view_num(), stir::DataWithProjDataInfo::get_num_tangential_poss(), and stir::Sinogram< elemT >::grow().
Referenced by stir::ProjDataTests::run_tests().
Set sinogram.
Implements stir::ProjData.
References stir::Sinogram< elemT >::get_axial_pos_num(), stir::DataWithProjDataInfo::get_min_tangential_pos_num(), stir::DataWithProjDataInfo::get_min_view_num(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), stir::Sinogram< elemT >::get_segment_num(), stir::Sinogram< elemT >::get_timing_pos_num(), and stir::warning().
|
overridevirtual |
Get all sinograms for the given segment.
Reimplemented from stir::ProjData.
References stir::DataWithProjDataInfo::get_min_axial_pos_num(), stir::DataWithProjDataInfo::get_min_tangential_pos_num(), and stir::DataWithProjDataInfo::get_min_view_num().
Referenced by get_segment_by_view().
|
overridevirtual |
Get all viewgrams for the given segment.
Reimplemented from stir::ProjData.
References get_segment_by_sinogram().
|
overridevirtual |
Set all sinograms for the given segment.
Reimplemented from stir::ProjData.
References stir::DataWithProjDataInfo::get_min_axial_pos_num(), stir::DataWithProjDataInfo::get_min_tangential_pos_num(), stir::DataWithProjDataInfo::get_min_view_num(), stir::DataWithProjDataInfo::get_num_tangential_poss(), stir::DataWithProjDataInfo::get_num_views(), stir::Segment< elemT >::get_segment_num(), stir::Segment< elemT >::get_timing_pos_num(), and stir::warning().
Referenced by set_segment().
|
overridevirtual |
Set all viewgrams for the given segment.
Reimplemented from stir::ProjData.
References set_segment().
|
overridevirtual |
set all bins to the same value
will call error() if setting failed
Reimplemented from stir::ProjData.
References begin_all(), and end_all().
Referenced by ProjDataInMemory().
|
overridevirtual |
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 from stir::ProjData.
References begin_all(), stir::ProjData::fill(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), stir::ProjData::ProjData(), and ProjDataInMemory().
|
overridevirtual |
Reimplemented from stir::ProjData.
|
overridevirtual |
return maximum value of all elements
Reimplemented from stir::ProjData.
|
overridevirtual |
return minimum value of all elements
Reimplemented from stir::ProjData.
|
overridevirtual |
|
overridevirtual |
return L2-norm squared (sum of squares)
Reimplemented from stir::ProjData.
References stir::norm_squared().
|
overridevirtual |
adding elements of v to the current data
Reimplemented from stir::ProjData.
References stir::ProjData::operator+=(), and ProjDataInMemory().
|
overridevirtual |
subtracting elements of v from the current data
Reimplemented from stir::ProjData.
References stir::ProjData::operator-=(), and ProjDataInMemory().
|
overridevirtual |
multiplying elements of the current data with elements of v
Reimplemented from stir::ProjData.
References stir::ProjData::operator*=(), and ProjDataInMemory().
|
overridevirtual |
dividing all elements of the current data by elements of v
Reimplemented from stir::ProjData.
References stir::ProjData::operator/=(), and ProjDataInMemory().
|
overridevirtual |
adding an float to the elements of the current data
Reimplemented from stir::ProjData.
|
overridevirtual |
subtracting an float from the elements of the current data
Reimplemented from stir::ProjData.
|
overridevirtual |
multiplying the elements of the current data with an float
Reimplemented from stir::ProjData.
|
overridevirtual |
dividing the elements of the current data by an float
Reimplemented from stir::ProjData.
|
overridevirtual |
Reimplemented from stir::ProjData.
References stir::ProjData::ProjData(), and xapyb().
|
overridevirtual |
set values of the array to x*a+y*b, where a and b are scalar, and x and y are ProjData. This implementation requires that x and y are ProjDataInMemory (else falls back on general method)
Reimplemented from stir::ProjData.
References stir::error(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), stir::ProjData::ProjData(), ProjDataInMemory(), stir::ProjData::size_all(), stir::Array< num_dimensions, elemT >::xapyb(), and stir::ProjData::xapyb().
|
overridevirtual |
set values of the array to x*a+y*b, where a, b, x and y are ProjData. This implementation requires that a, b, x and y are ProjDataInMemory (else falls back on general method)
Reimplemented from stir::ProjData.
References stir::error(), stir::DataWithProjDataInfo::get_proj_data_info_sptr(), stir::ProjData::ProjData(), ProjDataInMemory(), stir::ProjData::size_all(), stir::Array< num_dimensions, elemT >::xapyb(), and stir::ProjData::xapyb().
|
overridevirtual |
set values of the array to self*a+y*b where a and b are scalar, y is ProjData This implementation requires that a, b and y are ProjDataInMemory (else falls back on general method)
Reimplemented from stir::ProjData.
References stir::ProjData::ProjData(), and xapyb().
|
overridevirtual |
set values of the array to self*a+y*b where a, b and y are ProjData This implementation requires that a, b and y are ProjDataInMemory (else falls back on general method)
Reimplemented from stir::ProjData.
References stir::ProjData::ProjData(), and xapyb().