# vtk.js

**URL:** https://discourse.vtk.org/c/web/vtk-js/11.md

[Latest](https://discourse.vtk.org/latest.md) · [Categories](https://discourse.vtk.org/categories.md) · [Tags](https://discourse.vtk.org/tags.md)

---

## [About the vtk.js category](https://discourse.vtk.org/t/about-the-vtk-js-category/11460)

<div class="topic-metadata">

**Author:** [@cory.quammen](https://discourse.vtk.org/u/cory.quammen)\
**Replies:** 0

</div>

---

## [prototype pollution issues on dependencies](https://discourse.vtk.org/t/prototype-pollution-issues-on-dependencies/16175)

<div class="topic-metadata">

**Author:** [@blinkkkkkk](https://discourse.vtk.org/u/blinkkkkkk)\
**Replies:** 1\
**Last updated:** [May 29, 2026, 10:33pm UTC](https://discourse.vtk.org/t/prototype-pollution-issues-on-dependencies/16175 "2026-05-29T22:33:35Z")

</div>

@kitware/vtk.js rely on node\_modules/xmlbuilder2 which depend on /node\_modules/js-yaml js-yaml \<3.14.2 which has prototype pollution issues: Severity: moderate js-yaml has prototype pollution in merge (\<\<) - https:/…

---

## [How to use GPU to accelerate time-consuming calculations, such as ImageMarchingCubes and WindowedSincPolyDataMilter](https://discourse.vtk.org/t/how-to-use-gpu-to-accelerate-time-consuming-calculations-such-as-imagemarchingcubes-and-windowedsincpolydatamilter/16319)

<div class="topic-metadata">

**Author:** [@MrQ\_92](https://discourse.vtk.org/u/MrQ_92)\
**Replies:** 3\
**Last updated:** [March 23, 2026, 6:32am UTC](https://discourse.vtk.org/t/how-to-use-gpu-to-accelerate-time-consuming-calculations-such-as-imagemarchingcubes-and-windowedsincpolydatamilter/16319 "2026-03-23T06:32:09Z")

</div>

I am learning to use vtk.js. The current issue is that the calculation of large volume data using MarchingCubes and WindowedSincPolyDataMilter is time-consuming. I have read the code and found that their calculations a…

---

## [How to programmatically add the vtkSeedWidget or vtkSphereWidget](https://discourse.vtk.org/t/how-to-programmatically-add-the-vtkseedwidget-or-vtkspherewidget/16130)

<div class="topic-metadata">

**Author:** [@fdlyj](https://discourse.vtk.org/u/fdlyj)\
**Replies:** 15\
**Last updated:** [February 25, 2026, 2:12pm UTC](https://discourse.vtk.org/t/how-to-programmatically-add-the-vtkseedwidget-or-vtkspherewidget/16130 "2026-02-25T14:12:43Z")

</div>

How to programmatically add the vtkSeedWidget or vtkSphereWidget,then execute widgetManager.enablePicking(), and you can drag the widget with the mouse Thanks.

---

## [How to clip a screw mesh to visualize only the part outside the vertebral cortical bone in vtk.js?](https://discourse.vtk.org/t/how-to-clip-a-screw-mesh-to-visualize-only-the-part-outside-the-vertebral-cortical-bone-in-vtk-js/16266)

<div class="topic-metadata">

**Author:** [@gr92](https://discourse.vtk.org/u/gr92)\
**Replies:** 0\
**Last updated:** [February 3, 2026, 11:18am UTC](https://discourse.vtk.org/t/how-to-clip-a-screw-mesh-to-visualize-only-the-part-outside-the-vertebral-cortical-bone-in-vtk-js/16266 "2026-02-03T11:18:47Z")

</div>

Hi everyone, I am developing a new feature using vtk.js and need to implement a technical visualization for ‘cortical breach’ detection. Currently, I can detect the intersection between a screw (represented as a cyl…

---

## [Need help implementing CPR with vtk.js and OHIF](https://discourse.vtk.org/t/need-help-implementing-cpr-with-vtk-js-and-ohif/16265)

<div class="topic-metadata">

**Author:** [@linhgt](https://discourse.vtk.org/u/linhgt)\
**Replies:** 1\
**Last updated:** [February 2, 2026, 1:24pm UTC](https://discourse.vtk.org/t/need-help-implementing-cpr-with-vtk-js-and-ohif/16265 "2026-02-02T13:24:33Z")

</div>

Hello, I’m trying to implement CPR visualization using vtk.js in OHIF. I am following the example here: I have implemented my own viewport in OHIF to display CPR result: import React, { useEffect, useRef } from 'rea…

---

## [Doesn't unpkg.com/vtk.js include the vtkSeedWidget?](https://discourse.vtk.org/t/doesnt-unpkg-com-vtk-js-include-the-vtkseedwidget/16205)

<div class="topic-metadata">

**Author:** [@fdlyj](https://discourse.vtk.org/u/fdlyj)\
**Replies:** 0\
**Last updated:** [January 2, 2026, 4:24am UTC](https://discourse.vtk.org/t/doesnt-unpkg-com-vtk-js-include-the-vtkseedwidget/16205 "2026-01-02T04:24:10Z")

</div>

Doesn’t unpkg.com/vtk.js include the vtkSeedWidget?

---

## [Hide cells in vtk.js](https://discourse.vtk.org/t/hide-cells-in-vtk-js/15735)

<div class="topic-metadata">

**Author:** [@davsch](https://discourse.vtk.org/u/davsch)\
**Replies:** 11\
**Last updated:** [December 31, 2025, 6:20am UTC](https://discourse.vtk.org/t/hide-cells-in-vtk-js/15735 "2025-12-31T06:20:20Z")

</div>

Is there a way to hide specific cells in vtk.js? Something like scalar celldata with a specific value don’t get rendered. Already tried assigning alpha value to a LUT or hiding specific points with ThresholdPoints and …

---

## [Reslice Cursor Widget Mapper About](https://discourse.vtk.org/t/reslice-cursor-widget-mapper-about/16181)

<div class="topic-metadata">

**Author:** [@selimcanozgur](https://discourse.vtk.org/u/selimcanozgur)\
**Replies:** 1\
**Last updated:** [December 18, 2025, 5:24pm UTC](https://discourse.vtk.org/t/reslice-cursor-widget-mapper-about/16181 "2025-12-18T17:24:31Z")

</div>

I’m using VTK.JS in my project, and when I try to add the reslice cursor widget feature and display it in a rotated (oblique) section, it seems to require resliceImageMapper. However, my drawings are created using Ima…

---

## [How to change the position of scalar bar on VTK.js](https://discourse.vtk.org/t/how-to-change-the-position-of-scalar-bar-on-vtk-js/13082)

<div class="topic-metadata">

**Author:** [@Ossama\_Elbelamachi](https://discourse.vtk.org/u/Ossama_Elbelamachi)\
**Replies:** 2\
**Last updated:** [November 5, 2025, 12:41pm UTC](https://discourse.vtk.org/t/how-to-change-the-position-of-scalar-bar-on-vtk-js/13082 "2025-11-05T12:41:52Z")

</div>

Hello Everyone I hope you are doing well How can change the position of the scalar bar to be fixed to the bottom of the canvas I tried to use the vtkScalarBarActor and set the bar position using the setBarPosition meth…

---

## [vtk.js: Image renders black, but Cube renders fine – vtkImageData + vtkImageSlice issue](https://discourse.vtk.org/t/vtk-js-image-renders-black-but-cube-renders-fine-vtkimagedata-vtkimageslice-issue/16097)

<div class="topic-metadata">

**Author:** [@vojtech](https://discourse.vtk.org/u/vojtech)\
**Replies:** 1\
**Last updated:** [October 20, 2025, 3:19pm UTC](https://discourse.vtk.org/t/vtk-js-image-renders-black-but-cube-renders-fine-vtkimagedata-vtkimageslice-issue/16097 "2025-10-20T15:19:39Z")

</div>

I’m using vtk.js inside a React component to render a 2D image slice using vtkImageData and vtkImageSlice. While 3D geometry primitives like vtkCubeSource render correctly (e.g., a cube appears as expected), my 2D image …

---

## [How to access resliced image data from vtkImageResliceMapper in VTK.js](https://discourse.vtk.org/t/how-to-access-resliced-image-data-from-vtkimagereslicemapper-in-vtk-js/16078)

<div class="topic-metadata">

**Author:** [@shuj](https://discourse.vtk.org/u/shuj)\
**Replies:** 3\
**Last updated:** [October 6, 2025, 7:15pm UTC](https://discourse.vtk.org/t/how-to-access-resliced-image-data-from-vtkimagereslicemapper-in-vtk-js/16078 "2025-10-06T19:15:59Z")

</div>

Hi, I’m trying to retrieve pixel data from a slice rendered using vtkImageResliceMapper in VTK.js. Specifically, I want to access the resliced output as a pixel array to count the occurrence of each pixel colour. Initi…

---

## [How to draw UIs on top of the image](https://discourse.vtk.org/t/how-to-draw-uis-on-top-of-the-image/15133)

<div class="topic-metadata">

**Author:** [@shunia](https://discourse.vtk.org/u/shunia)\
**Replies:** 7\
**Last updated:** [October 2, 2025, 10:43pm UTC](https://discourse.vtk.org/t/how-to-draw-uis-on-top-of-the-image/15133 "2025-10-02T22:43:51Z")

</div>

I want to build flexable UIs just like in webgl games that the UIs looks like they are related to the screen rather than the actual 3D objects in the 3D space, and the UIs looks and feels like 2D, as they are just texts,…

---

## [Is VTK.js performance GPU/browser dependent?](https://discourse.vtk.org/t/is-vtk-js-performance-gpu-browser-dependent/16077)

<div class="topic-metadata">

**Author:** [@Pranathi\_Induri](https://discourse.vtk.org/u/Pranathi_Induri)\
**Replies:** 1\
**Last updated:** [October 2, 2025, 4:10pm UTC](https://discourse.vtk.org/t/is-vtk-js-performance-gpu-browser-dependent/16077 "2025-10-02T16:10:41Z")

</div>

Is VTK.js performance dependent on the GPU and browser ? With the same app and data, it runs smoothly on a laptop with an NVIDIA GPU but lags a on an Intel integrated GPU (in Chrome). Are there simple settings or best pr…

---

## [Polydata outline](https://discourse.vtk.org/t/polydata-outline/14708)

<div class="topic-metadata">

**Author:** [@antonskrebkov](https://discourse.vtk.org/u/antonskrebkov)\
**Replies:** 1\
**Last updated:** [September 28, 2025, 10:16am UTC](https://discourse.vtk.org/t/polydata-outline/14708 "2025-09-28T10:16:22Z")

</div>

Hello everyone! Is there a function in vtk.js that would allow making an outline for polydata, but not just a cube in which the figure would be located (as in outlineFilter), but something like a wireframe representatio…

---

## [I need to visualize .vtu file in react using vtk.js,](https://discourse.vtk.org/t/i-need-to-visualize-vtu-file-in-react-using-vtk-js/15002)

<div class="topic-metadata">

**Author:** [@HARIPRASATH\_Y\_S](https://discourse.vtk.org/u/HARIPRASATH_Y_S)\
**Replies:** 1\
**Last updated:** [September 28, 2025, 10:08am UTC](https://discourse.vtk.org/t/i-need-to-visualize-vtu-file-in-react-using-vtk-js/15002 "2025-09-28T10:08:37Z")

</div>

does vtkXmlReader supports that feature, i have tried but it showed error, But for web vtkxmlunstructureGrid is not available, without using vtk-wasm is there any other way to do it… If possible can you please suggest th…

---

## [vtkLineWidget Handle Visible](https://discourse.vtk.org/t/vtklinewidget-handle-visible/15689)

<div class="topic-metadata">

**Author:** [@Taz145](https://discourse.vtk.org/u/Taz145)\
**Replies:** 1\
**Last updated:** [September 28, 2025, 10:05am UTC](https://discourse.vtk.org/t/vtklinewidget-handle-visible/15689 "2025-09-28T10:05:13Z")

</div>

In the source for the vtkLineWidget there are references to being able to make the handles non-visible but still intractable by the user. I am attempting to draw SVG elements where the handles are, the same as glance and…

---

## [Orientation with vtkImageResliceMapper and vtkVolumeMapper](https://discourse.vtk.org/t/orientation-with-vtkimagereslicemapper-and-vtkvolumemapper/15772)

<div class="topic-metadata">

**Author:** [@twilson](https://discourse.vtk.org/u/twilson)\
**Replies:** 1\
**Last updated:** [September 28, 2025, 9:55am UTC](https://discourse.vtk.org/t/orientation-with-vtkimagereslicemapper-and-vtkvolumemapper/15772 "2025-09-28T09:55:55Z")

</div>

I am new to vtk.js and experiencing some unexpected orientation related issues. I have tried my code with both my custom data loader as well as the itk-wasm loader and got the same results in both cases. I am loading a s…

---

## [Using ImageMarchingCubes exceeds the array length limit.](https://discourse.vtk.org/t/using-imagemarchingcubes-exceeds-the-array-length-limit/15808)

<div class="topic-metadata">

**Author:** [@Heisenberg](https://discourse.vtk.org/u/Heisenberg)\
**Replies:** 1\
**Last updated:** [September 28, 2025, 9:49am UTC](https://discourse.vtk.org/t/using-imagemarchingcubes-exceeds-the-array-length-limit/15808 "2025-09-28T09:49:50Z")

</div>

Hello everyone, I have just started learning vtk.js. Due to the large size of my data (210x676x676), when I was using ImageMarchingCubes, I exceeded the array length. Is there any solution to this problem?

---

## [About VTK JS Reslice Cursor Widget](https://discourse.vtk.org/t/about-vtk-js-reslice-cursor-widget/15857)

<div class="topic-metadata">

**Author:** [@selimcanozgur](https://discourse.vtk.org/u/selimcanozgur)\
**Replies:** 1\
**Last updated:** [September 28, 2025, 9:46am UTC](https://discourse.vtk.org/t/about-vtk-js-reslice-cursor-widget/15857 "2025-09-28T09:46:53Z")

</div>

I’m using vtk.js for my project and have integrated the Reslice Cursor Widget feature. We have both NIfTI and Draco data, and all of them are rendered correctly on the screen without any issues. Each NIfTI file has its o…

---

## [Regarding the rendering error of the VTK DataFile Version 5.1 model PolyDataReader](https://discourse.vtk.org/t/regarding-the-rendering-error-of-the-vtk-datafile-version-5-1-model-polydatareader/15961)

<div class="topic-metadata">

**Author:** [@iridescence97](https://discourse.vtk.org/u/iridescence97)\
**Replies:** 1\
**Last updated:** [September 28, 2025, 9:41am UTC](https://discourse.vtk.org/t/regarding-the-rendering-error-of-the-vtk-datafile-version-5-1-model-polydatareader/15961 "2025-09-28T09:41:45Z")

</div>

async function readPolyData(file: File) { const toBlob = new Blob(\[file\]) const fileBlob = URL.createObjectURL(toBlob) const reader = vtkPolyDataReader.newInstance() await reader.setUrl(fileBlob) awa…

---

## [using ImageReslice in js can not get the slice data like ImageSlicing.cxx](https://discourse.vtk.org/t/using-imagereslice-in-js-can-not-get-the-slice-data-like-imageslicing-cxx/16053)

<div class="topic-metadata">

**Author:** [@1009058470](https://discourse.vtk.org/u/1009058470)\
**Replies:** 2\
**Last updated:** [September 24, 2025, 10:34pm UTC](https://discourse.vtk.org/t/using-imagereslice-in-js-can-not-get-the-slice-data-like-imageslicing-cxx/16053 "2025-09-24T22:34:54Z")

</div>

\<!DOCTYPE html\> \<html lang="en"\> \<head\> \<meta charset="UTF-8"\> \<meta name="viewport" content="width=device-width, initial-scale=1.0"\> \<title\>VTK.js (使用ImageReslice)\</title\> \<script src="https://unpkg.com…

---

## [VTKJS Image Filters (Sharpening, Finegrain, etc)](https://discourse.vtk.org/t/vtkjs-image-filters-sharpening-finegrain-etc/16045)

<div class="topic-metadata">

**Author:** [@IbrahimCSAE](https://discourse.vtk.org/u/IbrahimCSAE)\
**Replies:** 2\
**Last updated:** [September 17, 2025, 4:09am UTC](https://discourse.vtk.org/t/vtkjs-image-filters-sharpening-finegrain-etc/16045 "2025-09-17T04:09:41Z")

</div>

Hi, I was wondering if there’s an efficent way to implement image filters using VTKJS. Specially for medical imaging. Filters like fine grain, sharpening, CLAHE, etc. I saw this example in python: https://examples.vtk…

---

## [Rendering mesh](https://discourse.vtk.org/t/rendering-mesh/15566)

<div class="topic-metadata">

**Author:** [@OlumideSamuel](https://discourse.vtk.org/u/OlumideSamuel)\
**Replies:** 1\
**Last updated:** [May 20, 2025, 9:41am UTC](https://discourse.vtk.org/t/rendering-mesh/15566 "2025-05-20T09:41:24Z")

</div>

After an update of my node env to 22.14.0 and update of vtk.js to 26.8.0, and react-vtk-js to 1.18.0, my mesh crashes with the errors Uncaught TypeError: this.polydata is null, Uncaught TypeError: this.scalarBar is nul…

---

## [How to switch from normal mode to smooth mode?](https://discourse.vtk.org/t/how-to-switch-from-normal-mode-to-smooth-mode/15650)

<div class="topic-metadata">

**Author:** [@Bek1](https://discourse.vtk.org/u/Bek1)\
**Replies:** 9\
**Last updated:** [May 19, 2025, 5:09pm UTC](https://discourse.vtk.org/t/how-to-switch-from-normal-mode-to-smooth-mode/15650 "2025-05-19T17:09:02Z")

</div>

Hi. Here is minimal code: function Modal(props: { stlBuffer: ArrayBuffer }) { const vtkContext = useRef\<any\>({}); const vtkContainerRef = useRef(null); useEffect(() =\> { const fullScreenRenderer = vtkFullScr…

---

## [Unable to display an image slice using VTK.js from a VTI image file in React](https://discourse.vtk.org/t/unable-to-display-an-image-slice-using-vtk-js-from-a-vti-image-file-in-react/15620)

<div class="topic-metadata">

**Author:** [@ctroesch](https://discourse.vtk.org/u/ctroesch)\
**Replies:** 2\
**Last updated:** [May 19, 2025, 7:31am UTC](https://discourse.vtk.org/t/unable-to-display-an-image-slice-using-vtk-js-from-a-vti-image-file-in-react/15620 "2025-05-19T07:31:58Z")

</div>

Hi there, I am trying to load a VTI image file in my React/NextJS/VTK.js app, but I am struggling to display a simple slice of the image. I have added an actor to display the outline of the image that works well. This…

---

## [Mapping CPR image pixel coordinates back to world coordinates with vtkImageCPRMapper](https://discourse.vtk.org/t/mapping-cpr-image-pixel-coordinates-back-to-world-coordinates-with-vtkimagecprmapper/15627)

<div class="topic-metadata">

**Author:** [@buls\_brown](https://discourse.vtk.org/u/buls_brown)\
**Replies:** 1\
**Last updated:** [May 15, 2025, 2:29pm UTC](https://discourse.vtk.org/t/mapping-cpr-image-pixel-coordinates-back-to-world-coordinates-with-vtkimagecprmapper/15627 "2025-05-15T14:29:23Z")

</div>

Hi, I’m using vtkImageCPRMapper to generate a curved planar reformation (CPR) image from my 3D volume along a centerline polyline. Now I’d like to take a pixel coordinate (u,v) in the resulting CPR image and find the co…

---

## [How is the centerline orientation used by ImageCPRMapper calculated?](https://discourse.vtk.org/t/how-is-the-centerline-orientation-used-by-imagecprmapper-calculated/15628)

<div class="topic-metadata">

**Author:** [@d\_a](https://discourse.vtk.org/u/d_a)\
**Replies:** 0\
**Last updated:** [May 15, 2025, 11:05am UTC](https://discourse.vtk.org/t/how-is-the-centerline-orientation-used-by-imagecprmapper-calculated/15628 "2025-05-15T11:05:01Z")

</div>

How do I calculate the orientation in aorta\_centerline.json used in the ImageCPRMapper example? I saw in another question the matrix obtained by combining Normal, Tangent and Bitangent, but I don’t know how to calculate …

---

## [vtkPlaneSources as faces for vtkCubeSource](https://discourse.vtk.org/t/vtkplanesources-as-faces-for-vtkcubesource/15532)

<div class="topic-metadata">

**Author:** [@Alex\_Vergara](https://discourse.vtk.org/u/Alex_Vergara)\
**Replies:** 2\
**Last updated:** [April 25, 2025, 2:27pm UTC](https://discourse.vtk.org/t/vtkplanesources-as-faces-for-vtkcubesource/15532 "2025-04-25T14:27:11Z")

</div>

Hello I want to streamline a plane source in each of the faces of a cube source. The objective is to have a rectangular grid which I can use to paint some scalars. I need control on the resolution, but in theory each ax…

---

## [VTK.js ImageData Rendering with react](https://discourse.vtk.org/t/vtk-js-imagedata-rendering-with-react/15463)

<div class="topic-metadata">

**Author:** [@psb01126](https://discourse.vtk.org/u/psb01126)\
**Replies:** 1\
**Last updated:** [April 7, 2025, 7:40pm UTC](https://discourse.vtk.org/t/vtk-js-imagedata-rendering-with-react/15463 "2025-04-07T19:40:13Z")

</div>

Hello, I’m trying to develop a website using Python and react. However, there is a problem that image data is generated normally, but rendering is not possible. When I tested it with the conesource on the vtk homepage,…

[Next page](https://discourse.vtk.org/c/web/vtk-js/11.md?page=1)
