Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError when setting interpolator to WindowedSincInterpolationFunction #1100

Open
vanandrew opened this issue Jul 16, 2019 · 0 comments

Comments

@vanandrew
Copy link

commented Jul 16, 2019

Description

Calling the SetInterpolator method with WindowedSincInterpolateImageFunction returns TypeError: in method 'itkResampleImageFilterIF3IF3_SetInterpolator', argument 2 of type 'itkInterpolateImageFunctionIF3D *'

Steps to Reproduce

import itk

ImageType = itk.Image[itk.F,3]
resample = itk.ResampleImageFilter[ImageType,ImageType].New()
interpolator = itk.WindowedSincInterpolateImageFunction[ImageType,3,itk.HammingWindowFunction[3]].New()
resample.SetInterpolator(interpolator)

Expected behavior

You should be able to call SetInterpolator with WindowedSincInterpolateImageFunction

Actual behavior

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
~/Projects/SimpleBrainViewer/test2.py in <module>
      5 resample = itk.ResampleImageFilter[ImageType,ImageType].New()
      6 interpolator = itk.WindowedSincInterpolateImageFunction[ImageType,3,itk.HammingWindowFunction[3]].New()
----> 7 resample.SetInterpolator(interpolator)

TypeError: in method 'itkResampleImageFilterIF3IF3_SetInterpolator', argument 2 of type 'itkInterpolateImageFunctionIF3D *'

Reproducibility

100%

Versions

itk 5.0.0.post1

Environment

Python3.6/Python3.7

Additional Information

Other interpolators work with the above code (e.g. interpolator = itk.LinearInterpolateImageFunction[ImageType,itk.D].New()), which returns as type:

In [3]: interpolator = itk.LinearInterpolateImageFunction[ImageType,itk.D].New()                                                                                                    

In [4]: interpolator                                                                                                                                                                
Out[4]: <itkLinearInterpolateImageFunctionPython.itkLinearInterpolateImageFunctionIF3D; proxy of <Swig Object of type 'itkLinearInterpolateImageFunctionIF3D *' at 0x7f106d485300> >

but interpolator = itk.WindowedSincInterpolateImageFunction[ImageType,3,itk.HammingWindowFunction[3]].New() returns as:

In [6]: interpolator = itk.WindowedSincInterpolateImageFunction[ImageType,3,itk.HammingWindowFunction[3]].New()                                                                     

In [7]: interpolator                                                                                                                                                                
Out[7]: <ITKCommonBasePython.itkObject; proxy of <Swig Object of type 'itkObject *' at 0x7f104c092ae0> >

which doesn't seem to be the correct type for SetInterpolator...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.