Skip to content

DICOMfileClient raises error for RLE Losssless files #93

@denisw

Description

@denisw

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions