-
Notifications
You must be signed in to change notification settings - Fork 7
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
Adding support for more transfer syntaxes #119
Comments
Using pydicoms pixel_data_handlers as a fall back for transfer syntaxes that Pillow does not support sounds like a good idea. I made a quick test here . I dont have any examples of wsis with non-Pillow-supported transfer syntax, but I guess I can create some to test with. |
Another issue related to this is that currently all image processing is done in Pillow. This works Ok for 8 bit color images and gray scale of higher bit depth. Looking at the dicom standard:
I dont think >8 bit color images are common for WSI, so maybe it is not a problem to no support it. Alternatively we need to change the image processing (cropping, stitching, scaling) to be done in for example numpy. |
Nice test code! You can try the public slim examples here. To access them, use the following arguments for the client = DICOMwebClient(
'https://idc-external-006.uc.r.appspot.com/dcm4chee-arc/aets/DCM4CHEE/rs',
qido_url_prefix=None,
wado_url_prefix=None,
) Most of those examples have their pixel data uncompressed ( Those slim examples also have examples with different JPEG variants, including one that is JPEG-LS. There are also some extensions to Pillow that might include handlers for things like JPEG-LS (for example here). However, I don't know how well supported they are (that JPEG-LS example hasn't been updated in over a year). I think it's nice to just rely on |
If we switch it to use and return numpy arrays in |
Fixed by #126
I will have to check what good alternatives there are for handling numpy image data, especially when it comes to scaling. |
Fixed by #126 |
@erikogabrielsson By the way, it looks like pydicom's RLE decoder only requires numpy. Did you consider using that instead of |
Yes one can decode RLE with only pydicom, but according to the But the |
We can install |
You should be able to read RLE images using the |
We are currently performing some tests with a DICOMweb server that has some examples in
Explicit VR Little Endian
andJPEG-LS
format. It would be nice if we could support as many formats as possible inwsidicom
.If we have a transfer syntax that
Pillow
doesn't support, what do you think about relying on pydicom's pixel_data_handlers to first convert the bytes to a numpy array, and then convert it toPillow
viaImage.fromarray()
?Those
pixel_data_handlers
currently do not support decoding individual frames. However, there is a PR up for such support, so it will hopefully be supported in the future. In the meantime,highdicom
includes adecode_frame()
function that takes as arguments some of the attributes on theDICOM
dataset. It then creates a "fake" DICOM dataset and utilizes pydicom'spixel_data_handlers
to convert the frame to a numpy array.highdicom
is planning to deprecate and remove this function whenpydicom
starts supporting frame decoding. We could potentially addhighdicom
as an optional dependency for this functionality untilpydicom
supports it.What do you think?
The text was updated successfully, but these errors were encountered: