STIR
6.2.0
|
Test class for subsets in ProjDataInfo. More...
Public Member Functions | |
TestProjDataInfoSubsets (const std::string &sinogram_filename) | |
Constructor that can take some input data to run the test with. | |
void | run_tests () override |
Function (to be overloaded) which does the actual tests. More... | |
void | run_tests (const std::shared_ptr< ProjData > &proj_data_sptr, const std::shared_ptr< const VoxelsOnCartesianGrid< float >> &test_image_sptr) |
void | test_split (const ProjData &proj_data) |
void | test_forward_projection_is_consistent (const shared_ptr< const VoxelsOnCartesianGrid< float >> &input_image_sptr, const shared_ptr< const ProjData > &template_sino_sptr, bool use_z_symmetries=false, bool use_other_symmetries=false, int num_subsets=10) |
void | test_forward_projection_is_consistent_with_unbalanced_subset (const shared_ptr< const VoxelsOnCartesianGrid< float >> &input_image_sptr, const shared_ptr< const ProjData > &template_sino_sptr, bool use_z_symmetries=false, bool use_other_symmetries=false, int num_subsets=10) |
void | test_forward_projection_is_consistent_with_reduced_segment_range (const shared_ptr< const VoxelsOnCartesianGrid< float >> &input_image_sptr, const shared_ptr< const ProjData > &template_sino_sptr, bool use_z_symmetries=false, bool use_other_symmetries=false, int num_subsets=10) |
void | test_back_projection_is_consistent (const shared_ptr< const ProjData > &input_sino_sptr, const shared_ptr< const VoxelsOnCartesianGrid< float >> &template_image_sptr, int num_subsets=10) |
Public Member Functions inherited from stir::RunTests | |
RunTests (const double tolerance=1E-4) | |
Default constructor. | |
virtual | ~RunTests () |
Destructor, outputs a diagnostic message. | |
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 Member Functions | |
void | check_viewgrams (const ProjData &proj_data, const ProjData &subset_proj_data, const std::vector< int > &subset_views, const std::string &str) |
ProjDataInMemory | generate_full_forward_projection (const shared_ptr< const VoxelsOnCartesianGrid< float >> &input_image_sptr, const shared_ptr< const ProjData > &template_sino_sptr, bool use_z_symmetries=false, bool use_other_symmetries=false) |
ProjDataInMemory | generate_full_forward_projection (const shared_ptr< const VoxelsOnCartesianGrid< float >> &input_image_sptr, const shared_ptr< const ProjDataInfo > &template_projdata_info_sptr, const shared_ptr< const ExamInfo > &template_examinfo_sptr, bool use_z_symmetries=false, bool use_other_symmetries=false) |
shared_ptr< VoxelsOnCartesianGrid< float > > | generate_full_back_projection (const shared_ptr< const ProjData > &input_sino_sptr, const shared_ptr< const VoxelsOnCartesianGrid< float >> &template_image_sptr, bool use_z_symmetries=false, bool use_other_symmetries=false) |
void | test_forward_projection_for_one_subset (const shared_ptr< const VoxelsOnCartesianGrid< float >> &input_image_sptr, const ProjDataInMemory &full_forward_projection, ProjData &subset_forward_projection, bool use_z_symmetries=false, bool use_other_symmetries=false) |
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!= | |
Static Protected Member Functions | |
static shared_ptr< VoxelsOnCartesianGrid< float > > | construct_test_image_data (const ProjData &template_projdata) |
static shared_ptr< ProjData > | construct_test_proj_data (bool TOF) |
static shared_ptr< ProjectorByBinPairUsingProjMatrixByBin > | construct_projector_pair (const shared_ptr< const ProjDataInfo > &template_projdatainfo_sptr, const shared_ptr< const VoxelsOnCartesianGrid< float >> &template_image_sptr, bool use_z_symmetries=false, bool use_other_symmetries=false) |
static void | fill_proj_data_with_forward_projection (const std::shared_ptr< ProjData > &proj_data_sptr, const std::shared_ptr< const VoxelsOnCartesianGrid< float >> &test_image_sptr) |
Protected Attributes | |
std::string | _sinogram_filename |
Protected Attributes inherited from stir::RunTests | |
double | tolerance |
tolerance for comparisons with real values | |
bool | everything_ok |
variable storing current status | |
Test class for subsets in ProjDataInfo.
|
overridevirtual |
Function (to be overloaded) which does the actual tests.
This function is expected to do a series of calls to check(), check_if_equal() etc.
Implements stir::RunTests.
References stir::ProjData::read_from_file().
Referenced by TestProjDataInfoSubsets().