SyneRBI / SIRF

Main repository for the CCP SynerBI software
http://www.ccpsynerbi.ac.uk
Other
58 stars 29 forks source link

GeometricalInfo::print_info output can be hidden when run from Python (or MATLAB?) #815

Closed KrisThielemans closed 3 years ago

KrisThielemans commented 3 years ago

We print to std::cout https://github.com/SyneRBI/SIRF/blob/75364cb9367da94dabca8f79cbb976fcd5eb1d3a/src/common/GeometricalInfo.cpp#L27-L31

However, when called from VS Code Python, and probably MATLAB GUI, stdout is hidden, so the function appears to do nothing.

We should therefore have a get_info() function that returns it as a string. Of course, we can let print_info() still do the same thing.

Next question is how to call that function. It should be a name that applies to all similar functions, and ideally we have it in many places. In STIR, we have parameter_info() for most classes, but I'm open to another name.

KrisThielemans commented 3 years ago

Let's make a list here with other functions (if any) with similar functionality.

evgueni-ovtchinnikov commented 3 years ago

closed by fc65521, which added MATLAB interface to get_info() (sorry, forgot to put 'fixed' in the commit message)

KrisThielemans commented 3 years ago

Great. Thanks! However, I believe print_info in Python should still be written in terms of print(get_info()) and not call the C++ version.