UCL / PETPVC

Partial Volume Correction in PET
Apache License 2.0
51 stars 14 forks source link

PETImageType::Pointer #33

Closed rijobro closed 5 years ago

rijobro commented 6 years ago

For me compilation was failing due to PETImageType::Pointer outputImage = NULL; I rectified this by simply not setting it equal to NULL, i.e.: PETImageType::Pointer outputImage; No idea if this is safe, but it meant that I could complete compilation and start using the package.

KrisThielemans commented 6 years ago

C++11 issue.see for instance http://en.cppreference.com/w/cpp/language/nullptr. Would need to check what the pointer constructor does.

bathomas commented 6 years ago

I think removing the NULL will likely cause petpvc to crash if the user requests the GTM or Labbe method (here). This could of course be handled better with a bool etc.. I'm reluctant to enforce C++11 at this time.

KrisThielemans commented 6 years ago

would need to rely on preprocessor stuff. That's tricky but possibly easier by using CMake and its C++ feature detection stuff (which I don't know).

bathomas commented 6 years ago

I wasn't thinking of anything so 'fancy'. More like:

isOutputImageReady = false;
...
outputImage = filter->GetOutput();
isOutputImageReady = true;
...
if ( isOutputImageReady ) {

}