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
.