Repository navigation
BUG: label_image_registration ignored labels with initial_transforms=None - #954
Merged
Merged
Conversation
…None With initial_transforms=None neither branch added the label metrics, so the deformable stage used only the intensity images, and a call without intensity images failed in antsRegistration with error code 1. Treat None like 'identity': no initial transform, with the label metrics.
ntustison
approved these changes
Nov 8, 2026
Member
|
Thanks @jig-mistry |
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.
label_image_registration(..., initial_transforms=None)drops the label images. The branch for'identity'and transform files, which adds the per-label MSQ metrics, starts withThat is False for
None, so the deformable stage gets no label metrics:RuntimeError: Registration failed with error code 1.The docstring says the initial transform is used "if specified", so
Noneshould mean no initial transform, as'identity'does.This makes that branch an
else, and skips the transform-file handling forNone. Changingis not Nonetois Noneinstead would drop transform files from this branch.test_label_image_registration_without_initial_transformschecks two things:Noneand a list with a transform file pass the same label metrics to antsRegistration as'identity';Noneruns.It fails on main and passes here.