Skip to content
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

DICOMfileClient raises error for RLE Losssless files #93

Open
denisw opened this issue Dec 11, 2023 · 0 comments
Open

DICOMfileClient raises error for RLE Losssless files #93

denisw opened this issue Dec 11, 2023 · 0 comments

Comments

@denisw
Copy link

denisw commented Dec 11, 2023

Summary

When using DICOMfileClient to retrieve an instance with RLE Lossless encoding (Transfer Syntax UID 1.2.840.10008.1.2.5), an error is raised even though pydicom can deal with RLE Lossless encoding just fine. There is no error when using DICOMwebClient.

Steps to Reproduce

  1. Download the RLE Lossless sample image from https://barre.dev/medical/samples/#s-us and put it into a folder called dicom-samples.
  2. Put the script below next to the dicom-samples folder and run it.
from pathlib import Path

from dicomweb_client import DICOMfileClient
from pydicom.dataset import Dataset

samples_path = Path("./dicom-samples")
dicom_client = DICOMfileClient(f"file://{samples_path.absolute()}")

for series_json in dicom_client.search_for_series(get_remaining=True):
    series = Dataset.from_json(series_json)

    for instance in dicom_client.retrieve_series(
        study_instance_uid=series.StudyInstanceUID,
        series_instance_uid=series.SeriesInstanceUID,
    ):
        pass

Expected Behavior

The script succeeds without any output.

Actual Behavior

Traceback (most recent call last):
  File "/.../.venv/lib/python3.11/site-packages/dicomweb_client/file.py", line 3180, in retrieve_instance
    expected_media_type = transfer_syntax_uid_lut[transfer_syntax_uid]
                          ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: '1.2.840.10008.1.2.5'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant