From: Bradley L. <blo...@ma...> - 2013-07-18 13:07:43
|
Hello, I am using swig to generate interfaces from my header files with some type map guidance. For our swig generation of python binding I am passing the "-keyword" argument. I have some overloaded procedural methods[1] like the following: Image Resample ( const Image& image1, Transform transform = itk::simple::Transform(), InterpolatorEnum interpolator = itk::simple::sitkLinear, double defaultPixelValue = 0.0 ); Image Resample ( const Image& image1, const Image& referenceImage, Transform transform = itk::simple::Transform(), InterpolatorEnum interpolator = itk::simple::sitkLinear, double defaultPixelValue = 0.0 ); .... I can't use keyword arguments with these methods. Here is what I get: In [1]: import SimpleITK as sitk In [2]: img = sitk.Image() In [3]: sitk.Resample(img, defaultPixelValue=1) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-3-8a2b278d5bba> in <module>() ----> 1 sitk.Resample(img, defaultPixelValue=1) TypeError: Resample() got an unexpected keyword argument 'defaultPixelValue' Is this a bug or a missing feature? I very much would like this ability. we have a number of procedural methods with a large number of parameters which are going to be overloaded. I am quite lazy when in python, so this is too many default parameters to have to specify. Thanks, Brad [1] https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/include/sitkAdditionalProcedures.h#L45 |