Repeated DenseFieldTransform.map calls are unnecessarily slow
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 35
- Forks
- 18
- Avg merge
- 21h 48m
- Merged PRs (30d)
- 1
Description
For each call to scipy.ndimage.map_coordinates (here) , a spline filter is re-applied to the field (here). This adds substantial time to repeated mapping calls on the same field.
If we can apply the spline filter once and save the results, we can then provide the filtered field directly to map_coordinates and specify prefilter=False to avoid re-applying the filter.
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 in nitransforms/nonlinear.py at the DenseFieldTransform.map call around line 195, then inspect the surrounding transform behavior and any existing tests for repeated mapping. Confirm how scipy.ndimage.map_coordinates applies its spline filter and verify that repeated calls reuse filtered data while preserving mapping results and avoiding redundant filtering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, performance
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100