UCL / UCL/STIR

KineticParameters<N> bakes parameter count into the C++ type system, however it should be a runtime property

Open
#1,745 0 comments 0 reactions 0 assignees View on GitHub

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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.