InsightSoftwareConsortium / InsightSoftwareConsortium/ITKElastix

MultiMetricMultiResolutionRegistration fails when SetNumberOfThreads is used

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

Description

When using `MultiMetricMultiResolutionRegistration` with the object-oriented interface and using `SetNumberOfThreads`, ITKElastix will throw a segmentation fault when setting more than one thread.

Code to test, this will result in a segmentation fault (based on the example [here](https://github.com/InsightSoftwareConsortium/ITKElastix/blob/master/examples/ITK_Example07_MultimetricMultiImageRegistration.ipynb) ).
Using python 3.7.7 and ITK-Elastix 0.14.1

```
import itk

# Import Images
fixed_image = itk.imread('data/CT_2D_head_fixed.mha', itk.F)
moving_image = itk.imread('data/CT_2D_head_moving.mha', itk.F)

parameter_object = itk.ParameterObject.New()
parameter_object.AddParameterFile('data/parameters_Bspline_Multimetric.txt')

elastix_object = itk.ElastixRegistrationMethod.New(fixed_image,moving_image)
elastix_object.SetParameterObject(parameter_object)

elastix_object.SetLogToConsole(False)

# You can set this to 1, but setting any number > 1 will result in a segmentation fault
elastix_object.SetNumberOfThreads(2)

elastix_object.UpdateLargestPossibleRegion()
result_image = elastix_object.GetOutput()
```

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.