Tech Stack Research - sdpunit/OrthoVis GitHub Wiki
Front-end Tech-stack Research
This page serves as research documentation for making tech-stack decisions. This research is essential in understanding what front-end frameworks will be most applicable to the backend of the application (python). It is worth noting that in reliminary research, and discussion with the stakeholders, a python frontend package (like PyQT or similar) in conjunction with a visualisation library like VTK would probably align best to the project, as well as aligning to the experience of Mark Pickering, the creator of the original application.
Front-end Frameworks
PyQt/PySide
Category | Details |
---|---|
Pros | ✦ The UI matches the OS you are using ✦ Rich widget set✦ Drag-and-drop UI builder (Qt Designer)✦ Good documentation✦ Good support for OpenGL and 3D rendering |
Cons | ✦ Steep learning curve✦ PyQt has licensing restrictions (GPL); PySide6 is LGPL✦ UI logic can get lengthy |
3D Visualization Compatibility | ✅ Support QOpenGLWidget , VTK integration, or libraries like pyvistaqt , which are commonly used for 3D medical and scientific apps. |
Best For | Professional scientific apps, 3D viewers, or tools with complex layouts |
Notes
- PySide6 is LGPL licensed (more flexible than PyQt's GPL) $\Rightarrow$ we might want to use PySide6
Kivy
Category | Details |
---|---|
Pros | ✦ Cross-platform (Windows/Linux/macOS/mobile)✦ Touch support✦ Custom, animated UI✦ GPU-accelerated rendering |
Cons | ✦ Non-native look✦ Uses its own event loop and layout system✦ Steep learning curve if unfamiliar with KV language |
3D Visualization Compatibility | ✅ Moderate support. Has Kivy3D , and custom 3D rendering via OpenGL possible, but need more effort than Qt.Not designed specifically for scientific visualization. |
Best For | Custom touch apps, cross-platform UIs, or where unique design is important |
Dear PyGui
Category | Details |
---|---|
Pros | ✦ Simple Pythonic API✦ GPU-accelerated and fast✦ Good for dashboards and real-time graphs✦ Modern dark-themed UI |
Cons | ✦ Limited layout flexibility✦ Still evolving; fewer widgets than Qt✦ Not meant for complex multi-page UIs |
3D Visualization Compatibility | ✅ Basic 3D support via OpenGL backend; integrates with 3D renderers (e.g., moderngl , or custom shaders). More suitable for custom viewers or visual debugging. |
Best For | Internal tools, AI dashboards, real-time model visualization |
Tkinter
Category | Details |
---|---|
Pros | ✦ Built into Python✦ Lightweight and simple✦ Very low barrier to entry |
Cons | ✦ Outdated-looking UI✦ Limited widgets✦ No modern touch or theme support |
3D Visualization Compatibility | ❌ Not suitable. Very limited support for 3D rendering. No native OpenGL integration. Workarounds exist (like using a Canvas with images), but impractical. |
Best For | Basic UIs, quick prototypes, or internal tools with no 3D needs |
2D/3D Visualisation Tools and Packages
The OrthoVis 2.0 application interface will need to be able to display 2D and 3D medical images in the form of DICOM/NIfTI/etc files. It is also highly desirable for the images to be able to be manipulated in the display space (zoom, rotate, display position). Numerous well established visualisation tools and packages exist that the team may be able to harness for the project. It is also worth noting that when undertaking tech-stack research another key requirement which was kept front of mind was that OrthoVis is to be developed as a desktop application, ruling out any WebGL based frameworks.
Preferred Option - Visualisation Toolkit (VTK)
VTK is a powerful open-source library for 2D and 3D data visualisation, supporting volume rendering, surface reconstruction, and interactive image slicing. The library is widely used in medical imaging and integrates well with GUI frameworks like Qt for building professional-grade desktop applications.
Category | Details |
---|---|
Pros | ✦ Feature rich C++ and Python 3D engine✦ Medical grade 3D rendering✦ Qt integration |
Cons | ✦ Steep learning curve. Somewhat negated by narrowing features that we want to use… OrthoVis will mainly require VTK for displaying 2D/3D images, and manipulating them in the display space -> no segmentation or altering of the actual files |
Notes:
- Numerous pythonic wrappers also exist for VTK (such as PyVista and Mayavi), which can be used to further simplify VTK for the OrthoVis 2.0 use case
- Is incorporated into popular applications that the team has been able to use (3DSlicer), showing viability for similar types of projects
Alternative Option - Insight ToolKit (ITK)
ITK is a powerful open-source toolkit designed for medical image processing, including registration, segmentation, and image filtering. While it is not focused on rendering, ITK excels in manipulating and analysing DICOM data. It is often used alongside visualization tools like VTK or ITKWidgets when limited visualisation is required.
Category | Details |
---|---|
Pros | ✦ Purspose built for medical image processing and analysis✦ Python bindings via SimpleITK make scripting easier |
Cons | ✦ Not specifically a rendering engine – lacks volumetric or high-performance 3D rendering capabilities✦ GUI integration not as mature as potential QT->VTK pipelines |
Notes:
- ITK is often used alongside VTK, with one example being 3DSlicer itself.
- ITK is most useful for processing tasks (segmentation for example), although we already have this established through TotalSegmentator
Comparisons of Other Options
There are other options that exist, however not many other frameworks fit the team requirements well enough to be seriously considered.
Feature | VTK | ITK / ITKWidgets | Three.js | napari |
---|---|---|---|---|
DICOM Support | ✅ Native | ✅ via SimpleITK | ❌ (requires conversion) | 🟡 (limited) |
3D Volume Rendering | ✅ Advanced | ❌ (basic only) | ✅ WebGL-based | ❌ (no true volume) |
2D Slice Viewing | ✅ Yes | ✅ Yes | 🟡 (JS implementation) | ✅ Yes |
Interactivity | ✅ High | 🟡 Medium | ✅ High (GPU-accelerated) | ✅ Excellent |
Language | C++ / Python | C++ / Python | JavaScript | Python |
Desktop Integration | ✅ (via Qt) | 🟡 (no full GUI toolkit) | ❌ (browser-based) | ✅ (Qt-based) |
Use Case Fit (OrthoVis) | ✅ Best fit | 🟡 Limited (for API-only processing) | ❌ Needs extra infrastructure | 🟡 For lightweight viewing |
Conclusion
- PySide6 would be the best choice for GUI framework
- Compatible with VTK and other libraries for 3D rendering
- Has Qt Designer for easy UI design
- No licensing issues (LGPL)
- Doesn't use other event loops or layout systems
- VTK offers the most complete framework for the team considering:
- Need to integrate with python backend
- Need to develop an agnostic desktop application
- Advanced 2D and 3D rendering capabilities and user interactivity
With this combination of tools we can develop a simple but effective application interface. Below is an example of a similar type of tool using VTK in combination with ITK. Our application, however, will be modernised as we aim to harness the power of PySide6.