-
Hello, I've encountered a weird issue, with getting pixel_array via dataset.pixel_array from exactly one set of datasets (other datasets works correctly). If I use it via code (aka like python code.py) then it works without issues, but if I use it via built (with pyinstaller) exe code, then it starts to work incorrectly. I tried to include hidden imports, but I don't get why exactly this dataset is not working. I tried only with Windows 11 (but it also doesn't work on Windows 10, didn't try with alternate OS like Linux or MacOS)
Steps to reproduce
from pydicom import dcmread
x = dcmread("test_1.dcm")
y = x.pixel_array Tried to use on both pydicom 2.3.0 and pydicom 2.1.2 A way for us to reproduce and troubleshoot the issue:
It's also extremely helpful if you can include one of the following:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
If you've found a solution for this, please let us know. It appears to be a pyinstaller problem (unable to find pylibjpeg-libjpeg dependency) rather than a pydicom issue, so I'm going to close the issue. But if you find there is a pydicom problem, feel free to re-open. |
Beta Was this translation helpful? Give feedback.
-
Well, I found the solution (or more like, it was found by other people). It requires pyinstaller to clone some metada things from libs, due to them being optional dependency. So in short you need to use such command
Where I've mentioned issue: pyinstaller/pyinstaller#7157 Hoping for simplier solution in the bright future. Cheers! |
Beta Was this translation helpful? Give feedback.
Well, I found the solution (or more like, it was found by other people). It requires pyinstaller to clone some metada things from libs, due to them being optional dependency.
So in short you need to use such command
pyinstaller --hiddenimport=pydicom.encoders.gdcm --hiddenimport=pydicom.encoders.pylibjpeg --hiddenimport=pylibjpeg --copy-metadata=pylibjpeg-libjpeg --copy-metadata=numpy --hiddenimport=libjpeg --noconfirm --clean test.py
Where I've mentioned issue: pyinstaller/pyinstaller#7157
Hoping for simplier solution in the bright future. Cheers!