STIR
STIR copied to clipboard
Core dump while trying to access Scanner object created for an unknown scanner
Found this issue in an code base. I can replicate the issue with a modification of using_installed_STIR
C++ example https://github.com/UCL/STIR/tree/master/examples/C%2B%2B/using_installed_STIR
Setup
Fresh STIR clone, build and install, most options like ROOT, Python, OpenMP are disabled.
$cd ${STIR_REPO}/examples/C++/using_installed_STIR
$cmake . -DSTIR_DIR=${STIR_REPO}/install/lib/cmake/STIR-6.2 # No change in output between `CMAKE_BUILD_TYPE` $configurations
$make
$./demo_create_image
This all works fine, create the expected output and test interfiles are created.
Modify the demo_create_image.cxx
file to
#include "stir/Scanner.h"
int
main()
{
std::cout << "Running demo_create_image" << std::endl;
auto stir_scanner = stir::Scanner::get_scanner_from_name("D690");
std::cout << "Constructed Scanner" << std::endl;
// Basic test to ensure accessible scanner properties
std::cout << stir_scanner->get_num_axial_blocks() << std::endl;
std::cout << "Done" << std::endl;
return EXIT_SUCCESS;
}
$ make && ./demo_create_image
Consolidate compiler generated dependencies of target demo_create_image
[100%] Built target demo_create_image
Running demo_create_image
Constructed Scanner
Floating point exception (core dumped)
It produces the Floating point exception (core dumped)
during stir_scanner->get_num_axial_blocks()
I have a setup with a windows install and I don't get this issue. I am not sure what I am missing...