ITK
ITK copied to clipboard
MattesMutualInformationv4 throws exception when fixed image has a single value.
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.
any update on this one? Thanks