nipy / nipy/nitransforms

Repeated DenseFieldTransform.map calls are unnecessarily slow

Open
#288 1 comment 0 reactions 0 assignees View on GitHub

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

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.