InsightSoftwareConsortium / InsightSoftwareConsortium/ITKElastix

Need Help: ITK ERROR: ElastixRegistrationMethod(00000187F232D140)

Open
#141 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
281
Forks
29
Avg merge
16h 28m
Merged PRs (30d)
8

Description

Dear Developers:
I am a Ph.D. candidate from Fudan University, China.
Thanks for your kind providing us with the good package: ITK-Elastix, which is very helpful for medical registration. However, I encountered some questions after the installation.
My programing environment is Anaconda+Python 3.7.12. After successful installation via the command:

"pip install itk-elastix", I met some errors when I tried to register the images via the following codes:
```py
# Import Packages
import numpy as np
import matplotlib.pyplot as plt
import itk
b0_path = r"C:\Users\yunfe\Desktop\Image Registration\b0.mha"
b800_path = r"C:\Users\yunfe\Desktop\Image Registration\b800.mha"

# Load images with itk floats (itk.F). Necessary for elastix
fixed_image = itk.imread(b0_path, itk.F)
moving_image = itk.imread(b800_path, itk.F)
parameter_object = itk.ParameterObject.New()
default_rigid_parameter_map = parameter_object.GetDefaultParameterMap('rigid')
parameter_object.AddParameterMap(default_rigid_parameter_map)
# Call registration function
result_image, result_transform_parameters = itk.elastix_registration_method(
fixed_image, moving_image,
parameter_object=parameter_object,
log_to_console=False)_
```
# The errors are as follows:
![image](https://user-images.githubusercontent.com/46222079/148947280-82037aeb-2c2b-416f-9522-e90d11295dc4.png)

When I tried with other codes:
```py
# Load Elastix Image Filter Object
elastix_object = itk.ElastixRegistrationMethod.New(fixed_image, moving_image)
# elastix_object.SetFixedImage(fixed_image)
# elastix_object.SetMovingImage(moving_image)
elastix_object.SetParameterObject(parameter_object)

# Set additional options
elastix_object.SetLogToConsole(False)

# Update filter object (required)
elastix_object.UpdateLargestPossibleRegion()

# Results of Registration
result_image = elastix_object.GetOutput()
result_transform_parameters = elastix_object.GetTransformParameterObject()
```
Similar errors also appeared:

![image](https://user-images.githubusercontent.com/46222079/148947523-9257497a-cf0c-424b-afc3-0a9171369f8b.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.