Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Prior::get_value() is still float #1290

Closed
KrisThielemans opened this issue Sep 2, 2024 · 3 comments · Fixed by #1291
Closed

Prior::get_value() is still float #1290

KrisThielemans opened this issue Sep 2, 2024 · 3 comments · Fixed by #1291
Assignees

Comments

@KrisThielemans
Copy link
Member

stir::GeneralisedPrior::compute_value() calculations are using and returning double. We currently return this after casting to float

v = pyiutil.floatDataFromHandle(handle)

SIRF/src/xSTIR/cSTIR/cstir.cpp

Lines 1332 to 1333 in 1e2c5c1

float v = (float)prior.compute_value(image);
return dataHandle<float>(v);

A similar problems occured for the log-likelihood but was recently fixed.

@evgueni-ovtchinnikov
Copy link
Contributor

Is it not a STIR issue? - see recon_buildblock/GeneralisedPrior.h:

template <typename DataT>
class GeneralisedPrior : public RegisteredObject<GeneralisedPrior<DataT>>
{
public:
  inline GeneralisedPrior();

  //! compute the value of the function
  /*! For derived classes where this doesn't make sense, it's recommended to return 0.
   */
  virtual double compute_value(const DataT& current_estimate) = 0;

@KrisThielemans
Copy link
Member Author

why? STIR returns double, SIRF casts to float.

@evgueni-ovtchinnikov
Copy link
Contributor

I thought you wanted float, sorry, fixed now by #1291.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants