Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MattesMutualInformationv4 throws exception when fixed image has a single value. #3680

Open
zivy opened this issue Oct 7, 2022 · 2 comments
Assignees
Labels
area:Registration Issues affecting the Registration module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances

Comments

@zivy
Copy link
Member

zivy commented Oct 7, 2022

PR #3679 provides a test illustrating the issue.

Issue originally reported here.

@zivy zivy added the type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances label Oct 7, 2022
@thewtex thewtex added the area:Registration Issues affecting the Registration module label Nov 23, 2022
@agarcia-ruiz
Copy link

Hi, I have encountered this same issue with MI metric when running antsSliceRegularizedRegistration (2D slices), but as far as I can tell, no slices have a single value? Some may have a lot of zeroes. Setting CC as metric works, also replacing zeroes with random noise works with MI too.

I got this warning first:
Warning: bad time point - too little intensity variation0 0

Then the next exception:
terminate called after throwing an instance of 'itk::ExceptionObject' what(): /home/runner/work/_temp/build/staging/include/ITK-5.3/itkImageBase.hxx:77: ITK ERROR: Image(0x55a2a1f15e30): Zero-valued spacing is not supported and may result in undefined behavior. Refusing to change spacing from [1, 1] to [0, 0]

On other cases, I got a different error message (Joint PDF summed to zero), but also fixed by the workaround above.
Many of these:
/home/runner/work/_temp/build/ITKv5/Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_svd.hxx: suspicious return value (2) from SVDC /home/runner/work/_temp/build/ITKv5/Modules/ThirdParty/VNL/src/vxl/core/vnl/algo/vnl_svd.hxx: M is 2x2 M = [ ... -nan -nan -nan -nan ]

And then:
Exception caught: itk::ExceptionObject (0x555cb90599a0) Location: "unknown" File: /home/runner/work/_temp/build/staging/include/ITK-5.3/itkMattesMutualInformationImageToImageMetricv4.hxx Line: 315 Description: ITK ERROR: MattesMutualInformationImageToImageMetricv4(0x555cbc91ee60): Joint PDF summed to zero

Just reporting I think it happens with very little intensity variation, and in case someone else is getting these exceptions, so they can try the workaround to know if that is the issue.

@orena1
Copy link

orena1 commented Apr 19, 2024

any update on this one?
Thanks

@hjmjohnson hjmjohnson added this to the ITK 6.0 Beta 1 milestone Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Registration Issues affecting the Registration module type:Bug Inconsistencies or issues which will cause an incorrect result under some or all circumstances
Projects
None yet
Development

No branches or pull requests

5 participants