2

Using the SWIG generated Python wrappers for gdcm:

Is there some way to pass the gdcm.ImageReader a file-like object rather than having to pass the fileName?

Currently I load a DICOM file using:

    image_reader = gdcm.ImageReader()
    image_reader.SetFileName(fname)

but I see that the image_reader also has a method SetFile which takes a gdcm::File object.

There is also a StreamImageReader which has SetStream(std::istream &inStream), but I do not know how to create a inStream acceptable object in Python.

Ideally I would be able to use the results from an open call or StringIO or BytesIO.

Alex Rothberg
  • 10,243
  • 13
  • 60
  • 120

1 Answers1

2

No this is currently not possible. This is a current limitation of the automated SWIG wrapping of the GDCM C++ API.

malat
  • 12,152
  • 13
  • 89
  • 158