Inspiration
MPR X Plan is an interactive learning and visualization tool for exploring the spatial relationship between multiplanar reconstruction (MPR) images, 3D anatomical space, surgical instruments, and simulated X-ray views. The project is not intended to be a clinical medical product. It was created as a hands-on way to understand a deceptively difficult question: When a point or instrument moves in an axial, sagittal, or coronal image, how should that same object appear in 3D space and in AP/LAT X-ray projections?
The application allows users to load a CT DICOM series or use a built-in synthetic phantom, inspect linked MPR views, place virtual guide pins or screws, create distance and angle measurements, and observe the same geometry in a 3D scene and simulated X-ray images. Inspiration Medical images are often presented as separate 2D slices, even though they describe one continuous 3D volume. Understanding how these slices correspond to patient space—and how an instrument would project onto an X-ray detector—can be difficult without an interactive environment. I wanted to build a tool where these relationships could be explored directly. Instead of treating MPR, planning, and X-ray visualization as isolated features, the project connects them through one shared patient-coordinate model. The central idea is simple: every view should be a different representation of the same geometry. How I Built It MPR X Plan is a native C++20 desktop application built with CMake. Its major components include: Qt 6 for the desktop interface and interactive controls VTK for volume reslicing, 3D visualization, and rendering DCMTK for CT DICOM series loading and metadata processing A custom planning layer for virtual instruments and measurements A digitally reconstructed radiograph pipeline for simulated AP and LAT X-ray views CPU rendering with an optional CUDA acceleration path A lightweight project format for preserving selected planning information All modules share a common DICOM patient-coordinate system measured in millimetres. Voxel coordinates are converted into patient space using an affine transform: [
\mathbf{p}_{patient}
\mathbf{o} + \mathbf{D} \begin{bmatrix} s_x & 0 & 0 \ 0 & s_y & 0 \ 0 & 0 & s_z \end{bmatrix} \mathbf{p}_{voxel} ]Here, (\mathbf{o}) is the image origin, (\mathbf{D}) contains the row, column, and slice directions, and (s_x,s_y,s_z) are the voxel spacings. This shared transform allows a crosshair, instrument, or measurement to remain spatially consistent across MPR slices, the 3D scene, and X-ray projections. Challenges The hardest part was not rendering an image—it was maintaining consistent state across every representation. A patient-position change, for example, cannot rotate only the volume. The same rigid transformation must also be applied to: Instrument entry points and directions Completed measurement points and measurement planes The MPR crosshair Active editing snapshots Volume orientation and inverse coordinate transforms For a rotation around an axis (\hat{\mathbf{a}}), the project uses Rodrigues’ rotation formula: [ \mathbf{v}' = \mathbf{v}\cos\theta + (\hat{\mathbf{a}}\times\mathbf{v})\sin\theta + \hat{\mathbf{a}}(\hat{\mathbf{a}}\cdot\mathbf{v})(1-\cos\theta) ]Another challenge was making state changes transactional. Loading a replacement volume must not leave instruments or measurements from the previous dataset on screen. Similarly, a failed transformation must preserve the original session instead of committing a partially updated state. The X-ray workflow introduced a different challenge: reconstructing a 3D instrument from corresponding AP and LAT detector lines. This required careful handling of projection geometry, detector coordinates, ray intersections, and constrained interaction. What I Learned This project taught me that coordinate systems are part of the application’s core architecture—not just an implementation detail. I gained a deeper understanding of: DICOM orientation, spacing, origin, and patient coordinates MPR plane construction and oblique reslicing Rigid transformations and geometric invariants Perspective X-ray projection and ray geometry Synchronizing 2D, 3D, and detector-space interactions Designing transactional UI state updates Structuring a large C++ application into independently testable modules Building and validating a Qt, VTK, DCMTK, CMake, and CUDA-based stack on Windows I also learned the value of synthetic test data. A generated CT phantom made it possible to test imports and demonstrations without using real patient information. What’s Next MPR X Plan is currently a learning-focused prototype, but it provides a foundation for further experimentation. Future directions could include improved project restoration, faster asynchronous loading, richer X-ray interaction, GPU performance work, and additional visualization tools. For this hackathon, the most important outcome is already visible: one instrument or measurement can be created once and understood consistently across MPR, 3D, and simulated X-ray views.
What it does
How we built it
Challenges we ran into
Accomplishments that we're proud of
What we learned
What's next for MPR_X_Plan
Built With
- ct
- mpr
- xray
Log in or sign up for Devpost to join the conversation.