-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RuntimeError: Unable to convert the Pixel Data as the 'pylibjpeg-libjpeg' plugin is not installed #58
Comments
You are aware that the message relates to the |
Yeah, I installed the two of them. |
Could you post the complete traceback that you're getting along with: import platform, sys, pydicom
print(
platform.platform(),
"\nPython", sys.version,
"\npydicom", pydicom.__version__
)
try:
import pylibjpeg
from pylibjpeg.utils import get_decoders
print(pylibjpeg.__version__, get_decoders())
except ImportError:
print("pylibjpeg not found")
try:
import libjpeg
print(libjpeg.__version__)
except ImportError:
print("libjpeg not found") |
This is the terminal output: Linux-5.0.0-37-generic-x86_64-with-Ubuntu-18.04-bionic |
Hmm, weird. libjpeg is available to Python but not to pylibjpeg. Could you try the following on this file: from libjpeg import decode
with open("A1.JPG", "rb") as f:
arr = decode(f.read())
print(arr) Oh, also could you upgrade to v1.1.0 of the pylibjpeg-libjpeg plugin too? I think I refactored how the plugins work in pylibjpeg between v1.0 and v1.1, which might be the cause. |
from libjpeg import decode
with open("A1.JPG", "rb") as f:
arr = decode(f.read())
print(arr) For this, it worked without any problem because it was a jpeg image, then I tried to upgrade the pylibjpeg it was already upgraded and I run the program again, always the same problem Here is the program that I am trying to run, (the error is in the line pixel_array. import pydicom
import pylibjpeg
im = pydicom.dcmread('dcm_image_for_test.dcm')
arr = im.pixel_array` The error:
|
Right, like I said, because the version of the -libjpeg plugin is v1.0.0 then it won't be available to pylibjpeg. Could you post the output of the following:
|
This is the output:
Then I installed the version 1.1 of pylibjpeg and it was successfully installed, but when I run the program again, I obtained another problem now:
Knowing that I am always using this program:
The problem began from the line 3. |
You didn't post the -v output for pip so I don't really understand why the newest version wasn't installed. Could you try (for Python 3.6) and post the full output please:
Note the |
Here is the output:
|
I don't know what to tell you The following works fine for me on Ubuntu 18.04.1, Python 3.6.7 (note this with the newest releases):
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pylibjpeg.utils import get_decoders
>>> get_decoders()
{'libjpeg': <function decode at 0x7f0835bf1488>, 'openjpeg': <function decode at 0x7f0835bf1b70>}
>>> This also works fine:
>>> import libjpeg
>>> libjpeg.__version__
'1.1.0' |
Actually that was the whole output: |
Could you upgrade pip and try again? Are you running on some weird architecture or something? Hmm, no its x86_64 from what you posted earlier. |
I upgraded pip and I run it again, here is the output (I think that the version 1.1 has been successfully installed)
Than I run the program to open a dicom image, so I have got this error:
|
Upgrade pylibjpeg as well: Also, with pydicom v2.1+ you don't need to |
Now it is working perfectly, thank you for your great answers! |
No problem! |
Can someone take a look at my Kaggle that's seeing the same issue and give me some tips: https://www.kaggle.com/jonathoncwik/pylibjpeg-libjpeg-plugin-install-error |
I'm not familiar with Kaggle, but in the output I don't see any errors related to |
Hi all,
I am trying to work with dicom images, at first I had a problem saying 'gdcm' so I knew that the problem was about the compressed pixels in the image then after installing all the packages I have now this problem, knowing that I installed the pylibjpeg.
Can you help me with this issue please.
Thank you
The text was updated successfully, but these errors were encountered: