A Means of Enforcing Image Alignment at Compile Time for Improved Safety when Processing Surgical or Radiotherapy Images
Motivation: Image flipping and mixing differently-oriented images can cause software crashes or patient adverse events in high-risk settings. Goal(s): To describe an architectural pattern for most static-typing compilers (e.g. C++, Iron Python, C#) that guarantees orientations match at compile time, even if orientations are not known until runtime. Approach: Statically defining image types by their intended orientation (e.g. Native CT Space) allows generic methods that only accept image pairs that, by definition, are aligned. Misuse is rejected during compilation. Results: We present a framework that guarantees processing steps and outputs are orientation-safe at compile time. Runtime checks are only needed for disk-reads and transforms. Impact: Preventing image-orientation errors at compilation time reduces risks in clinical environments, and accelerates software development. The proposed pattern is readily implementable across many programming languages, and our framework making this available to all .Net languages, including Python via Iron Python.
Authors
- Doris D. Wang (ORCID: https://orcid.org/0000-0001-6112-3002)
- Philip A. Starr (ORCID: https://orcid.org/0000-0003-2733-4003)
- Melanie A. Morrison (ORCID: https://orcid.org/0000-0002-5993-0515)
- Lee B. Reid (ORCID: https://orcid.org/0000-0002-3585-8141)
- Andrew G. Lee
Publication Details
- Journal
- Proceedings on CD-ROM - International Society for Magnetic Resonance in Medicine. Scientific Meeting and Exhibition/Proceedings of the International Society for Magnetic Resonance in Medicine, Scientific Meeting and Exhibition
- Published
- 2025-09-16
- DOI
- https://doi.org/10.58530/2025/0958
- Primary Topic
- Advanced Radiotherapy Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00