STIR  6.2.0
Protected Member Functions | List of all members
stir::ProjDataInfoTests Class Reference

Test class for ProjDataInfo. More...

Inheritance diagram for stir::ProjDataInfoTests:
Inheritance graph
[legend]

Protected Member Functions

void test_generic_proj_data_info (ProjDataInfo &proj_data_info)
 
template<class TProjDataInfo >
shared_ptr< TProjDataInfo > set_blocks_projdata_info (shared_ptr< Scanner > scanner_sptr)
 
void run_coordinate_test ()
 
void run_coordinate_test_for_realistic_scanner ()
 
void run_Blocks_DOI_test ()
 
void run_lor_get_s_test ()
 
- Protected Member Functions inherited from stir::RunTests
template<class T >
bool check_if_equal_generic (const T &a, const T &b, const std::string &str)
 function that is called by some check_if_equal implementations. It just uses operator!=
 
template<class T >
bool check_if_zero_generic (T a, const std::string &str)
 function that is called by some check_if_zero implementations. It just uses operator!=
 

Additional Inherited Members

- Public Member Functions inherited from stir::RunTests
 RunTests (const double tolerance=1E-4)
 Default constructor.
 
virtual ~RunTests ()
 Destructor, outputs a diagnostic message.
 
virtual void run_tests ()=0
 Function (to be overloaded) which does the actual tests. More...
 
bool is_everything_ok () const
 Returns if all checks were fine upto now.
 
int main_return_value () const
 Handy return value for a main() function. More...
 
void set_tolerance (const double tolerance)
 Set value used in floating point comparisons (see check_* functions)
 
double get_tolerance () const
 Get value used in floating point comparisons (see check_* functions)
 
bool check (const bool, const std::string &str="")
 Tests if true, str can be used to tell what you are testing. More...
 
template<class T1 , class T2 >
bool check_if_less (T1 a, T2 b, const std::string &str="")
 check if a<b
 
bool check_if_equal (const std::string &a, const std::string &b, const std::string &str="")
 
bool check_if_equal (const double a, const double b, const std::string &str="")
 
bool check_if_equal (const short a, const short b, const std::string &str="")
 
bool check_if_equal (const unsigned short a, const unsigned short b, const std::string &str="")
 
bool check_if_equal (const int a, const int b, const std::string &str="")
 
bool check_if_equal (const unsigned int a, const unsigned int b, const std::string &str="")
 
bool check_if_equal (const long a, const long b, const std::string &str="")
 
bool check_if_equal (const unsigned long a, const unsigned long b, const std::string &str="")
 
bool check_if_equal (const Bin &a, const Bin &b, const std::string &str="")
 
template<class T >
bool check_if_equal (const DetectionPosition< T > &a, const DetectionPosition< T > &b, const std::string &str="")
 
template<class T >
bool check_if_equal (const std::complex< T > a, const std::complex< T > b, const std::string &str="")
 check equality by calling check_if_equal on real and imaginary parts
 
template<class T >
bool check_if_equal (const VectorWithOffset< T > &t1, const VectorWithOffset< T > &t2, const std::string &str="")
 check equality by comparing ranges and calling check_if_equal on all elements
 
template<class T >
bool check_if_equal (const std::vector< T > &t1, const std::vector< T > &t2, const std::string &str="")
 check equality by comparing size and calling check_if_equal on all elements
 
bool check_if_equal (const ProjDataInMemory &t1, const ProjDataInMemory &t2, const std::string &str="")
 
template<int n>
bool check_if_equal (const IndexRange< n > &t1, const IndexRange< n > &t2, const std::string &str="")
 
template<int num_dimensions, class coordT >
bool check_if_equal (const BasicCoordinate< num_dimensions, coordT > &a, const BasicCoordinate< num_dimensions, coordT > &b, const std::string &str="")
 check equality by comparing norm(a-b) with tolerance
 
bool check_if_zero (const double a, const std::string &str="")
 
bool check_if_zero (const short a, const std::string &str="")
 
bool check_if_zero (const unsigned short a, const std::string &str="")
 
bool check_if_zero (const int a, const std::string &str="")
 
bool check_if_zero (const unsigned int a, const std::string &str="")
 
bool check_if_zero (const long a, const std::string &str="")
 
bool check_if_zero (const unsigned long a, const std::string &str="")
 
template<class T >
bool check_if_zero (const VectorWithOffset< T > &t, const std::string &str="")
 use check_if_zero on all elements
 
template<int num_dimensions, class coordT >
bool check_if_zero (const BasicCoordinate< num_dimensions, coordT > &a, const std::string &str="")
 compare norm with tolerance
 
- Protected Attributes inherited from stir::RunTests
double tolerance
 tolerance for comparisons with real values
 
bool everything_ok
 variable storing current status
 

Detailed Description

Test class for ProjDataInfo.

Member Function Documentation

◆ set_blocks_projdata_info()

template<class TProjDataInfo >
shared_ptr< TProjDataInfo > stir::ProjDataInfoTests::set_blocks_projdata_info ( shared_ptr< Scanner scanner_sptr)
protected

The following is a function to allow a projdata_info blocksONCylindrical to be created from the scanner.

References stir::ProjDataInfo::get_max_tangential_pos_num(), stir::ProjDataInfo::get_min_tangential_pos_num(), and stir::ProjDataInfo::get_num_tangential_poss().

◆ run_coordinate_test()

void stir::ProjDataInfoTests::run_coordinate_test ( )
protected

The following tests the consistency of coordinates obtained with a cilindrical scanner and those of a blocks on cylindrical scanner. For this test, a scanner with 4 rings, 2 detector per block and 2 blcs per bucket is used axially. However, transaxially we have 1 crystal per block a 1 block per bucket

In this function, an extra test is performed to check that a roundtrip transformation: detector_ID->cartesian_coord_detection_pos->detector_ID provides the same as the starting point

References _PI, stir::Timer::reset(), and stir::Timer::start().

◆ run_coordinate_test_for_realistic_scanner()

void stir::ProjDataInfoTests::run_coordinate_test_for_realistic_scanner ( )
protected

The following test is similar to the above but for a scanner that has multiple rings and multiple detectors per block.

calculate the max axial tolerance, the difference between m (blocks vs cylindrical) happens when the point A is at the beginning of a transaxial bucket and the point B is in the middle of the bucket (which is the point where the radius of circle and the radius of the poligon have the biggest difference !

References _PI.

◆ run_Blocks_DOI_test()

void stir::ProjDataInfoTests::run_Blocks_DOI_test ( )
protected

The following tests that detection position is affected by the value of DOI

References stir::Timer::reset(), stir::Timer::start(), stir::Timer::stop(), and stir::Timer::value().

◆ run_lor_get_s_test()

void stir::ProjDataInfoTests::run_lor_get_s_test ( )
protected

The following tests the function get_s() for the BlockOnCylindrical case. the first test checks that all lines passing for the center provide s=0. The second test checks that parallel lines are always at the same angle phi, and that the step between consecutive lines is the same and equal to the one calculated geometrically.

References _PI.


The documentation for this class was generated from the following file: