A high-performance workstation for professional 16-bit TIFF image visualization, analysis, and processing.
- 1. Features
- 2. Cross Platform Native Build
- 3. Solution Structure
- 4. Architecture
- 5. Image Processing Pipeline
- 6. Build Requirements
- 7. Testing
- 8. Native Integration
- 9. Future Enhancements
- 10. License
The following diagram illustrates the strict downward dependency flow within PhotonLab, ensuring a responsive UI and high-performance image processing:
PhotonLab is a desktop imaging application designed for viewing, analyzing, and processing 16-bit TIFF images. The platform combines a modern WPF user interface, a managed C# service layer, and a high-performance native C++ processing engine to deliver responsive visualization and advanced image analysis capabilities.
- 16-bit TIFF image support
- Window/Level based visualization
- Real-time zoom and fit-to-screen
- Pixel-level inspection (cursor tracking)
- Metadata display (dimensions, bit depth, format)
- Gamma correction
- Median filtering
- Sharpening filter
- Window/Level transformation
- Native high-performance processing pipeline
- Real-time histogram generation
- Statistical analysis (min, max, mean, median, std dev)
- Normalized histogram scaling (log-based)
- Session-based image state management
- PNG export
- JPEG export
- TIFF export
- Session-aware rendering export
- MVVM-based WPF architecture
- Dependency injection friendly design
- Async processing pipeline (non-blocking UI)
- Managed → Native interop layer
- OpenTelemetry tracing integration
- Structured logging (ILogger)
PhotonLab includes a fully automated Docker-based native build pipeline.
Developer
│
▼
Docker Multi-stage Build
│
├───────────────► Linux (.so)
│
├───────────────► Windows (.dll via MinGW)
│
└───────────────► macOS (.dylib local build)
│
▼
GoogleTest Validation
│
▼
Artifact Extraction
│
▼
Unified Distribution
PhotonLab/
├── PhotonLab.Native
├── PhotonLab.Core
├── PhotonLab.Desktop
├── PhotonLab.UnitTests
├── PhotonLab.IntegrationTests
└── PhotonLab.NativeTests
| Project | Responsibility |
|---|---|
| PhotonLab.Native | Native C++ image processing engine |
| PhotonLab.Core | Contracts, DTOs, shared abstractions |
| PhotonLab.Desktop | WPF application, ViewModels, services, UI |
| PhotonLab.UnitTests | Managed component unit tests |
| PhotonLab.IntegrationTests | Native interop and end-to-end integration validation |
| PhotonLab.NativeTests | Native processing engine validation |
PhotonLab follows a layered architecture based on MVVM principles and strict separation of concerns.
┌──────────────────────────────┐
│ WPF UI │
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ ViewModels │
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ Application Services │
│ Rendering / Statistics / │
│ Histogram / Export / TIFF │
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ Core Contracts & DTOs │
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ Native Interop Layer │
└──────────────┬───────────────┘
│
▼
┌──────────────────────────────┐
│ Native C++ Processing │
└──────────────────────────────┘
Additional architecture documentation is available in:
Docs/
└── Architecture/
├── Overview.md
├── HighLevelArchitecture.md
├── ProcessingPipeline.md
└── NativeInterop.md
PhotonLab processes images through a session-based pipeline:
- Load TIFF via ITiffLoader
- Initialize session via IImageSessionService
- Process pixels via IImageProcessingService
- Render BGRA32 display buffer via IImageRenderer
- Update WPF BitmapSource
- Refresh statistics and histogram asynchronously
- Visual Studio 2022
- .NET 8 SDK
- C++17 Compiler
- Windows 10/11 SDK
- CMake 3.25+
- MSVC Toolchain
- Native TIFF processing libraries (if applicable)
PhotonLab includes multiple testing layers.
PhotonLab.UnitTests
Coverage includes:
- Services
- DTO validation
- Processing workflows
- Histogram generation
- Statistics calculations
PhotonLab.IntegrationTests
Coverage includes:
- Native interop validation
- TIFF loading workflow
- Managed-to-native communication
- End-to-end processing pipelines
PhotonLab.NativeTests
Coverage includes:
- Gamma correction
- Median filtering
- Sharpen filtering
- Histogram generation
- Window/Level processing
PhotonLab uses a managed-to-native architecture:
C# UI
↓
Service Layer
↓
Contracts
↓
P/Invoke Interop
↓
Native C++ Engine
This approach enables a responsive user experience while leveraging native performance for computationally intensive image operations.
- CLAHE enhancement
- SIMD optimization
- GPU acceleration
- DICOM support
- Multi-image comparison
- Tile-based processing
- Multi-threaded rendering pipeline
Licensed under the Apache License, Version 2.0.
See LICENSE for details.

