Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Error raised in AcquisitionSensitivityModel.[un]normalise methods applied to a read-only object #1299

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

evgueni-ovtchinnikov
Copy link
Contributor

Changes in this pull request

Error raised in AcquisitionSensitivityModel.[un]normalise methods if applied to a read-only object.

Testing performed

Yes

Related issues

fixes #1298

Checklist before requesting a review

  • I have performed a self-review of my code
  • I have added docstrings/doxygen in line with the guidance in the developer guide
  • I have implemented unit tests that cover any new or modified functionality
  • The code builds and runs on my machine
  • CHANGES.md has been updated with any functionality change

Contribution Notes

Please read and adhere to the contribution guidelines.

Please tick the following:

  • The content of this Pull Request (the Contribution) is intentionally submitted for inclusion in SIRF (the Work) under the terms and conditions of the Apache-2.0 License.

Copy link
Member

@KrisThielemans KrisThielemans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about the catching of a STIR error. As you saw, python just exited due to uncaught exception presumably. I'm not sure what try_calling does, but it looks like it didn't catch it.

Calling STIR functions could always get into stir.error, so I think it'd be safest to make sure we catch that somehow. Easy?

@evgueni-ovtchinnikov
Copy link
Contributor Author

So far as I can see, methods undo and apply of BinNormalisation failed when applied to data that was supposed to be read-only but did not throw an exception, otherwise this exception would be caught by try in cSTIR_applyAcquisitionSensitivityModel and reported by try_calling (which just checks the execution status recorded in the DataHandle object returned by every C-interface function, in this case by cSTIR_applyAcquisitionSensitivityModel).

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

Successfully merging this pull request may close these issues.

STIR.AcquisitionSensitivityModel.forward etc can crash python
2 participants