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

stir.AcquisitionData.get_subset() fails on get_output() of ListmodeToSinograms, even with stir.AcquisitionData.set_storage_scheme("memory") #1217

Open
epapoutsellis opened this issue Oct 25, 2023 · 5 comments
Assignees
Labels
STIR this is STIR issue
Milestone

Comments

@epapoutsellis
Copy link
Contributor

I would like to perform stochastic optimisation using CIL for the NEMA dataset. I use this notebook.

If I run acq_data.get_subset(i) then I get this error

ERROR: write_basic_interfile_PDFS_header: Error casting the projdata to one of its geometries: Cylindrical/BlocksOnCylindrical/Genreic
@KrisThielemans
Copy link
Member

I think this is the known problem that we cannot write subset-data yet. UCL/STIR#1003

I also think in the past we solved this by setting stir.AcquisitionData.set_storage_scheme("memory") (before getting the subset)?

@KrisThielemans
Copy link
Member

Cause:

std::unique_ptr<STIRAcquisitionData>
STIRAcquisitionDataInFile::get_subset(const std::vector<int>& views) const
{
auto ptr_ad = new STIRAcquisitionDataInFile(std::move(_data->get_subset(views)));
// auto ptr_ad = new STIRAcquisitionDataInMemory(std::move(_data->get_subset(views)));

but this currently fails as STIR cannot write subset data yet.

@KrisThielemans KrisThielemans added this to the 3.5.1 milestone Oct 26, 2023
@evgueni-ovtchinnikov
Copy link
Contributor

@epapoutsellis have you tried storing acquisitions in memory as Kris suggested:

I also think in the past we solved this by setting stir.AcquisitionData.set_storage_scheme("memory") (before getting the subset)?

@evgueni-ovtchinnikov evgueni-ovtchinnikov modified the milestones: 3.5.1, v3.6 Nov 9, 2023
@KrisThielemans
Copy link
Member

@epapoutsellis I think this was resolved as above? I cannot quite remember...

@KrisThielemans KrisThielemans changed the title NEMA Dataset and subsets stir.AcquisitionData.get_subset() currently needs stir.AcquisitionData.set_storage_scheme("memory") Feb 1, 2024
@KrisThielemans KrisThielemans modified the milestones: v3.6, v4.0 Feb 1, 2024
@KrisThielemans KrisThielemans added the STIR this is STIR issue label Feb 1, 2024
@KrisThielemans
Copy link
Member

Setting to memory does not help when using ListmodeToSinograms.get_output(). Current work-around is to create stir.AcquisitionData from the corresponding file.

@KrisThielemans KrisThielemans changed the title stir.AcquisitionData.get_subset() currently needs stir.AcquisitionData.set_storage_scheme("memory") stir.AcquisitionData.get_subset() fails on get_output() of ListmodeToSinograms, even with currently needs stir.AcquisitionData.set_storage_scheme("memory") Feb 1, 2024
@KrisThielemans KrisThielemans changed the title stir.AcquisitionData.get_subset() fails on get_output() of ListmodeToSinograms, even with currently needs stir.AcquisitionData.set_storage_scheme("memory") stir.AcquisitionData.get_subset() fails on get_output() of ListmodeToSinograms, even with stir.AcquisitionData.set_storage_scheme("memory") Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STIR this is STIR issue
Projects
None yet
Development

No branches or pull requests

3 participants