Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR standardizes “mapped moving image” outputs across registration CLIs/backends by introducing shared save helpers (resliced + header-only), and it tightens robreg --outliers behavior when IRLS weights are unavailable.
Changes:
- Add shared image export helpers (
save_resliced_r2r_image,save_header_mapped_image) and use them across CLIs/backends for--mapmov/--mapmovhdr. - Fix/guard
robregoutlier-map saving and make CLI output conditional on the file actually being written. - Update tests to validate linear-mode mapping behavior and output dtype, and bump project version to
0.4.0.
Reviewed changes
Copilot reviewed 18 out of 18 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
neuroreg/image/map.py |
Adds shared reslice/header-map save helpers and mode inference; updates mode normalization. |
neuroreg/image/__init__.py |
Re-exports new image helper APIs. |
neuroreg/imreg/gd.py |
Switches mapped-image export to shared save helper. |
neuroreg/imreg/powell.py |
Switches mapped-image export to shared save helper. |
neuroreg/imreg/reg_model.py |
Changes default interpolation mode to "linear" in map_image. |
neuroreg/imreg/irls.py |
Ensures first-iteration weights/mask are retained even if error becomes NaN. |
neuroreg/imreg/robreg.py |
Adds robustness checks before saving outlier maps. |
neuroreg/cli/robreg.py |
Renames mapped output flag to --mapmov, adds --mapmovhdr, and warns if outlier file not written. |
neuroreg/cli/coreg.py |
Adds --mapmov/--mapmovhdr and forwards mapped_name into backend. |
neuroreg/cli/bbreg.py |
Adds --mapmov/--mapmovhdr and writes mapped outputs using shared helpers. |
neuroreg/cli/segreg.py |
Uses shared helpers and dtype-based interpolation inference when mapping segmentations. |
tests/test_cli.py |
Adds coverage for --mapmov/--mapmovhdr behavior in robreg and coreg CLIs. |
tests/test_coreg.py |
Verifies mapped-image writes use mode="linear" via monkeypatching. |
tests/test_bbreg.py |
Adds coverage for bbreg CLI mapped outputs and expected geometry/dtype. |
tests/test_segreg.py |
Ensures mapped output from uint8 input is written as float32 in linear mode. |
tests/test_robreg.py |
Tests _save_outlier_map warning/skip behavior when weights are missing. |
tests/test_irls.py |
Adds regression test ensuring weights persist even when tracked error is NaN. |
pyproject.toml |
Bumps version to 0.4.0. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.