Skip to content

Commit

Permalink
return info as string
Browse files Browse the repository at this point in the history
  • Loading branch information
richard committed Jun 4, 2020
1 parent 2892f45 commit a014c77
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
7 changes: 3 additions & 4 deletions src/xSTIR/mSTIR/+sirf/+STIR/AcquisitionData.m
Original file line number Diff line number Diff line change
Expand Up @@ -227,14 +227,13 @@ function fill(self, value)
ad = sirf.STIR.AcquisitionData(self);
ad.fill(value)
end
function print_info(self)
%Print the AcquisitionData's metadata.
function ad_info = get_info(self)
%Get the AcquisitionData's metadata.
h = calllib...
('mstir', 'mSTIR_get_ProjDataInfo', self.handle_);
sirf.Utilities.check_status([self.name ':print_info'], h);
Info = calllib('miutilities', 'mCharDataFromHandle', h);
ad_info = calllib('miutilities', 'mCharDataFromHandle', h);
sirf.Utilities.delete(h)
disp(Info)
end
end
end
2 changes: 1 addition & 1 deletion src/xSTIR/mSTIR/tests/test1.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
test.check(s)
test.check(v)
disp("Printing AcqData info")
acq_data.print_info();
disp(acq_data.get_info())

image = PET.ImageData();
image_size = [111, 111, 31];
Expand Down
6 changes: 3 additions & 3 deletions src/xSTIR/pSTIR/STIR.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -833,13 +833,13 @@ class AcquisitionData(DataContainer):
else:
out = self.get_uniform_copy(value)
return out
def print_info(self):
"""Print the AcquisitionData's metadata."""
def get_info(self):
"""Get the AcquisitionData's metadata."""
handle = pystir.cSTIR_get_ProjDataInfo(self.handle)
check_status(handle)
info = pyiutil.charDataFromHandle(handle)
pyiutil.deleteDataHandle(handle)
print(info)
return info
## print('Please enter sinogram numbers (e.g.: 0, 3-5)')
## print('(a value outside the range 0 to %d will stop this loop)' % \
## (nz - 1))
Expand Down
2 changes: 1 addition & 1 deletion src/xSTIR/pSTIR/tests/tests_one.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def test_main(rec=False, verb=False, throw=True):
test.check(s)
test.check(v)
print("Printing AcqData info")
ad.print_info()
print(ad.get_info())

filter = TruncateToCylinderProcessor()

Expand Down

0 comments on commit a014c77

Please sign in to comment.