This project involved the design and implementation of a C++ plugin for the Orthanc DICOM server, used to automatically redact patient health information (PHI) from medical images in compliance with privacy regulations. The primary goal was to replace a manual, error-prone workflow with a fast, configurable, and scalable system suitable for large-scale medical and AI research.
DICOM is a standard for storing and transmitting medical imaging data, and by necessity it includes personally identifying information such as names, dates of birth, and other sensitive metadata. In research contexts, particularly those involving machine learning, this information must be removed before images can be used. Prior to this project, this process required manually scrubbing thousands of files, consuming significant researcher time.
Orthanc was selected as the platform due to its lightweight architecture, open-source licensing, and plugin API, which enables custom processing during image ingestion and storage. The resulting plugin allows PHI redaction to occur automatically as images are received, rather than as a separate post-processing step.
System Design and Responsibilities
This project was completed as a capstone at UBC in collaboration with Brian Zhou and Iwan Levin. They focused primarily on relational database modeling and SQL development to support researcher requirements. I was responsible for the overall software architecture and the majority of the C++ implementation, including build configuration via CMake, plugin integration with Orthanc, and core image processing logic.
A key design decision was to make the plugin behavior entirely configuration-driven. Researchers specify redaction rules, date truncation strategies, and file organization policies using a JSON configuration file hosted alongside the Orthanc server. This allowed the system to adapt to changing research requirements without recompilation or code changes.
Internally, the plugin processes DICOM files using direct buffer inspection and tag matching, enabling high throughput while maintaining correctness. Images are optionally hard-linked across directory structures to support alternate organizational schemes based on derived metadata, such as truncated dates of birth.
Objectives
The primary objectives of this project were to develop a well-tested and extensible C++ plugin for Orthanc servers, implement reliable PHI removal and date truncation capabilities, and support flexible filesystem organization for large research datasets. An additional goal was to provide clear user and developer documentation to ensure the system could be adopted and extended without deep familiarity with the codebase.
Challenges and Outcomes
One technical challenge involved low-level buffer traversal and size calculations during DICOM processing. An overcomplication in this logic led to a segmentation fault that was difficult to diagnose due to competing academic deadlines. This experience reinforced the importance of simplicity and invariants when working close to raw memory.
Team coordination also presented challenges. One team member did not meaningfully participate in development or communication, requiring the remaining contributors to absorb additional responsibilities while still meeting project milestones. Additionally, obtaining detailed code reviews was difficult, as other contributors were newer to C++ and often deferred design decisions to me.
Despite these challenges, the project resulted in a robust and high-performance system. The plugin processes large volumes of images quickly, supports flexible researcher workflows through configuration, and significantly reduces the manual effort required to prepare datasets for research.
Result
The project resulted in an extremely fast, configurable, and end-user-friendly system for automating PHI redaction in DICOM images as they are received or generated. The plugin significantly reduced the manual effort required to prepare datasets for research, while maintaining correctness and compliance with privacy requirements.
Clear user-facing configuration documentation and internal developer documentation were provided to support deployment, maintenance, and future extension of the system.
Shirly
Rover Recursive Pathfinding
Orthanc PHI Filter Plugin
Hypermaze Prototype
Cheryl Engine
Leave a Comment
No Comments