InsightSoftwareConsortium / InsightSoftwareConsortium/ITKElastix

Error on grid spacing

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

Description

Hello,
We are trying to register 2 3D images with ITK-Elastix with the following code
```py
# Load images in itk workspace
fixed_image = itk.imread('0N_ROI.tif')
moving_image = itk.imread('1450N_ROI.tif')

# Cast images to an elastix compatible one
fixed_image = fixed_image.astype(itk.F)
moving_image = moving_image.astype(itk.F)

#Load and set parameter file
parameter_object = itk.ParameterObject.New()
parameter_map_rigid = parameter_object.GetDefaultParameterMap('affine',1)
parameter_object.AddParameterMap(parameter_map_rigid)
parameter_map_Bspline = parameter_object.GetDefaultParameterMap('bspline',5)
parameter_object.AddParameterMap(parameter_map_Bspline)
parameter_object.SetParameter("FinalGridSpacingInPhysicalUnits", "16")
parameter_object.SetParameter("Metric1Weight","10000")
parameter_object.SetParameter("MaximumNumberOfIterations","1500")

# check the parameter object
print(parameter_object)

# Call registration function
result_image, result_transform_parameters = itk.elastix_registration_method(
fixed_image, moving_image,
parameter_object=parameter_object,
log_to_console=True,
output_directory='Res/')I`
```
I get an strange error :
Description: ITK ERROR: ParameterMapInterface(0x6018de0): ERROR: Casting entry number 0 for the parameter "GridSpacingSchedule" failed!
You tried to cast "3,952542" from std::string to d

Do you have any idea of what is happening ?

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.