images spacing
(9.0, 1.8181851239729527, 1.8181851239729527)
(9.0, 1.8181851239729527, 1.8181851239729527)
(9.0, 1.8181851239729527, 1.8181851239729527)
(9.0, 1.8181851239729527, 1.8181851239729527)
images dims
(15, 149, 129)
(15, 149, 129)
(15, 149, 129)
(15, 149, 129)
A
Exception thrown in SimpleITK ImageRegistrationMethod_MetricEvaluate: /tmp/SimpleITK-build/ITK-prefix/include/ITK-5.3/itkImageBase.hxx:77:
ITK ERROR: Image(0x7fdb404b7fb0): Zero-valued spacing is not supported and may result in undefined behavior.
Refusing to change spacing from [1, 1] to [0, 0.797619]
The spacing is not zero, so I don’t get why I am getting this error… I tried to change the numberOfHistogramBins, and it did change the spacing, but only for the 2nd value, the first stayed 0.
Also, the spacing is 3D why do I get an error of 2D spacing?
I probably missing something any help will be useful.
Thanks,
Oren
The numberOfHistogramBins parameter is not the cause of the problem. I suspect there is something going on with the data, images or masks, which is causing the problem and possibly leading to an erroneous error message. From the information you provided the only thing that seems a bit unusual is that the 3D image samples are sparse along the x-axis and dense along the y and z axes, though that should not cause any problem in ITK/SimpleITK.
There is a problem with your fixed image, it is empty (all zeros) so there is likely some bug in your code processing that image prior to registration:
I know the image is all zeros, it is a top left subtile of a larger image for registration, it is all zeros as it is out of the FoV of the moving image:
I would expect that in this case it would just return a zero of inf or something like that? no?
I assume if I just add some very small noise to these ares it will be ok?
Any thoughts?