Skip to content

Fix voxel_res propagation and function signature mismatches in slice registration pipeline#6

Merged
steelec merged 2 commits intomainfrom
copilot/fix-resolution-issues
Feb 14, 2026
Merged

Fix voxel_res propagation and function signature mismatches in slice registration pipeline#6
steelec merged 2 commits intomainfrom
copilot/fix-resolution-issues

Conversation

Copy link
Contributor

Copilot AI commented Feb 14, 2026

Resolution (voxel_res) was only propagated through the first few pipeline steps. All STAGE1, STAGE2, and groupwise template generation calls silently defaulted to 1×1×1. Additionally, convert_ants_warp_to_deformation would crash at runtime due to a signature mismatch.

slice_registration_functions.py

  • do_initial_translation_reg: Forward voxel_res and use_resolution_in_registration through to do_reg — both were accepted but silently dropped
  • convert_ants_warp_to_deformation: Add reference_image param to signature — called with 3 args from groupwise_stack_optimization but defined with 2 (TypeError at runtime)
  • groupwise_stack_optimization: Add scaling_factor and voxel_res to signature to match caller

run_slice_registration.py

  • Add voxel_res=voxel_res to all 10 generate_stack_and_template calls that were missing it (STAGE1, STAGE2, groupwise)
  • Pass voxel_res to groupwise_stack_optimization
  • Fix executor.submit() for initial translation — was executor.submit(fn(...)) (immediate call, serial) instead of executor.submit(fn, ...) (deferred, parallel):
# Before: calls fn immediately, submits return value
executor.submit(do_initial_translation_reg(sources, targets, ...))

# After: submits fn for parallel execution
executor.submit(do_initial_translation_reg, sources, targets, ...)
Original prompt

the recent changes to make the functions fine are of resolution only partly work in slice_registration_functions.py. check that all output files and stacks will have the correct set resolution and fix where necessary under both of the conditions that the user sets in run_silce_registration. there may also be errors in the running script file, so please check that the inputs and outputs match for all the steps


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

- Add missing voxel_res parameter to all generate_stack_and_template calls
  in STAGE1, STAGE2, and groupwise sections of run_slice_registration.py
- Add voxel_res parameter to groupwise_stack_optimization function signature
- Fix convert_ants_warp_to_deformation signature to accept reference_image arg
  (called with 3 args but defined with only 2)
- Fix do_initial_translation_reg to pass voxel_res and
  use_resolution_in_registration through to do_reg
- Fix executor.submit() call to properly pass function reference instead of
  calling function immediately (do_initial_translation_reg)

Co-authored-by: steelec <2734273+steelec@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix resolution issues in slice registration functions Fix voxel_res propagation and function signature mismatches in slice registration pipeline Feb 14, 2026
Copilot AI requested a review from steelec February 14, 2026 15:24
@steelec steelec marked this pull request as ready for review February 14, 2026 16:29
Copy link
Member

@steelec steelec left a comment

Choose a reason for hiding this comment

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

primarily surface level changes, should be good but will not affect current issues.

@steelec steelec merged commit 198f6de into main Feb 14, 2026
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