BSpline interpolation is slower than expected for linear and nearest
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 160
- Forks
- 113
- Avg merge
- 12d 15h
- Merged PRs (30d)
- 1
Description
@robbietuk did some timings comparing BSplines with explicit linear interpolation at https://github.com/robbietuk/STIR/pull/23#issuecomment-1030293888, finding the BSplines code was slower.
I think this sits in https://github.com/UCL/STIR/blob/4e016d62805754ad6fb4e920295f6e76dde3f6ea/src/include/stir/numerics/BSplines1DRegularGrid.inl#L99-L100
for cubic BSplines, you need to look 2 samples either side, but not for linear or nearest of course.
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 with the timings in the linked PR comment, then inspect src/include/stir/numerics/BSplines1DRegularGrid.inl around lines 99-100. Compare the sample lookups used for cubic BSplines with linear and nearest interpolation, and consider the issue done when those simpler modes no longer perform unnecessary neighboring-sample work and the timings improve.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- performance
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100