large-image-source-dicom
raw JSON → 1.34.1 verified Sat May 09 auth: no python
A DICOM tilesource plugin for large_image, enabling tile-based access to DICOM WSI (Whole Slide Imaging) and other DICOM images. Version 1.34.1 supports Python >=3.10. Part of the girder/large_image ecosystem, releases follow the main large-image package cadence.
pip install large-image-source-dicom Common errors
error ModuleNotFoundError: No module named 'large_image_source_dicom' ↓
cause Package not installed or installed in wrong environment.
fix
Run: pip install large-image-source-dicom
error RuntimeError: No tilesource found for this file ↓
cause The DICOM file could not be recognized as a supported format (e.g., missing DICOM metadata or unsupported encoding).
fix
Verify the file is a valid DICOM instance (not DICOMDIR). Ensure gdcm is installed if needed.
Warnings
gotcha The DICOM source requires gdcm for compressed transfer syntaxes (e.g., JPEG2000). Without gdcm installed, some DICOM files may not decode. ↓
fix Install gdcm: pip install gdcm or conda install -c conda-forge gdcm
gotcha DICOM tile source expects a valid DICOM file; it does not support DICOMDIR or multi-file series. Use large-image-source-dicom only for single DICOM instances. ↓
fix For multi-file series, consider using large-image-source-tiff or convert series to a pyramidal TIFF.
breaking As of large-image v1.34.0, the DICOM source may require Python >=3.10. Older Python versions are no longer supported. ↓
fix Upgrade Python to 3.10 or later.
Imports
- DicomFileTileSource
from large_image_source_dicom import DicomFileTileSource - open wrong
from large_image_source_dicom import opencorrectfrom large_image import open
Quickstart
from large_image import open
from large_image_source_dicom import DicomFileTileSource
ts = open('path/to/dicom.dcm')
print(f'Tile source type: {type(ts).__name__}')
print(f'Metadata: {ts.getMetadata()}')
# Get a tile
_, tile = ts.getTile(0, 0, 0)
print(f'Tile shape: {tile.shape}')
# Generate a thumbnail
thumbnail = ts.getThumbnail(region=dict(width=512, height=512))
print(f'Thumbnail size: {len(thumbnail)} bytes')