DiCube must integrate seamlessly with existing DICOM ecosystems so PACS vendors can adopt it. DcbStreamingReader converts .dcbs files to DICOM on demand, emulating a traditional PACS backend. Downstream systems consume DiCube data without workflow changes.
Fallback to uncompressed DICOM for legacy environments:
from dicube.dicom import DcbStreamingReaderdcb_stream_uncompressed = DcbStreamingReader(dcb_file, force_uncompressed=True)uncompressed_dicom = dcb_stream_uncompressed.get_dicom_for_frame(0)
/home/liaofz/miniforge3/lib/python3.10/site-packages/dicube/dicom/dicom_builder.py:272: UserWarning:
Failed to decompress pixel data: 'Dataset' object has no attribute 'file_meta'
Pros: - Universally compatible - No decoder dependency - Zero risk of decode failure in transit
Cons: - 5–10× larger files - Higher storage/bandwidth usage - Longer transfer times
4. Deployment Strategy
Adopt a gradual approach:
Assess HTJ2K support in target PACS/clients.
Use HTJ2K where supported; fallback to uncompressed for legacy systems.
Monitor upstream library updates and expand HTJ2K coverage over time.
This balances modern compression gains with real-world compatibility.