SuperElastix / SimpleElastix

Multi-lingual medical image registration library
http://simpleelastix.github.io
Apache License 2.0
507 stars 149 forks source link

A lot of console output even after turning it off #491

Open ArturRuppel opened 1 year ago

ArturRuppel commented 1 year ago

Hello,

thanks for this great tool! I have a minor issue with not being able to turn off the console outputs during registration. The function that is supposed to suppress them doesn't seem to be working for me.

Here my code snippet:

` moving_image_sitk = sitk.GetImageFromArray(moving_image) fixed_image_sitk = sitk.GetImageFromArray(fixed_image)

    parameterMap = sitk.GetDefaultParameterMap('translation')
    parameterMap['Metric'] = ["AdvancedNormalizedCorrelation"]
    parameterMap['WriteResultImage'] = ["false"]
    parameterMap['NumberOfResolutions'] = ['6']

    elastixImageFilter = sitk.ElastixImageFilter()
    elastixImageFilter.LogToConsoleOff()
    elastixImageFilter.SetFixedImage(fixed_image_sitk)
    elastixImageFilter.SetMovingImage(moving_image_sitk)
    elastixImageFilter.SetParameterMap(parameterMap)
    elastixImageFilter.Execute()`

Thanks in advance, hope that is enough information!

ArturRuppel commented 1 year ago

For some reason it started to work after changing the interpolator with this line of code:

parameterMap['ResampleInterpolator'] = ["FinalLinearInterpolator"]