Overview
The build system compiles five major image format libraries:JPEG
Standard lossy compression (JPEG baseline)
TIFF
Multi-page image storage and lossless compression
PNG
Lossless compression for screenshots and displays
OpenJPEG
JPEG 2000 compression (lossy and lossless)
Jasper
Alternative JPEG 2000 implementation
JPEG (libjpeg)
Purpose
The Independent JPEG Group’s library handles standard JPEG compression. In medical imaging, JPEG is used for:- DICOM Transfer Syntax 1.2.840.10008.1.2.4.50: JPEG Baseline (lossy)
- Preview Images: Thumbnails and quick previews
- Screen Captures: Exporting views for reports
Version & Configuration
Build Process
JPEG uses a traditional autotools build:build.sh:314-340
TIFF (libtiff)
Purpose
TIFF (Tagged Image File Format) provides:- Multi-page Storage: Multiple images in one file
- Lossless Compression: LZW, ZIP compression
- Metadata: Rich tagging system
- High Bit Depths: 12-bit, 16-bit images
Version & Configuration
Build Configuration
TIFF is built with CMake and depends on JPEG:build.sh:355-373
Post-Install Patching
TIFF headers are patched to avoid type conflicts:build.sh:383-386
PNG (libpng)
Purpose
PNG (Portable Network Graphics) provides lossless compression for:- Screen Captures: Export visualizations
- Overlays: Annotations and graphics
- Web Display: Share images online
Version & Configuration
Build Configuration
build.sh:207-219
PNG is built as a shared library (BUILD_SHARED_LIBS=ON) and framework, unlike most other dependencies which use static linking.
OpenJPEG
Purpose
OpenJPEG is an open-source JPEG 2000 codec supporting:- JPEG 2000 Compression: Both lossy and lossless
- High Bit Depths: 12-bit, 16-bit medical images
- Better Quality: Superior to JPEG at same compression ratios
- DICOM Transfer Syntaxes: Multiple J2K variants
Version & Configuration
Build Configuration
build.sh:658-670
Patching
OpenJPEG requires patches for compatibility:build.sh:644-650
Post-Install
Additional headers are copied after installation:build.sh:684
Jasper
Purpose
Jasper is an alternative JPEG 2000 implementation. Miele-LXIV includes both OpenJPEG and Jasper for maximum compatibility with different JPEG 2000 variants.Version & Configuration
Build Configuration
build.sh:699-712
| Option | Purpose |
|---|---|
JAS_ENABLE_SHARED=OFF | Build static library |
JAS_ENABLE_PROGRAMS=OFF | Don’t build command-line tools |
JAS_ENABLE_AUTOMATIC_DEPENDENCIES=OFF | Manage dependencies manually |
Library Dependencies
The image libraries have interdependencies:DICOM Transfer Syntax Support
These libraries enable support for DICOM transfer syntaxes:| Transfer Syntax | Library | Description |
|---|---|---|
| 1.2.840.10008.1.2.4.50 | JPEG | JPEG Baseline (lossy, 8-bit) |
| 1.2.840.10008.1.2.4.51 | JPEG | JPEG Extended (lossy, 12-bit) |
| 1.2.840.10008.1.2.4.57 | JPEG | JPEG Lossless, Non-Hierarchical |
| 1.2.840.10008.1.2.4.70 | JPEG | JPEG Lossless, First-Order Prediction |
| 1.2.840.10008.1.2.4.80 | OpenJPEG/Jasper | JPEG-LS Lossless |
| 1.2.840.10008.1.2.4.90 | OpenJPEG/Jasper | JPEG 2000 Lossless |
| 1.2.840.10008.1.2.4.91 | OpenJPEG/Jasper | JPEG 2000 Lossy |
DCMTK automatically uses the appropriate library based on the transfer syntax of the DICOM file being loaded.
Configuration in Kconfig
Kconfig-miele:34-39
Build Order
The image libraries must be built in this order due to dependencies:- JPEG (no dependencies)
- PNG (no dependencies)
- TIFF (depends on JPEG)
- OpenJPEG (no dependencies)
- Jasper (no dependencies)
- VTK (uses JPEG, TIFF, PNG)
- DCMTK (uses all image libraries)
Common Issues
TIFF Type Conflicts
If you see errors aboutuint64 type conflicts, ensure the post-install patching step ran:
OpenJPEG Linking
Ensure the format_defs.h header was copied:Further Reading
libjpeg
Independent JPEG Group homepage
libtiff
LibTIFF documentation
OpenJPEG
OpenJPEG GitHub repository
JPEG 2000 Standard
JPEG 2000 specifications