KineticParameters<N> bakes parameter count into the C++ type system, however it should be a runtime property
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 160
- Forks
- 113
- Avg merge
- 12d 15h
- Merged PRs (30d)
- 1
Description
KineticParameters<num_param, elemT> (and everything built on itParametricDiscretisedDensity<VoxelsOnCartesianGrid<KineticParameters<N,float>>>) encodes the number of kinetic parameters (2 for Patlak, 3 for generalized Patlak) as a compile-time template parameter. This makes N=2 and N=3 parametric images genuinely unrelated C++ types below ExamData.
This is terrible wherever the parameter count is only known at runtime i.e. after reading a file's header.
ProjDataInfo/ProjData face an analogous "shape only known after reading the header" problem (TOF bins, tangential/axial positions), but store that shape as data members rather than template parameters. There's exactly one concrete ProjData type regardless of a file's actual dimensions, and reading it needs no per-shape dispatch.
Investigate making the kinetic parameter count a runtime property of ParametricDiscretisedDensity/KineticParameters (e.g. a dynamically-sized container) instead of a template parameter, following the ProjDataInfo pattern.
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 tracing KineticParameters and ParametricDiscretisedDensity, then compare their type propagation below ExamData with the runtime shape handling in ProjDataInfo and ProjData. Define the affected interfaces and tests before changing the representation. Done means the parameter count is runtime data, with one concrete image type that can be read from a file header without per-count dispatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- data
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100