Menu

#523 Python SWIG error with ImageCodec

3.0.11
closed
None
5
2022-03-24
2021-05-10
XXX
No

I've run across an issue trying to use ImageCodec::SetDimensions() in Python 3.9 on Ubuntu 20.04:

>>> import gdcm
>>> codec = gdcm.JPEG2000Codec()
>>> codec.SetDimensions((64, 64, 1))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/.../GDCM/build/bin/gdcmswig.py", line 14277, in SetDimensions
    return _gdcmswig.ImageCodec_SetDimensions(self, *args)
TypeError: Wrong number or type of arguments for overloaded function 'ImageCodec_SetDimensions'.
  Possible C/C++ prototypes are:
    gdcm::ImageCodec::SetDimensions(unsigned int const [3])
    gdcm::ImageCodec::SetDimensions(std::vector< unsigned int,std::allocator< unsigned int > > const &)

I think this is due SWIG not being able to resolve the ambiguity and I have a hackjob solution (see attached diff). I'm sure there's a better way to fix it, but I don't have enough experience with SWIG to do so.

1 Attachments

Discussion

  • Mathieu Malaterre

    • status: open --> accepted
    • assigned_to: Mathieu Malaterre
     
  • Mathieu Malaterre

    • status: accepted --> closed
    • Group: 3.1 --> 3.0.11
     
  • Mathieu Malaterre

    fixed in 20e4ce7a6

    thanks

     

Log in to post a comment.