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
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

* SIRF/STIR
- `ScatterEstimation` has extra methods that allow setting masks for the tail-fitting
- Error raised in `AcquisitionSensitivityModel.[un]normalise` methods applied to a read-only object.



## v3.8.1
Expand Down
6 changes: 6 additions & 0 deletions src/xSTIR/pSTIR/STIR.py
Original file line number Diff line number Diff line change
Expand Up @@ -1685,6 +1685,9 @@ def normalise(self, ad):
if self.handle is None:
raise AssertionError()
assert_validity(ad, AcquisitionData)
if ad.read_only:
raise error(
'Cannot normalise a read-only object, consider using method invert instead')
try_calling(pystir.cSTIR_applyAcquisitionSensitivityModel(
self.handle, ad.handle, 'normalise'))

Expand All @@ -1697,6 +1700,9 @@ def unnormalise(self, ad):
if self.handle is None:
raise AssertionError()
assert_validity(ad, AcquisitionData)
if ad.read_only:
raise error(
'Cannot normalise a read-only object, consider using method forward instead')
try_calling(pystir.cSTIR_applyAcquisitionSensitivityModel(
self.handle, ad.handle, 'unnormalise'))

Expand Down
Loading