UCL / UCL/STIR

iterators for ProjData?

Open
#559 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.