Skip to content

MultiMetricMultiResolutionRegistration fails when SetNumberOfThreads is used #160

@Svdvoort

Description

@Svdvoort

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 ).
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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions