|
STIR
6.3.0
|
An (abstract base) class that contains information on the projection data. More...
#include "stir/ProjDataInfo.h"

Classes | |
| struct | Float1Float2 |
| Struct which holds two floating numbers. More... | |
Public Member Functions | |
| ProjDataInfo () | |
| Construct an empty object. | |
| ProjDataInfo (const shared_ptr< Scanner > &scanner_ptr, const VectorWithOffset< int > &num_axial_pos_per_segment, const int num_views, const int num_tangential_poss) | |
| Constructor setting all relevant info for a ProjDataInfo. More... | |
| ProjDataInfo (const shared_ptr< Scanner > &scanner_ptr, const VectorWithOffset< int > &num_axial_pos_per_segment, const int num_views, const int num_tangential_poss, const int tof_mash_factor) | |
| Overloaded Contructor with TOF initialisation. | |
| virtual ProjDataInfo * | clone () const =0 |
| Standard trick for a 'virtual copy-constructor'. | |
| shared_ptr< ProjDataInfo > | create_shared_clone () const |
| Like clone() but return a shared_ptr. | |
| shared_ptr< ProjDataInfo > | create_non_tof_clone () const |
| Similar to create_shared_clone() but returns a non-tof version of ProjDataInfo setting tof mashing factor = 0. | |
| virtual | ~ProjDataInfo () |
| Destructor. | |
| bool | is_tof_data () const |
| Determine if TOF data from tof_mash_factor and num_tof_bins. | |
| virtual std::vector< int > | get_original_view_nums () const |
| Return a list of view numbers in the "original" data if subsets are used. More... | |
| virtual Bin | get_bin (const LOR< float > &, const double delta_time=0.0) const =0 |
| Find the bin in the projection data that 'contains' an LOR. More... | |
| const Scanner * | get_scanner_ptr () const |
| Get scanner pointer. | |
| shared_ptr< Scanner > | get_scanner_sptr () const |
| Get scanner shared pointer. | |
| virtual std::string | parameter_info () const |
| Return a string describing the object. | |
| void | set_bed_position_horizontal (const float bed_position_horizontal_arg) |
| Vector which holds the lower and higher boundary for each TOF position, without the application of TOF mashing, in mm, for faster access. More... | |
| float | get_bed_position_horizontal () const |
| Get horizontal bed position. | |
| void | set_bed_position_vertical (const float bed_position_vertical_arg) |
| Set vertical bed position. | |
| float | get_bed_position_vertical () const |
| Get vertical bed position. | |
| bool | has_energy_information () const |
Functions that change the data size | |
| virtual void | reduce_segment_range (const int min_segment_num, const int max_segment_num) |
| Set a new range of segment numbers. More... | |
| virtual void | set_num_views (const int num_views) |
| Set number of views (min_view_num is set to 0). More... | |
| virtual void | set_num_tangential_poss (const int num_tang_poss) |
| Set number of tangential positions. More... | |
| virtual void | set_num_axial_poss_per_segment (const VectorWithOffset< int > &num_axial_poss_per_segment) |
| Set number of axial positions per segment. More... | |
| virtual void | set_min_axial_pos_num (const int min_ax_pos_num, const int segment_num) |
| Set minimum axial position number for 1 segment. More... | |
| virtual void | set_max_axial_pos_num (const int max_ax_pos_num, const int segment_num) |
| Set maximum axial position number for 1 segment. More... | |
| virtual void | set_min_tangential_pos_num (const int min_tang_poss) |
| Set minimum tangential position number. More... | |
| virtual void | set_max_tangential_pos_num (const int max_tang_poss) |
| Set maximum tangential position number. More... | |
| virtual void | set_tof_mash_factor (const int new_num) |
| The tof mashing factor (for TOF scanners). More... | |
Functions that return info on the data size | |
| 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_tof_bin (const double delta) const |
| Get number of tof bin for a given time difference. | |
| int | get_num_tof_poss () const |
| Get number of TOF bins. | |
| 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 minimum 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. | |
| int | get_tof_mash_factor () const |
| Get TOF mash factor. | |
| int | get_min_tof_pos_num () const |
| Get the index of the first TOF position. | |
| int | get_max_tof_pos_num () const |
| Get the index of the last timgin position. | |
| int | get_num_sinograms () const |
| Get the total number of sinograms. More... | |
| int | get_num_non_tof_sinograms () const |
| Get the number of non-tof sinograms. More... | |
| std::size_t | size_all () const |
| Get the total size of the data. | |
| virtual float | get_tantheta (const Bin &) const =0 |
| Get tangent of the co-polar angle of the normal to the projection plane. More... | |
| float | get_costheta (const Bin &) const |
| Get cosine of the co-polar angle of the normal to the projection plane. More... | |
| virtual float | get_phi (const Bin &) const =0 |
| Get azimuthal angle phi of the normal to the projection plane. More... | |
| virtual float | get_t (const Bin &) const =0 |
| Get value of the (roughly) axial coordinate in the projection plane (in mm) More... | |
| virtual float | get_m (const Bin &) const |
| Return z-coordinate of the middle of the LOR (in mm) More... | |
| virtual float | get_s (const Bin &) const =0 |
| Get value of the tangential coordinate in the projection plane (in mm) More... | |
| float | get_k (const Bin &) const |
| Get value of the TOF location along the LOR (in mm) k is a line segment connecting the centers of the two detectors. | |
| double | get_tof_delta_time (const Bin &) const |
| Get the value of the TOF timing difference (in ps) | |
| virtual void | get_LOR (LORInAxialAndNoArcCorrSinogramCoordinates< float > &, const Bin &) const =0 |
| Get LOR corresponding to a given bin. More... | |
Functions that return info on the sampling in the different coordinates | |
| virtual float | get_sampling_in_t (const Bin &) const |
Get sampling distance in the t coordinate. More... | |
| virtual float | get_sampling_in_m (const Bin &) const |
Get sampling distance in the m coordinate. More... | |
| virtual float | get_sampling_in_s (const Bin &) const |
Get sampling distance in the s coordinate. More... | |
| float | get_sampling_in_k (const Bin &) const |
Get sampling distance in the k coordinate. | |
Equality of ProjDataInfo objects | |
| bool | operator== (const ProjDataInfo &proj) const |
| check equality | |
| bool | operator!= (const ProjDataInfo &proj) const |
| virtual bool | operator>= (const ProjDataInfo &proj) const |
Check if *this contains proj. More... | |
Functions that return sinograms etc (filled with 0) | |
| Viewgram< float > | get_empty_viewgram (const ViewgramIndices &) const |
| Get empty viewgram. | |
| Sinogram< float > | get_empty_sinogram (const SinogramIndices &) const |
| Get empty_sinogram. | |
| SegmentByView< float > | get_empty_segment_by_view (const SegmentIndices &) const |
| Get empty segment sino. | |
| SegmentBySinogram< float > | get_empty_segment_by_sinogram (const SegmentIndices &) const |
| Get empty segment view. | |
| Viewgram< float > | get_empty_viewgram (const int view_num, const int segment_num, const bool make_num_tangential_poss_odd=false, const int timing_pos_num=0) const |
| Get empty viewgram. More... | |
| 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_num=0) const |
| Get empty_sinogram. More... | |
| SegmentByView< float > | get_empty_segment_by_view (const int segment_num, const bool make_num_tangential_poss_odd=false, const int timing_pos_num=0) const |
| Get empty segment sino. More... | |
| SegmentBySinogram< float > | get_empty_segment_by_sinogram (const int segment_num, const bool make_num_tangential_poss_odd=false, const int timing_pos_num=0) const |
| Get empty segment view. More... | |
| RelatedViewgrams< float > | get_empty_related_viewgrams (const ViewgramIndices &, const shared_ptr< DataSymmetriesForViewSegmentNumbers > &, const bool make_num_tangential_poss_odd=false, const int timing_pos_num=0) const |
| Get empty related viewgrams, where the symmetries_ptr specifies the symmetries to use. More... | |
Static Public Member Functions | |
| static ProjDataInfo * | ask_parameters () |
| Ask for the details and return a ProjDataInfo pointer. | |
| static ProjDataInfo * | ProjDataInfoGE (const shared_ptr< Scanner > &scanner_ptr, const int max_delta, const int num_views, const int num_tangential_poss, const bool arc_corrected=true, const int tof_mash_factor=0) |
| Construct a ProjDataInfo with span=3 for segment 0, but span=1 for others. More... | |
| static ProjDataInfo * | ProjDataInfoCTI (const shared_ptr< Scanner > &scanner_ptr, const int span, const int max_delta, const int num_views, const int num_tangential_poss, const bool arc_corrected=true, const int tof_mash_factor=0) |
| Old name for construct_proj_data_info() More... | |
| static unique_ptr< ProjDataInfo > | construct_proj_data_info (const shared_ptr< Scanner > &scanner_sptr, const int span, const int max_delta, const int num_views, const int num_tangential_poss, const bool arc_corrected=true, const int tof_mash_factor=0) |
| Construct a ProjDataInfo suitable with a given span. More... | |
Public Attributes | |
| VectorWithOffset< Float1Float2 > | tof_bin_boundaries_mm |
| Vector which holds the lower and higher boundary for each TOF position in mm, for faster access. | |
| VectorWithOffset< Float1Float2 > | tof_bin_boundaries_ps |
| Vector which holds the lower and higher boundary for each TOF position in ps`, for faster access. | |
Protected Types | |
| typedef ProjDataInfo | root_type |
Protected Member Functions | |
| virtual bool | blindly_equals (const root_type *const) const =0 |
An (abstract base) class that contains information on the projection data.
This class supports a fixed horizontal and vertical bed position. Both are set to zero by default. Continuous bed motion is not supported.
| stir::ProjDataInfo::ProjDataInfo | ( | const shared_ptr< Scanner > & | scanner_ptr, |
| const VectorWithOffset< int > & | num_axial_pos_per_segment, | ||
| const int | num_views, | ||
| const int | num_tangential_poss | ||
| ) |
Constructor setting all relevant info for a ProjDataInfo.
The num_axial_pos_per_segment argument should be such that num_axial_pos_per_segment[segment_num] gives you the appropriate value for a particular segment_num
References set_num_axial_poss_per_segment(), set_num_tangential_poss(), and set_num_views().
|
static |
Construct a ProjDataInfo with span=3 for segment 0, but span=1 for others.
This function implements our old understanding of GE data. An alternative is to use construct_proj_data_info() with span=2.
References stir::error().
Referenced by ask_parameters().
|
static |
Old name for construct_proj_data_info()
References stir::error(), and stir::warning().
Referenced by ask_parameters(), construct_proj_data_info(), stir::ScatterSimulation::downsample_scanner(), and stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjDataTests::test_approximate_Hessian_concavity().
|
static |
Construct a ProjDataInfo suitable with a given span.
span is used to denote the amount of axial compression (see the STIR glossary). Higher span, more axial compression. Span 1 means no axial compression. Siemens/CTI currently uses odd span. GE scanners use a mixed case where segment 0 has span 3, while other segments have span 2. We call this span 2. As a generalisation, this function supports any even span.
\warning N.E: TOF mash factor = 1, means possible many TOF bins
References ProjDataInfoCTI().
Referenced by stir::ecat::ecat7::CListModeDataECAT< CListRecordT >::CListModeDataECAT(), stir::CListModeDataPENN::CListModeDataPENN(), stir::CListModeDataROOT::CListModeDataROOT(), stir::PoissonLogLikelihoodWithLinearModelForMeanAndProjDataTests::test_approximate_Hessian_concavity(), and stir::TestProjDataInfoSubsets::TestProjDataInfoSubsets().
|
virtual |
Set a new range of segment numbers.
This function is virtual in case a derived class needs to know the segment range changed.
Reimplemented in stir::ProjDataInfoCylindrical, and stir::ProjDataInfoSubsetByView.
References get_max_segment_num(), and get_min_segment_num().
Referenced by operator>=(), stir::ProjDataInfoSubsetByView::reduce_segment_range(), and stir::ProjDataInfoCylindrical::reduce_segment_range().
|
virtual |
Set number of views (min_view_num is set to 0).
This function is virtual in case a derived class needs to know the number of views changed.
Reimplemented in stir::ProjDataInfoCylindrical, stir::ProjDataInfoGeneric, and stir::ProjDataInfoSubsetByView.
Referenced by ProjDataInfo(), and stir::ProjDataInfoCylindrical::set_num_views().
|
virtual |
Set number of tangential positions.
This function is virtual in case a derived class needs to know the number of tangential positions changed.
Reimplemented in stir::ProjDataInfoSubsetByView.
Referenced by ProjDataInfo(), stir::ProjDataInfoSubsetByView::set_num_tangential_poss(), and stir::SSRB().
|
virtual |
Set number of axial positions per segment.
| num_axial_poss_per_segment | is a vector with the new numbers, where the index into the vector is the segment_num (i.e. it is not related to the storage order of the segments or so). |
This function is virtual in case a derived class needs to know the number of axial positions changed.
Sets min_axial_pos_per_seg to 0
Reimplemented in stir::ProjDataInfoCylindrical, and stir::ProjDataInfoSubsetByView.
References stir::VectorWithOffset< T >::get_max_index(), and stir::VectorWithOffset< T >::get_min_index().
Referenced by ProjDataInfo(), stir::ProjDataInfoSubsetByView::set_num_axial_poss_per_segment(), and stir::ProjDataInfoCylindrical::set_num_axial_poss_per_segment().
|
virtual |
Set minimum axial position number for 1 segment.
This function is virtual in case a derived class needs to know the number changed.
No checks are done on validity of the min_ax_pos_num argument
Reimplemented in stir::ProjDataInfoCylindrical, and stir::ProjDataInfoSubsetByView.
Referenced by stir::ProjDataInfoSubsetByView::set_min_axial_pos_num(), and stir::ProjDataInfoCylindrical::set_min_axial_pos_num().
|
virtual |
Set maximum axial position number for 1 segment.
This function is virtual in case a derived class needs to know the number changed.
No checks are done on validity of the max_ax_pos_num argument
Reimplemented in stir::ProjDataInfoCylindrical, and stir::ProjDataInfoSubsetByView.
Referenced by stir::ProjDataInfoSubsetByView::set_max_axial_pos_num(), and stir::ProjDataInfoCylindrical::set_max_axial_pos_num().
|
virtual |
Set minimum tangential position number.
This function is virtual in case a derived class needs to know the number changed.
Reimplemented in stir::ProjDataInfoSubsetByView.
Referenced by stir::ProjDataInfoSubsetByView::set_min_tangential_pos_num().
|
virtual |
Set maximum tangential position number.
This function is virtual in case a derived class needs to know the number changed.
Reimplemented in stir::ProjDataInfoSubsetByView.
Referenced by stir::ProjDataInfoSubsetByView::set_max_tangential_pos_num().
|
virtual |
The tof mashing factor (for TOF scanners).
Set to 0 for non-TOF
Min and Max timing position will be recalculated.
Reimplemented in stir::ProjDataInfoCylindrical.
References stir::error().
Referenced by ProjDataInfo(), and stir::ProjDataInfoCylindrical::set_tof_mash_factor().
|
inline |
Get the total number of sinograms.
Note that this will count TOF sinograms as well.
|
inline |
Get the number of non-tof sinograms.
Note that this is the sum of the number of axial poss over all segments.
|
virtual |
Return a list of view numbers in the "original" data if subsets are used.
ProjDataInfoSubsetByView can be used to construct a subset of data. It might be useful to know what the original view numbers were.
The default implementation just returns a list from min_view_num to max_view_num, but ProjDataInfoSubsetByView overrides it.
Reimplemented in stir::ProjDataInfoSubsetByView.
|
pure virtual |
Get tangent of the co-polar angle of the normal to the projection plane.
theta=0 for 'direct' planes (i.e. projection planes parallel to the scanner axis)
Implemented in stir::ProjDataInfoSubsetByView, stir::ProjDataInfoGeneric, and stir::ProjDataInfoCylindrical.
Referenced by stir::ProjMatrixByDenselUsingRayTracing::get_element().
|
inline |
Get cosine of the co-polar angle of the normal to the projection plane.
theta=0 for 'direct' planes (i.e. projection planes parallel to the scanner axis)
References stir::square().
|
pure virtual |
Get azimuthal angle phi of the normal to the projection plane.
phi=0 when the normal vector has no component along the horizontal axis
Implemented in stir::ProjDataInfoSubsetByView, stir::ProjDataInfoGeneric, and stir::ProjDataInfoCylindrical.
|
pure virtual |
Get value of the (roughly) axial coordinate in the projection plane (in mm)
t-axis is defined to be orthogonal to the s-axis (and to the vector normal to the projection plane
Implemented in stir::ProjDataInfoSubsetByView, stir::ProjDataInfoGeneric, and stir::ProjDataInfoCylindrical.
Referenced by stir::ProjMatrixByDenselUsingRayTracing::get_element().
|
inlinevirtual |
Return z-coordinate of the middle of the LOR (in mm)
The middle is defined as follows: imagine a cylinder centred around the scanner axis. The LOR will intersect the cylinder at 2 opposite ends. The middle of the LOR is exactly halfway those 2 points.
The 0 of the z-axis is chosen in the middle of the scanner.
Default implementation is equivalent to
Reimplemented in stir::ProjDataInfoSubsetByView, stir::ProjDataInfoCylindrical, and stir::ProjDataInfoGeneric.
Referenced by stir::interpolate_blocks_on_cylindrical_projdata().
|
pure virtual |
Get value of the tangential coordinate in the projection plane (in mm)
s-axis is defined to be orthogonal to the scanner axis (and to the vector normal to the projection plane
Implemented in stir::ProjDataInfoSubsetByView, stir::ProjDataInfoCylindricalNoArcCorr, stir::ProjDataInfoGenericNoArcCorr, and stir::ProjDataInfoCylindricalArcCorr.
Referenced by stir::ProjDataInfoCylindrical::get_LOR().
|
pure virtual |
Get LOR corresponding to a given bin.
Implemented in stir::ProjDataInfoSubsetByView, stir::ProjDataInfoCylindrical, and stir::ProjDataInfoGeneric.
Referenced by stir::RigidObject3DTransformation::transform_bin().
|
virtual |
Get sampling distance in the t coordinate.
For some coordinate systems, this might depend on the Bin. The default implementation computes it as
Reimplemented in stir::ProjDataInfoSubsetByView, stir::ProjDataInfoCylindrical, and stir::ProjDataInfoGeneric.
|
virtual |
Get sampling distance in the m coordinate.
For some coordinate systems, this might depend on the Bin. The default implementation computes it as
Reimplemented in stir::ProjDataInfoSubsetByView, stir::ProjDataInfoCylindrical, and stir::ProjDataInfoGeneric.
Referenced by stir::interpolate_blocks_on_cylindrical_projdata().
|
virtual |
Get sampling distance in the s coordinate.
For some coordinate systems, this might depend on the Bin. The default implementation computes it as
Reimplemented in stir::ProjDataInfoSubsetByView, and stir::ProjDataInfoCylindricalArcCorr.
Referenced by stir::ecat::ecat7::make_ECAT7_main_header().
|
pure virtual |
Find the bin in the projection data that 'contains' an LOR.
Projection data corresponds to lines, so most Lines Of Response (LORs) there is a bin in the projection data. Usually this will be the bin which has a central LOR that is 'closest' to the LOR that is passed as an argument.
If there is no such bin (e.g. the LOR does not intersect the detectors, Bin::get_bin_value() will be less than 0, otherwise it will be 1.
Implemented in stir::ProjDataInfoCylindricalNoArcCorr, stir::ProjDataInfoGenericNoArcCorr, stir::ProjDataInfoSubsetByView, and stir::ProjDataInfoCylindricalArcCorr.
Referenced by stir::CListEventSAFIR< CListRecordSAFIR< DataType > >::get_bin(), stir::ListEvent::get_bin(), and stir::RigidObject3DTransformation::transform_bin().
|
virtual |
Check if *this contains proj.
true only if the types are the same, they are equal, or the range for the TOF, segments, axial and tangential positions is at least as large.Reimplemented in stir::ProjDataInfoSubsetByView.
References clone(), get_max_axial_pos_num(), get_max_segment_num(), get_max_tangential_pos_num(), get_max_tof_pos_num(), get_min_axial_pos_num(), get_min_segment_num(), get_min_tangential_pos_num(), get_min_tof_pos_num(), get_tof_mash_factor(), and reduce_segment_range().
| Viewgram< float > stir::ProjDataInfo::get_empty_viewgram | ( | const int | view_num, |
| const int | segment_num, | ||
| const bool | make_num_tangential_poss_odd = false, |
||
| const int | timing_pos_num = 0 |
||
| ) | const |
Get empty viewgram.
References clone(), get_max_tangential_pos_num(), and get_num_tangential_poss().
| Sinogram< float > stir::ProjDataInfo::get_empty_sinogram | ( | const int | ax_pos_num, |
| const int | segment_num, | ||
| const bool | make_num_tangential_poss_odd = false, |
||
| const int | timing_pos_num = 0 |
||
| ) | const |
Get empty_sinogram.
References clone(), get_max_tangential_pos_num(), and get_num_tangential_poss().
| SegmentByView< float > stir::ProjDataInfo::get_empty_segment_by_view | ( | const int | segment_num, |
| const bool | make_num_tangential_poss_odd = false, |
||
| const int | timing_pos_num = 0 |
||
| ) | const |
Get empty segment sino.
References clone(), get_max_segment_num(), get_max_tangential_pos_num(), get_min_segment_num(), and get_num_tangential_poss().
| SegmentBySinogram< float > stir::ProjDataInfo::get_empty_segment_by_sinogram | ( | const int | segment_num, |
| const bool | make_num_tangential_poss_odd = false, |
||
| const int | timing_pos_num = 0 |
||
| ) | const |
Get empty segment view.
References clone(), get_max_segment_num(), get_max_tangential_pos_num(), get_min_segment_num(), and get_num_tangential_poss().
| RelatedViewgrams< float > stir::ProjDataInfo::get_empty_related_viewgrams | ( | const ViewgramIndices & | viewgram_indices, |
| const shared_ptr< DataSymmetriesForViewSegmentNumbers > & | symmetries_used, | ||
| const bool | make_num_tangential_poss_odd = false, |
||
| const int | timing_pos_num = 0 |
||
| ) | const |
Get empty related viewgrams, where the symmetries_ptr specifies the symmetries to use.
make_num_tangential_poss_odd has to be false
References stir::error(), and get_empty_viewgram().
|
inline |
Vector which holds the lower and higher boundary for each TOF position, without the application of TOF mashing, in mm, for faster access.
Set horizontal bed position
Referenced by stir::ProjDataInfoSubsetByView::ProjDataInfoSubsetByView().
|
protectedpure virtual |
Default implementation checks common variables. Needs to be overloaded.
Implemented in stir::ProjDataInfoCylindrical, stir::ProjDataInfoGenericNoArcCorr, and stir::ProjDataInfoSubsetByView.
References stir::VectorWithOffset< T >::begin(), stir::VectorWithOffset< T >::end(), get_bed_position_horizontal(), get_bed_position_vertical(), get_max_segment_num(), get_max_tangential_pos_num(), get_max_tof_pos_num(), get_max_view_num(), get_min_segment_num(), get_min_tangential_pos_num(), get_min_tof_pos_num(), get_min_view_num(), get_scanner_ptr(), and get_tof_mash_factor().
Referenced by stir::ProjDataInfoCylindrical::blindly_equals(), operator==(), and stir::ProjDataInfoGeneric::ProjDataInfoGeneric().
1.8.13