|
| 1 | +--- |
| 2 | +layout: pw45-project |
| 3 | + |
| 4 | +permalink: /:path/ |
| 5 | + |
| 6 | +project_title: That Rendering Thing |
| 7 | +category: VR/AR and Rendering |
| 8 | +presenter_location: |
| 9 | + |
| 10 | +key_investigators: |
| 11 | + |
| 12 | +- name: Steve Pieper |
| 13 | + affiliation: Isomics |
| 14 | + country: USA |
| 15 | + |
| 16 | +--- |
| 17 | + |
| 18 | +# Project Description |
| 19 | + |
| 20 | +<!-- Add a short paragraph describing the project. --> |
| 21 | + |
| 22 | + |
| 23 | +I've been experimenting with [wgpu-py](https://github.com/pygfx/wgpu-py), an implementation of WebGPU that you can pip_install directly into Slicer. |
| 24 | + |
| 25 | +The work in progress in [SlicerWGPU](https://github.com/pieper/SlicerWGPU), which is now working pretty nicely in demo mode. |
| 26 | + |
| 27 | +#### Key Features |
| 28 | +* Easy to install, can work with any recent Slicer release. Don't even need to restart Slicer. |
| 29 | +* Can write shader code easily that works on Vulkan, DirectX, and Metal. |
| 30 | +* It supports multi-volume rendering with full quality compositing |
| 31 | +* It can directly render segmentations and provides instant updates in response to edits |
| 32 | +* It supports interactive rendering of volumes under non-linear transforms |
| 33 | +* Interactive elements like transform handles and markups are still handled by VTK and seamlessly composited |
| 34 | + |
| 35 | +#### Current status |
| 36 | +* Currently in demo mode. Some things are integrated to work with the MRML scene while, others work alongside. |
| 37 | +* The VTK OpenGL render window is tapped into so that most rendering works cleanly, but SlicerWGPU uses a different method to composite multiple translucent surfaces (A-Buffer compared to Depth Peeling) so those aren't currently combined. |
| 38 | +* Performance seems about the same as VTK's GPU renderer, but no extensive testing has been done. |
| 39 | + |
| 40 | +#### How to try it |
| 41 | +* Clone the [SlicerWGPU](https://github.com/pieper/SlicerWGPU) repository |
| 42 | +* Drag and drop the folder onto a running Slicer (5.10.0 or really any version should work). |
| 43 | +* Be sure to load the `Scene Rendering` module (you can ignore the others) |
| 44 | +* Go to the `Scene Rendering` module and try the buttons. The top block of buttons (the "VTK Injection" block) are the current demos and the "Dual View" bock are some older experiments. |
| 45 | + |
| 46 | +<img width="539" height="308" alt="Image" src="https://github.com/user-attachments/assets/5c518029-b73d-4881-91d9-50b3eecf0ab9" /> |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | +## Objective |
| 51 | + |
| 52 | +<!-- Describe here WHAT you would like to achieve (what you will have as end result). --> |
| 53 | + |
| 54 | + |
| 55 | +1. Give demos to anyone who might be interested and collect feedback |
| 56 | +2. Collect use-cases where existing Slicer rendering doesn't fully meet requirements but the SlicerWGPU code could |
| 57 | +3. Consider what would be needed for a more complete integration (i.e. possible custom display nodes and dedicated GUI). |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | +## Approach and Plan |
| 63 | + |
| 64 | +<!-- Describe here HOW you would like to achieve the objectives stated above. --> |
| 65 | + |
| 66 | + |
| 67 | +1. Experiment with an updated Volume Rendering module to take advantage of advanced features |
| 68 | +2. Try implementing any new features or use cases people suggest |
| 69 | +3. Think about how to render volumes that are too large for GPU memory (i.e. paging texture data) |
| 70 | +4. Consider how to make this more easily available and useful |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | +## Progress and Next Steps |
| 75 | + |
| 76 | +<!-- Update this section as you make progress, describing of what you have ACTUALLY DONE. |
| 77 | + If there are specific steps that you could not complete then you can describe them here, too. --> |
| 78 | + |
| 79 | + |
| 80 | +(TBD) |
| 81 | + |
| 82 | + |
| 83 | + |
| 84 | +# Illustrations |
| 85 | + |
| 86 | +<!-- Add pictures and links to videos that demonstrate what has been accomplished. --> |
| 87 | + |
| 88 | + |
| 89 | +<img width="400" alt="Image" src="https://github.com/user-attachments/assets/2fc3ddb2-f485-40a6-b8e1-241e4fe4d155" /> |
| 90 | + |
| 91 | +<img width="400" alt="Image" src="https://github.com/user-attachments/assets/6e41c142-0e47-427e-9bbd-e5efac80069e" /> |
| 92 | + |
| 93 | +<img width="400" alt="Image" src="https://github.com/user-attachments/assets/18f1e66d-4939-450b-9d88-bcd8de74c3da" /> |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | +# Background and References |
| 98 | + |
| 99 | +<!-- If you developed any software, include link to the source code repository. |
| 100 | + If possible, also add links to sample data, and to any relevant publications. --> |
| 101 | + |
| 102 | + |
| 103 | +SlilcerCL: https://github.com/pieper/SlicerCL (https://www.youtube.com/watch?v=hFxTyLPjQd0) |
| 104 | +STEP: https://github.com/pieper/step (https://www.youtube.com/watch?v=ML9_JWAz1kY, https://youtu.be/8dputUoKBTA) |
| 105 | +Transfer function editor: https://youtu.be/4Q9NfNmN-9w |
| 106 | + |
0 commit comments