-
Notifications
You must be signed in to change notification settings - Fork 22
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
itk.elastix_registration_method
sometimes crashes silently
#255
Comments
itk.elastix_registration_method
sometimes crashes silently on Windowsitk.elastix_registration_method
sometimes crashes silently
import itk
import numpy as np
fixed_image = itk.imread("target_image.mha")
moving_image = itk.imread("source_image.mha")
registered, parameters = itk.elastix_registration_method(fixed_image, moving_image, log_to_console=True) crashes silently for me:
The random-generated images import itk
import numpy as np
fixed_image = itk.image_from_array(np.random.rand(10,10,10).astype(np.float32))
moving_image = itk.image_from_array(np.random.rand(10,10,10).astype(np.float32))
registered, parameters = itk.elastix_registration_method(fixed_image, moving_image, log_to_console=True) probably diverged:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
Registration with
itk.ElastixRegistrationMethod
oritk.elastix_registration_method
sometimes crashes on Windows.I am having difficulty pinning down the exact cause of the issue. It appears most frequently, but not exclusively, when the image is initialized from a NumPy array. I've been able to sometimes reproduce the issue across two Windows machines, across
itk==v5.3.0
anditk==v5.4rc1
, anditk-elastix
versions0.16.0
,0.18.0
, and0.19.0
. It is unclear whether a resolution lies in ITK, Elastix, or ITKElastix.Steps to Reproduce
Replace the image source in the first ITKElastix example with a NumPy-converted image.
Or, download test images and read in with
itk.imread
: https://data.kitware.com/#user/602bd4e62fa25629b97ba6ec/folder/6525e04e43427b2e1b65cba8Expected Behavior
Registration completes without error.
Observed Behavior
The running Python process crashes. Logging to console or file shows output similar to below:
Sometimes when running within a
dask.delayed
function a Windows access violation error is printed to the console before exit:The behavior is reproducible in a standard Python console.
Platforms
Windows 10 and Windows 11
Versions
Python 3.8 and Python 3.10
itk
v5.3.0, v5.4rc1itk-elastix
0.16.0, 0.18.0, 0.19.0Additional Notes
Perhaps there is an issue with the ITK NumPy bridge rather than in ITKElastix? I could not find any obvious differences between an image read from disk and an image obtained from a NumPy array. I am able to directly access pixels in the fixed and moving images without error.
The text was updated successfully, but these errors were encountered: