Re: [Gdcm2] Issue: gdcm 2.8.1 with Python
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Audrius S. <au...@to...> - 2017-07-17 14:09:41
|
Hi Mathieu,
GDCM 2.6.8 works with Python 3.x if one uses the following
numpy.frombuffer(gdcmImage.GetBuffer().encode("utf-8",
errors="surrogateescape"), dtype=...)
as extracted from the GDCM mail below.
Regards,
Audrius
_____
Re: [Gdcm2] Problem extracting pixel data from Python 3
From: Mathieu Malaterre <mathieu.malaterre@gm...> - 2017-03-20 16:47:29
That make sense. If you have time to you should instead use the patch
as described in the documentation I sent earlier:
#define SWIG_PYTHON_STRICT_BYTE_CHAR
-M
On Mon, Mar 20, 2017 at 4:56 PM, Paul Dufort <paul@...> wrote:
> Hi Mathieu,
>
> Thanks for the pointer. I have good news and bad news. The good news is
> that in Python 3.5, the pixel data can be successfully extracted using
>
> numpy.frombuffer(gdcmImage.GetBuffer().encode("utf-8",
> errors="surrogateescape"), dtype=...)
>
> The bad news is that for some reason, it is horribly inefficient. For
> example, loading a 512 MB tomosynthesis study (admittedly a big file),
> using Python 2.7 it peaks at about 1.2 GB of memory and takes about 3
> seconds. Using Python 3.5 with the fix above, it peaks at 4 GB of memory
> and takes about 60 seconds! That's unfortunately a deal-breaker for me,
> so back to Python 2.7 I go.
>
> Regards,
> Paul
>
> On Mon, Mar 20, 2017, at 03:04 AM, Mathieu Malaterre wrote:
>> Hi Paul,
>>
>> Thanks for the bug report. This seems to be a known issue in python3:
>>
>> http://www.swig.org/Doc3.0/Python.html#Python_nn77
>>
>> Please open a bug report to track the progress there.
>>
>> Thanks
______
On Mon, Jul 17, 2017, at 06:31, Mathieu Malaterre wrote:
> Hi,
>
> I do not believe GDCM ever worked with python 3.x
>
> On Sat, Jul 15, 2017 at 8:15 PM, Audrius Stundzia
> <au...@to...> wrote:
> > Hello,
> >
> > Have tried to upgrade from gdcm 2.6.8 to gdcm 2.8.1.
> > OS: Windows 10 x64.
> > Built from source using MS VS2015. Release version. Successful.
> >
> > Try to run gdcm 2.8.1 in the same version Python 3.6.1 as before
> > but received the following new error message during gdcm import.
> > _____
> >
> > in <module> import gdcm
> >
> > File "E:\Program Files\gdcm\bin\Release\gdcm.py", line 74, in <module>
> > Global.GetInstance().Prepend( os.path.dirname(__file__) + "/../../../"
> > + GDCM_INSTALL_DATA_DIR + "/XML/" )
> >
> > TypeError: must be str, not bytes
> > _____
> >
> > IDE: Spyder 3.1.4 with PythonPath to gdcm E:\Program Files\gdcm\bin\Release
> >
> > CMake 3.8.2 gave the following warning:
> >
> > CMake Deprecation Warning at C:/Program
> > Files/CMake/share/cmake-3.8/Modules/UseSWIG.cmake:226 (message):
> > SWIG_ADD_MODULE is deprecated. Use SWIG_ADD_LIBRARY instead.
> > Call Stack (most recent call first):
> > Wrapping/Python/CMakeLists.txt:93 (SWIG_ADD_MODULE)
> >
> > SWIG: 3.0.12
> >
> > Any insight would be appreciated.
> >
> > Thank you.
> >
> > Audrius
> >
> >
> > ------------------------------------------------------------------------------
> > Check out the vibrant tech community on one of the world's most
> > engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> > _______________________________________________
> > Gdcm-developers mailing list
> > Gdc...@li...
> > https://lists.sourceforge.net/lists/listinfo/gdcm-developers
> >
>
>
>
> --
> Mathieu
--
_______________________________________________
Audrius Stundzia, Ph.D.
Managing Director,
Tomographix IP Ltd.
1 Yonge Street, Suite 1801
Toronto, Ontario M5E 1W7
Canada
land 1 888 810 2225 ext 1
mobile 1 647 636 9117
email au...@to...
_______________________________________________
|