# Reimplementation of 3D slicer CPR using pure VTK

**URL:** <https://discourse.slicer.org/t/reimplementation-of-3d-slicer-cpr-using-pure-vtk/46316>\
**Category:** Support\
**Created:** [February 26, 2026, 7:55pm UTC](https://discourse.slicer.org/t/reimplementation-of-3d-slicer-cpr-using-pure-vtk/46316 "2026-02-26T19:55:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![S-Linh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/s-linh/32/82008_2.png) [@S-Linh](https://discourse.slicer.org/u/S-Linh)\
**Post date:** [February 26, 2026, 7:55pm UTC](https://discourse.slicer.org/t/reimplementation-of-3d-slicer-cpr-using-pure-vtk/46316/1 "2026-02-26T19:55:28Z")

</div>

Hello everyone,

I’m trying to develop 3d Slicer Curve Planar Reformation in my own PACS Viewer, specifically OHIF:

> <https://github.com/PerkLab/SlicerSandbox/blob/8235ee89a2e5223dc63a9a6dfa7c316708afb066/CurvedPlanarReformat/CurvedPlanarReformat.py#L395-L430>

I’m looking to use VTK Wasm to implement this. My question is:  
Since Slicer’s CPR extension is made specifically for Slicer, is it possible to translate those Slicer’s MRML abstractions to pure vtk/vtk.js code?  
How should I approach this?

---

<div class="post-metadata">

**Author:** ![Thibault\_Pelletier](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/thibault_pelletier/32/4767_2.png) [@Thibault\_Pelletier](https://discourse.slicer.org/u/Thibault_Pelletier)\
**Post date:** [March 3, 2026, 7:33am UTC](https://discourse.slicer.org/t/reimplementation-of-3d-slicer-cpr-using-pure-vtk/46316/2 "2026-03-03T07:33:17Z")

</div>

Hi @S-Linh,

VTK js already has a CPR implementation : [ImageCPRMapper | VTK.js](https://kitware.github.io/vtk-js/api/Rendering_Core_ImageCPRMapper.html)

There is also a pure VTK CPR implementation available through the [vtkOpenGLSurfaceProbeVolumeMapper](https://vtk.org/doc/nightly/html/classvtkOpenGLSurfaceProbeVolumeMapper.html)

For the C++ implementation, you can have a look at the [tests](https://gitlab.kitware.com/vtk/vtk/-/blob/v9.6.0/Rendering/VolumeOpenGL2/Testing/Cxx/TestSurfaceProbeVolumeMapper.cxx) for an example on how to use the mapper.

For VTK js, you also have an [example available](https://github.com/Kitware/vtk-js/blob/3b54de3b9a8a338aa9dad237efe24045dfb6e8b1/Sources/Rendering/Core/ImageCPRMapper/example/index.js#L18)

Best,  
Thibault

---

<div class="post-metadata">

**Author:** ![S\_G](https://avatars.discourse-cdn.com/v4/letter/s/9e8a1a/32.png) [@S\_G](https://discourse.slicer.org/u/S_G)\
**Post date:** [April 17, 2026, 7:03pm UTC](https://discourse.slicer.org/t/reimplementation-of-3d-slicer-cpr-using-pure-vtk/46316/3 "2026-04-17T19:03:58Z")

</div>

Hi @S-Linh,

You don’t need to translate Slicer MRML. A more direct approach is to use **VTK.js ImageCPRMapper** and integrate it within OHIF.

I implemented a CPR prototype using:

- VTK.js ImageCPRMapper for CPR rendering

- Custom Cornerstone3D CPR viewports, fully supporting native Cornerstone3D tools and interaction

- OHIF Viewer as the integration layer

It demonstrates:

- Curved planar reformation viewport and cross-sectional viewports with custom tooling

- Real-time centerline editing with live CPR re-rendering

- Segmentation rendering pipeline integration

---

<div class="post-metadata">

**Author:** ![S-Linh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/s-linh/32/82008_2.png) [@S-Linh](https://discourse.slicer.org/u/S-Linh)\
**Post date:** [April 20, 2026, 2:59am UTC](https://discourse.slicer.org/t/reimplementation-of-3d-slicer-cpr-using-pure-vtk/46316/4 "2026-04-20T02:59:49Z")

</div>

@S_G Hi Gaber, Can you share the source code of your CPR prototype?

---

<div class="post-metadata">

**Author:** ![S-Linh](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/s-linh/32/82008_2.png) [@S-Linh](https://discourse.slicer.org/u/S-Linh)\
**Post date:** [April 20, 2026, 3:19am UTC](https://discourse.slicer.org/t/reimplementation-of-3d-slicer-cpr-using-pure-vtk/46316/5 "2026-04-20T03:19:38Z")

</div>

@S_G I have questions, as I am new to all these:

- What are the 3 viewports on the right of the CPR viewport result? how do they work?
- How do you calculate the orientation of each centerline?
- Are you generating centerlines based on coronal/sagittal/axial view of the original CT dicom images?

---

<div class="post-metadata">

**Author:** ![heart\_project](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/heart_project/32/81371_2.png) [@heart\_project](https://discourse.slicer.org/u/heart_project)\
**Post date:** [June 3, 2026, 12:44pm UTC](https://discourse.slicer.org/t/reimplementation-of-3d-slicer-cpr-using-pure-vtk/46316/6 "2026-06-03T12:44:22Z")

</div>

@S_G

Amazing results!

I’m building something similar with OHIF and vtkImageCPRMapper and I’m particularly interested in the step before CPR generation: obtaining the coronary centerline from the axial CT images.

Did you implement any vessel tracking / centerline extraction algorithm, or is the current prototype based on manually placed centerline control points?

If coronary extraction is not part of this prototype, would you recommend starting with a simple Draw Centerline Tool based on seed points placed on the axial view and then generating a spline for the CPR?

Any insight into the strategy you used (or would recommend) would be greatly appreciated.

---

<div class="post-metadata">

**Author:** ![mikebind](https://avatars.discourse-cdn.com/v4/letter/m/71e660/32.png) [@mikebind](https://discourse.slicer.org/u/mikebind)\
**Post date:** [June 5, 2026, 4:10pm UTC](https://discourse.slicer.org/t/reimplementation-of-3d-slicer-cpr-using-pure-vtk/46316/7 "2026-06-05T16:10:02Z")

</div>

I’m not the original poster, but [VMTK (Vessel Modeling Tool Kit)](http://www.vmtk.org/) is a great option for finding vessel centerlines, and is easy to use from Slicer via the VMTK Slicer extension (installable via the extension manager).
