iterators for ProjData?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 160
- Forks
- 113
- Avg merge
- 12d 15h
- Merged PRs (30d)
- 1
Description
it'd be nice to have iterators for ProjData, certainly so for ProjDataInMemory. There is a discussion on this in https://github.com/UCL/STIR/pull/558#issuecomment-636300533
I thought this might not be too hard for ProjDataFromStream either. Unfortunately std::istream_iterator is for text, std::istreambuf_iterator is for char. We'd also need to handle byte-order and scale factors. It wouldn't help for ProjDataFromHDF5.
A basic way would be to make an iterator that does the usual get_segment trick and then forward its iterator. Slow, but portable. (Possibly NestedIterator could be used for this)
Doing this doesn't look trivial, but would simplify a lot of other code where we add ProjData etc. The danger is that we make that (even) slower.
We could decide to do this only for ProjDataInMemory, which is far easier. That will stop working for gated dynamic TOF data of course...
Suggestions welcome
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the ProjData, ProjDataInMemory, and ProjDataFromStream implementations, then review the discussion in pull request 558 and inspect whether NestedIterator applies. A complete solution would define iterator behavior for the supported ProjData types while handling byte order and scale factors without making iteration impractically slow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- data
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100