Single-precision displacement field transforms: a float32 field pays a float64 conversion today
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Domain
- backend, performance
Research direction
The issue identifies DisplacementFieldTransform wrapping and a possible Resample overload, but names no source files or tests. First inspect how SimpleITK wraps TransformBaseTemplate<double> and how sitk.Warp handles field pixel types; check the existing displacement-field tests. Done means float32 fields can be used without conversion to float64, with tests covering the supported resampling use cases.
Written by the indexing model from the issue text.
Description
SimpleITK wraps only TransformBaseTemplate<double>, so a float32 displacement field handed to DisplacementFieldTransform is converted to float64 and interleaved at that width before anything is resampled.
At the scale of registration fields this is the dominant cost of the operation. Measured on a 122-row region of a large field (SimpleITK 2.5.5): building the double-precision transform allocates 6.9 GiB and takes 5.0 s, which is 39% of everything that region costs end to end in our pipeline. The field itself is float32 on disk and float32 is plenty for the geometry.
sitk.Warp escapes because it is templated on the field's own pixel type, but it only covers the narrowest case: field grid == output grid, whole map, linear interpolation. Any composite or resampled-field use pays the float64 build.
ITK already instantiates DisplacementFieldTransform<float, N>. Exposing it (or a Resample overload accepting a sitkVectorFloat32 field directly) would halve the memory and remove the conversion for every consumer that resamples through stored fields. Happy to help test a PR if the wrapping approach is agreed on.
- Dominant language
- C++
- Stars
- 1.1k
- Forks
- 235
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 34
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from SimpleITK/SimpleITK
-
`latest` pre-release missing: Package run deleted it, then `gh release create` failed with HTTP 403Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Bug Report
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Regenerate MinMaxCurvatureFlowImageFilter 3D baselines after ITK PR #6603 (corrected threshold)Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
SimpleITK/SimpleITK#2645 · 1 comment ·
Maintainers usually reply within 1 day
-
Bug Report
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
SimpleITK/SimpleITK#2459 · 4 comments ·
Maintainers usually reply within 1 day
-
Feature Request
Difficulty 5/5 Over a week Newbie friendliness 35/100
SimpleITK/SimpleITK#2775 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in SimpleITK/SimpleITK
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LadybirdBrowser/ladybird#13809 ·
Maintainers usually reply within 1 day
-
bug module:nodes tests
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
rocketride-org/rocketride-server#3020 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
keepassxreboot/keepassxc#14010 · 1 comment ·
Maintainers usually reply within 1 day
-
a:platform-macos need triaging
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
slint-ui/slint#14746 · 2 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 88/100
Maintainers usually reply within 1 day