pydicom / pylibjpeg

A Python framework for decoding JPEG images, with a focus on supporting pydicom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pydicom version needs >= 1.4.0

jellnicy opened this issue · comments

Just a reminder, this plugin need pydicom>=1.4.0, or it won't work.

Some examples of exceptions (pydicom==1.3.0):
code:

from pydicom import dcmread
from pydicom.data import get_testdata_files
import pylibjpeg

ds = dcmread(get_testdata_files('JPEG-LL.dcm')[0])
_ = ds.pixel_array

output:

Traceback (most recent call last):
  File "test_pylibjpeg.py", line 6, in <module>
    _ = ds.pixel_array
  File "some_path\lib\site-packages\pydicom\dataset.py", line 1362, in pixel_array
    self.convert_pixel_data()
  File "some_path\lib\site-packages\pydicom\dataset.py", line 1308, in convert_pixel_data
    raise last_exception
  File "some_path\lib\site-packages\pydicom\dataset.py", line 1276, in convert_pixel_data
    arr = handler.get_pixeldata(self)
  File "some_path\lib\site-packages\pylibjpeg\pydicom\pixel_data_handler.py", line 213, in get_pixeldata
    generate_frames = generate_pixel_data_frame(ds.PixelData, nr_frames)
TypeError: generate_pixel_data_frame() takes 1 positional argument but 2 were given.

Use other usage like pylibjpeg.decode, you will get different except.

It is a simple problem, but cost me 3 hours, including test platform testing, etc.

Maybe the dependency(pydicom>=1.40) should be added to pip or doc.

Good point, thanks!

pydicom isn't a dependency though, so all I can do is add it to the documentation. Although maybe I can add a version check when adding the pixel data handler