Skip to content

Unifies mapmov and fixes --outlier in robreg#9

Merged
m-reuter merged 6 commits intomainfrom
fixes
Apr 24, 2026
Merged

Unifies mapmov and fixes --outlier in robreg#9
m-reuter merged 6 commits intomainfrom
fixes

Conversation

@m-reuter
Copy link
Copy Markdown
Member

@m-reuter m-reuter commented Apr 23, 2026

  • unifies mapmov and maphdr in CLI
  • allows --init-lta in robreg and coreg now
  • fixes --outlier output bug in robreg

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 robreg outlier-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.

Comment thread neuroreg/image/map.py
Comment thread neuroreg/image/map.py
Comment thread neuroreg/cli/coreg.py
Comment thread neuroreg/cli/robreg.py
@m-reuter m-reuter merged commit 9c6b36a into main Apr 24, 2026
26 checks passed
@m-reuter m-reuter deleted the fixes branch April 24, 2026 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants