Comments (14)
Do you know which plugin is doing the decompression?
Related, please also post the contents of running
python -m pydicom.env_info
from a command line.
from pydicom.
Can you post the results from below as well?
print(" ".join(f"{b:02X}" for b in ds.PixelData[:100]))
from pydicom.
@zeakey did you resolve your issue?
from pydicom.
@scaramallion Thanks for your response and the results are below:
print(" ".join(f"{b:02X}" for b in ds.PixelData[:100]))
FE FF 00 E0 04 00 00 00 00 00 00 00 FE FF 00 E0 54 16 01 00 FF 4F FF 51 00 29 00 00 00 00 01 40 00 00 01 40 00 00 00 00 00 00 00 00 00 00 01 40 00 00 01 40 00 00 00 00 00 00 00 00 00 01 08 01 01 FF 52 00 0C 00 00 00 01 00 05 04 04 00 01 FF 5C 00 13 20 50 58 58 60 58 58 60 58 58 60 58 58 58 50 50 58
from pydicom.
J2K codestream has 320x320, 1 component and 9-bit precision. What's the output from python -m pydicom.env_info
?
from pydicom.
Ah, 9-bit. You're using Pillow, aren't you? There's an issue with their decoding of 9-bit JPEG 2000 codestreams that should be fixed in the next Pillow release. In the meantime you can switch to using GDCM or pylibjpeg (with the pylibjpeg-openjpeg plugin)
from pydicom.
@darcymason Oh I missed your reply.
The output of python -m pydicom.env_info
is:
module | version
------ | -------
platform | Linux-6.5.0-28-generic-x86_64-with-glibc2.35
Python | 3.10.11 (main, Apr 20 2023, 19:02:41) [GCC 11.2.0]
pydicom | 2.3.1
gdcm | _module not found_
jpeg_ls | _module not found_
numpy | 1.26.4
PIL | 9.5.0
pylibjpeg | _module not found_
openjpeg | _module not found_
libjpeg | _module not found_
from pydicom.
In the meantime you can switch to using GDCM or pylibjpeg
Ah, 9-bit. You're using Pillow, aren't you? There's an issue with their decoding of 9-bit JPEG 2000 codestreams that should be fixed in the next Pillow release. In the meantime you can switch to using GDCM or pylibjpeg (with the pylibjpeg-openjpeg plugin)
How can I "switch" to pylibjpeg
? I installed pylibjpeg by python -m pip install -U pylibjpeg-openjpeg
but the error is still there.
How can I tell pydicom to use another library?
from pydicom.
With v2.4 you can do:
ds = dcmread(...)
ds.convert_pixel_array("pylibjpeg")
arr = ds.pixel_array
Also, I think I closed this by mistake, this is a separate issue to #2006
from pydicom.
I got AttributeError: 'FileDataset' object has no attribute 'convert_pixel_array'
with pydicom==2.4.3
and pydicom==2.4.0
.
I'm using a 3rd party package to read the dicom files whose default behavior is ds.pixel_array
after dread.
Is there any way I can fix this globally without editing the source code of that package?
from pydicom.
Ah, sorry, its convert_pixel_data()
from pydicom.
I got this error:
RuntimeError: The pixel data handler 'pylibjpeg' is not available on your system. Please refer to the pydicom documentation for information on installing needed packages.
With those two dependencies installed
pip install "pylibjpeg[all]"
pip install pylibjpeg-libjpeg
from pydicom.
Can you post the output from python -m pydicom.env_info
again?
from pydicom.
@zeakey did you resolve your issue?
from pydicom.
Related Issues (20)
- Reading Json with InlineBinary sequences fails HOT 1
- pixel_array returns wrong pixel data in JPEG2000Lossless HOT 6
- Updates needed for compatibility with numpy 2.0 HOT 1
- Incorrect validation applied to LUT Descriptor (0028, 3002) in filewriter.py HOT 2
- Option to raise FileExistsError when writing a DICOM file HOT 3
- Decompress JPEG 2000 OverflowError pillow_handler HOT 4
- Menu button in mobile documentation not functional HOT 2
- Dataset Specific Character Set incorrect encoding/decoding returns unreadable symbols in strings HOT 10
- How do I convert single .dcm file into a sequence with pydicom HOT 1
- Colors of dicom converted to png not correct HOT 3
- DCM not converted with pydicom 3 HOT 11
- Pydicom 3.0 and "No module named 'openjpeg' nor 'jpeg_ls'" error HOT 14
- Consider making example downloads opt-in HOT 11
- pydicom 3.0.0 no longer handles ambiguous VRs HOT 2
- Incorrect length validation for multiframe, single bit pixel data with native transfer syntaxes HOT 5
- Floating point images data incorrectly require the BitsStored attribute to decode HOT 4
- dcmread() adds depricated "group length tags" to DataSet HOT 3
- save_as() adds depricated "group length tags" to file HOT 4
- Should `set_pixel_data` withs `bits_stored=1` perform bit-packing? HOT 3
- Study ID element cannot be empty upon adding to FileSet despite being allowed to be empty by standard HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pydicom.