# vtk.js

**URL:** https://discourse.vtk.org/c/web/vtk-js/11.md?page=2

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

**Page:** 3

---

## [Debugging VTK.js Examples with VS Code](https://discourse.vtk.org/t/debugging-vtk-js-examples-with-vs-code/14240)

<div class="topic-metadata">

**Author:** [@vishwa\_gqc](https://discourse.vtk.org/u/vishwa_gqc)\
**Replies:** 0\
**Last updated:** [July 15, 2024, 2:11pm UTC](https://discourse.vtk.org/t/debugging-vtk-js-examples-with-vs-code/14240 "2024-07-15T14:11:45Z")

</div>

Hi everyone, Has anyone successfully debugged VTK.js examples using VS Code, considering the complexity of multiple script runners and Webpack? If so, could you share your configuration and approach? Any advice on integ…

---

## [Integrating 3D Object with Medical Images in VTK.js](https://discourse.vtk.org/t/integrating-3d-object-with-medical-images-in-vtk-js/14113)

<div class="topic-metadata">

**Author:** [@hhdreamer](https://discourse.vtk.org/u/hhdreamer)\
**Replies:** 7\
**Last updated:** [July 3, 2024, 3:09pm UTC](https://discourse.vtk.org/t/integrating-3d-object-with-medical-images-in-vtk-js/14113 "2024-07-03T15:09:53Z")

</div>

I am looking to replicate a workflow I currently use in 3D Slicer on a web-based platform using VTK.js or Cornerstone3D.js. Specifically, I need to view a 3D object file (e.g., OBJ) in conjunction with a medical image fi…

---

## [VTKJS Shading comparison to python](https://discourse.vtk.org/t/vtkjs-shading-comparison-to-python/14108)

<div class="topic-metadata">

**Author:** [@emil-peter](https://discourse.vtk.org/u/emil-peter)\
**Replies:** 11\
**Last updated:** [July 3, 2024, 6:22am UTC](https://discourse.vtk.org/t/vtkjs-shading-comparison-to-python/14108 "2024-07-03T06:22:14Z")

</div>

Hi, I’ve been experimenting with visualizations in python and VTKjs but can’t reproduce some of the features I achieve in python in VTK js. In python I’m able to get the following super-smooth shading, with the followi…

---

## [How to adjust interactor style behavior for vtkRemoteView](https://discourse.vtk.org/t/how-to-adjust-interactor-style-behavior-for-vtkremoteview/14125)

<div class="topic-metadata">

**Author:** [@RobertHabrich](https://discourse.vtk.org/u/RobertHabrich)\
**Replies:** 4\
**Last updated:** [June 28, 2024, 2:03pm UTC](https://discourse.vtk.org/t/how-to-adjust-interactor-style-behavior-for-vtkremoteview/14125 "2024-06-28T14:03:34Z")

</div>

I’m successfully using vtkRemoteView to display images rendered in a (C++) server application. Now I would like to change some of the default interaction behavior. E.g. as a first step I would like to suppress right-clic…

---

## [Align vtkCutter with Actor Orientation in VTK.js](https://discourse.vtk.org/t/align-vtkcutter-with-actor-orientation-in-vtk-js/14126)

<div class="topic-metadata">

**Author:** [@hhdreamer](https://discourse.vtk.org/u/hhdreamer)\
**Replies:** 1\
**Last updated:** [June 27, 2024, 4:51pm UTC](https://discourse.vtk.org/t/align-vtkcutter-with-actor-orientation-in-vtk-js/14126 "2024-06-27T16:51:57Z")

</div>

Hello, I’m working on a project using VTK.js within a React environment, and I’ve encountered an issue with the vtkCutter component. The cutter works perfectly under normal circumstances, but it fails to update its cutt…

---

## [Some about LineWidget questions](https://discourse.vtk.org/t/some-about-linewidget-questions/14116)

<div class="topic-metadata">

**Author:** [@winning](https://discourse.vtk.org/u/winning)\
**Replies:** 0\
**Last updated:** [June 26, 2024, 6:25am UTC](https://discourse.vtk.org/t/some-about-linewidget-questions/14116 "2024-06-26T06:25:56Z")

</div>

When I add a LineWidget to the VTK model, the first time I click the mouse, an exception occurs: 2. When I add multiple LineWidgets, the rotation of the vtk model will lag 3.I use 25.14.0,the UI screenshot is in attach…

---

## [Can't move/resize vtkEllipseWidget](https://discourse.vtk.org/t/cant-move-resize-vtkellipsewidget/14078)

<div class="topic-metadata">

**Author:** [@npadula](https://discourse.vtk.org/u/npadula)\
**Replies:** 0\
**Last updated:** [June 18, 2024, 7:31pm UTC](https://discourse.vtk.org/t/cant-move-resize-vtkellipsewidget/14078 "2024-06-18T19:31:07Z")

</div>

Hello everyone. I’m working on a widget serialization/deserialization feature. I’m able to create a widget out of serialized state by doing this: const widget = vtkEllipseWidget.newInstance() const widgetRep = w…

---

## [Please either change the volumeMapper sampleDistance or its maximum number of samples.](https://discourse.vtk.org/t/please-either-change-the-volumemapper-sampledistance-or-its-maximum-number-of-samples/14058)

<div class="topic-metadata">

**Author:** [@aleaf2023](https://discourse.vtk.org/u/aleaf2023)\
**Replies:** 2\
**Last updated:** [June 17, 2024, 10:35am UTC](https://discourse.vtk.org/t/please-either-change-the-volumemapper-sampledistance-or-its-maximum-number-of-samples/14058 "2024-06-17T10:35:12Z")

</div>

The number of steps required 1479 is larger than the specified maximum number of steps 1000. Please either change the volumeMapper sampleDistance or its maximum number of samples.

---

## [Proper way of using DataAccessHelper to fetch binary data](https://discourse.vtk.org/t/proper-way-of-using-dataaccesshelper-to-fetch-binary-data/14036)

<div class="topic-metadata">

**Author:** [@DontSeeSharp](https://discourse.vtk.org/u/DontSeeSharp)\
**Replies:** 0\
**Last updated:** [June 13, 2024, 10:38am UTC](https://discourse.vtk.org/t/proper-way-of-using-dataaccesshelper-to-fetch-binary-data/14036 "2024-06-13T10:38:08Z")

</div>

In order to access the data, I often see something similar in javascript code: import vtkLiteHttpDataAccessHelper from '@kitware/vtk.js/IO/Core/DataAccessHelper/LiteHttpDataAccessHelper'; const zipFileData = await vtkL…

---

## [retrieving coordinates, k-d trees and octrees](https://discourse.vtk.org/t/retrieving-coordinates-k-d-trees-and-octrees/13985)

<div class="topic-metadata">

**Author:** [@agustindasilvaR](https://discourse.vtk.org/u/agustindasilvaR)\
**Replies:** 0\
**Last updated:** [June 5, 2024, 12:18pm UTC](https://discourse.vtk.org/t/retrieving-coordinates-k-d-trees-and-octrees/13985 "2024-06-05T12:18:43Z")

</div>

Looking for the optimal way to retrieve the “x”, “y”, “z” coordinates of a 3D model using vtk.js whenever I click on it. Already kind of did the thing using vtkCellPicker, but it takes like half a second or a little bit …

---

## [Trouble when alternating scalar colors](https://discourse.vtk.org/t/trouble-when-alternating-scalar-colors/13979)

<div class="topic-metadata">

**Author:** [@agustindasilvaR](https://discourse.vtk.org/u/agustindasilvaR)\
**Replies:** 0\
**Last updated:** [June 4, 2024, 1:10pm UTC](https://discourse.vtk.org/t/trouble-when-alternating-scalar-colors/13979 "2024-06-04T13:10:13Z")

</div>

I’m currently working on an React application using vtk.js for 3D visualization. For the 3D models i am using .vtp files which share a similar structure: both contain values for magnitude 1, and magnitude 2 difference …

---

## [Using itk wasm to convert NII files into VTK format data, but unable to render](https://discourse.vtk.org/t/using-itk-wasm-to-convert-nii-files-into-vtk-format-data-but-unable-to-render/13970)

<div class="topic-metadata">

**Author:** [@Xinyu\_Fang](https://discourse.vtk.org/u/Xinyu_Fang)\
**Replies:** 0\
**Last updated:** [June 3, 2024, 9:34am UTC](https://discourse.vtk.org/t/using-itk-wasm-to-convert-nii-files-into-vtk-format-data-but-unable-to-render/13970 "2024-06-03T09:34:18Z")

</div>

Hi everyone， I need to know how to use vtk.js to load. NII image support. After consulting the official documentation. I should have successfully read the itk image data and passed it to the vtk.js renderer, but the pag…

---

## [vtkResliceCursorWidget for object oriented bounding box](https://discourse.vtk.org/t/vtkreslicecursorwidget-for-object-oriented-bounding-box/13937)

<div class="topic-metadata">

**Author:** [@gvalenzuela](https://discourse.vtk.org/u/gvalenzuela)\
**Replies:** 0\
**Last updated:** [May 26, 2024, 12:26pm UTC](https://discourse.vtk.org/t/vtkreslicecursorwidget-for-object-oriented-bounding-box/13937 "2024-05-26T12:26:26Z")

</div>

Hi all, I image a DICOM volume not oriented to the axis, and when I use vtkResliceCursorWidget with vtkImageReslice, the default planes of vtkResliceCursorWidget are not aligned to the axes of the OBB of the image, if I…

---

## [in vtk.js,can i achieve an effect similar to VTK's vtkImageMask? And clip model when i draw an irregular area？](https://discourse.vtk.org/t/in-vtk-js-can-i-achieve-an-effect-similar-to-vtks-vtkimagemask-and-clip-model-when-i-draw-an-irregular-area/13893)

<div class="topic-metadata">

**Author:** [@zfzlzh](https://discourse.vtk.org/u/zfzlzh)\
**Replies:** 2\
**Last updated:** [May 17, 2024, 2:42am UTC](https://discourse.vtk.org/t/in-vtk-js-can-i-achieve-an-effect-similar-to-vtks-vtkimagemask-and-clip-model-when-i-draw-an-irregular-area/13893 "2024-05-17T02:42:18Z")

</div>

hello everone,i have some question, first,can i achieve an effect similar to VTK’s vtkImageMask? i create a model with vtkVolume and vtkVolumeMapper, and i have a mask, mask is from .nii.gz file, i use itk-wasm’s …

---

## [Problem with vtkImageSlice and vtkPicker.js](https://discourse.vtk.org/t/problem-with-vtkimageslice-and-vtkpicker-js/13869)

<div class="topic-metadata">

**Author:** [@gvalenzuela](https://discourse.vtk.org/u/gvalenzuela)\
**Replies:** 0\
**Last updated:** [May 12, 2024, 3:35pm UTC](https://discourse.vtk.org/t/problem-with-vtkimageslice-and-vtkpicker-js/13869 "2024-05-12T15:35:33Z")

</div>

Hi guys, I am trying to add a mouse to world coordinates detection with vtkPicker, to get the pixel on reslice that the mouse is passing, to example: but it detect the intersection around a margin outside of the slice…

---

## [renderWindowInteractor.setView throws: 'TypeError: model.\_view.getRenderable is not a function'](https://discourse.vtk.org/t/renderwindowinteractor-setview-throws-typeerror-model-view-getrenderable-is-not-a-function/13755)

<div class="topic-metadata">

**Author:** [@adia](https://discourse.vtk.org/u/adia)\
**Replies:** 0\
**Last updated:** [April 20, 2024, 9:24am UTC](https://discourse.vtk.org/t/renderwindowinteractor-setview-throws-typeerror-model-view-getrenderable-is-not-a-function/13755 "2024-04-20T09:24:16Z")

</div>

I’m trying this code: const renderer = vtkRenderer.newInstance(); const renderWindow = vtkRenderWindow.newInstance(); renderWindow.addRenderer(renderer); const renderWindowInteractor = vtkRenderWindowInteractor.newIn…

---

## [Widget on single view with many renderers](https://discourse.vtk.org/t/widget-on-single-view-with-many-renderers/13748)

<div class="topic-metadata">

**Author:** [@Xoz](https://discourse.vtk.org/u/Xoz)\
**Replies:** 0\
**Last updated:** [April 19, 2024, 10:13am UTC](https://discourse.vtk.org/t/widget-on-single-view-with-many-renderers/13748 "2024-04-19T10:13:43Z")

</div>

Hi everyone, I’m working on a feature to add measure widget(distance, angle, …etc) on a single view that use many renderers (the reason to use many renderers is if I split them into individual views the number of webgl …

---

## [Use vtk.js to render point clouds, why dynamically update one point will not display normally, update two or more points can display normally](https://discourse.vtk.org/t/use-vtk-js-to-render-point-clouds-why-dynamically-update-one-point-will-not-display-normally-update-two-or-more-points-can-display-normally/12314)

<div class="topic-metadata">

**Author:** [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)\
**Replies:** 3\
**Last updated:** [April 16, 2024, 2:17pm UTC](https://discourse.vtk.org/t/use-vtk-js-to-render-point-clouds-why-dynamically-update-one-point-will-not-display-normally-update-two-or-more-points-can-display-normally/12314 "2024-04-16T14:17:21Z")

</div>

Here’s an example： const points = vtkPoints.newInstance(); const polyData= vtkPolyData.newInstance(); const polyDataActor = vtkActor.newInstance(); polyData.setPoints(points); sphereSource = vtkSphereSource.newInsta…

---

## [Implementing Crosshair Movement on Mouse Click in MPR Viewer Using vtlResliceCursorWidget](https://discourse.vtk.org/t/implementing-crosshair-movement-on-mouse-click-in-mpr-viewer-using-vtlreslicecursorwidget/12770)

<div class="topic-metadata">

**Author:** [@RajKanjariya](https://discourse.vtk.org/u/RajKanjariya)\
**Replies:** 5\
**Last updated:** [April 11, 2024, 2:34am UTC](https://discourse.vtk.org/t/implementing-crosshair-movement-on-mouse-click-in-mpr-viewer-using-vtlreslicecursorwidget/12770 "2024-04-11T02:34:57Z")

</div>

I am currently working on a project that involves implementing a functionality in the MPR viewer. Specifically, I am using the vtlResliceCursorWidget and aiming to synchronize the crosshair movement with mouse clicks in …

---

## [Setting opacity to zero for a .vti image](https://discourse.vtk.org/t/setting-opacity-to-zero-for-a-vti-image/13664)

<div class="topic-metadata">

**Author:** [@antonskrebkov](https://discourse.vtk.org/u/antonskrebkov)\
**Replies:** 10\
**Last updated:** [April 9, 2024, 1:32pm UTC](https://discourse.vtk.org/t/setting-opacity-to-zero-for-a-vti-image/13664 "2024-04-09T13:32:21Z")

</div>

Hi all! I have a .vti image that was converted from a .vtu file using python. In the Paraview application, when reading this image, taking into account the following parameters: I can read the image and get a blue …

---

## [vtk.js GenericRenderWindow MWE](https://discourse.vtk.org/t/vtk-js-genericrenderwindow-mwe/13654)

<div class="topic-metadata">

**Author:** [@zemmyang](https://discourse.vtk.org/u/zemmyang)\
**Replies:** 0\
**Last updated:** [March 30, 2024, 1:29pm UTC](https://discourse.vtk.org/t/vtk-js-genericrenderwindow-mwe/13654 "2024-03-30T13:29:43Z")

</div>

Hi! I’m trying to get a very minimal example of a vtk.js application on a div with a specified height and width (i.e., not fullscreen), but I seem to be missing something. Here’s my code so far. I’m also sure that I sho…

---

## [setHole in vtkResliceCursorWidget](https://discourse.vtk.org/t/sethole-in-vtkreslicecursorwidget/13618)

<div class="topic-metadata">

**Author:** [@Martin\_Erler](https://discourse.vtk.org/u/Martin_Erler)\
**Replies:** 2\
**Last updated:** [March 22, 2024, 10:25am UTC](https://discourse.vtk.org/t/sethole-in-vtkreslicecursorwidget/13618 "2024-03-22T10:25:32Z")

</div>

Hi, Is there a solution to use setHole() like in the vtk cpp Version? VTK: vtkResliceCursorWidget Class Reference …The hairs may have a hole in the center… Or is it possible to write my own ResliceCursorWidget with…

---

## [Question about bufferObject](https://discourse.vtk.org/t/question-about-bufferobject/13487)

<div class="topic-metadata">

**Author:** [@Xoz](https://discourse.vtk.org/u/Xoz)\
**Replies:** 5\
**Last updated:** [March 20, 2024, 10:54am UTC](https://discourse.vtk.org/t/question-about-bufferobject/13487 "2024-03-20T10:54:59Z")

</div>

Hi everyone, I’m doing some inplements to combine sculptgl tools and vtk recently, and I noticed that the sculptgl has a way to deal with vbo, thatis it does not enlarge the size of the element array each time the eleme…

---

## [Can we change handle and trail colors for paint widget?](https://discourse.vtk.org/t/can-we-change-handle-and-trail-colors-for-paint-widget/13573)

<div class="topic-metadata">

**Author:** [@burak94t](https://discourse.vtk.org/u/burak94t)\
**Replies:** 2\
**Last updated:** [March 18, 2024, 8:47pm UTC](https://discourse.vtk.org/t/can-we-change-handle-and-trail-colors-for-paint-widget/13573 "2024-03-18T20:47:58Z")

</div>

I did take look at the docs and examples, but I can’t find anything about it. The circle is always blue and trails are green, also when I set to active label to 0, handle is not visible. Is there anyway to make the pain…

---

## [How to rectify misalignment of vtp files?](https://discourse.vtk.org/t/how-to-rectify-misalignment-of-vtp-files/13554)

<div class="topic-metadata">

**Author:** [@sunita](https://discourse.vtk.org/u/sunita)\
**Replies:** 5\
**Last updated:** [March 17, 2024, 2:12am UTC](https://discourse.vtk.org/t/how-to-rectify-misalignment-of-vtp-files/13554 "2024-03-17T02:12:28Z")

</div>

Dear Aron and Sebastien, How to align the bundle as shown in the attached figure inside the hollow brain vtp file? We are stuck at this point. If you need the code and the files we can provide the same. We need this …

---

## [Reconstruction of cortical brain surface in 3D](https://discourse.vtk.org/t/reconstruction-of-cortical-brain-surface-in-3d/13503)

<div class="topic-metadata">

**Author:** [@sunita](https://discourse.vtk.org/u/sunita)\
**Replies:** 0\
**Last updated:** [March 11, 2024, 12:58pm UTC](https://discourse.vtk.org/t/reconstruction-of-cortical-brain-surface-in-3d/13503 "2024-03-11T12:58:16Z")

</div>

Dear Aron, I need your help again. Could you please help me on how to reconstruct cortical brain 3D image from structural MRI and save it as .vtp file? Cortical surface should look like the attached image. Thank y…

---

## [how to get raw point from CPR](https://discourse.vtk.org/t/how-to-get-raw-point-from-cpr/13486)

<div class="topic-metadata">

**Author:** [@zfzlzh](https://discourse.vtk.org/u/zfzlzh)\
**Replies:** 0\
**Last updated:** [March 8, 2024, 9:55am UTC](https://discourse.vtk.org/t/how-to-get-raw-point-from-cpr/13486 "2024-03-08T09:55:09Z")

</div>

i created CPR view follows the ImageCPRMapper example, and bind the onLeftButtonPress event to the interactor to get the coordinates of the click, I used openGLRenderWindow’s displayToWorld method to transform the coor…

---

## [How to keep original color even after VTP conversion?](https://discourse.vtk.org/t/how-to-keep-original-color-even-after-vtp-conversion/13408)

<div class="topic-metadata">

**Author:** [@sunita](https://discourse.vtk.org/u/sunita)\
**Replies:** 5\
**Last updated:** [March 4, 2024, 6:26am UTC](https://discourse.vtk.org/t/how-to-keep-original-color-even-after-vtp-conversion/13408 "2024-03-04T06:26:43Z")

</div>

Dear VTK-developer, How to visualize VTP file with its original color? We are using geometry viewer to visualize .VTP file however we did not find any option to keep the original color. We would like to keep the origin…

---

## [how can i do for correlate MPR with CPR](https://discourse.vtk.org/t/how-can-i-do-for-correlate-mpr-with-cpr/13420)

<div class="topic-metadata">

**Author:** [@zfzlzh](https://discourse.vtk.org/u/zfzlzh)\
**Replies:** 0\
**Last updated:** [March 1, 2024, 3:09am UTC](https://discourse.vtk.org/t/how-can-i-do-for-correlate-mpr-with-cpr/13420 "2024-03-01T03:09:38Z")

</div>

Hi everyone,i need some help. I want to correlate MPR with CPR, when i click on the CPR view,the MPR view needs to jump to the corresponding image and move the crosshair to the corresponding position. when i click on …

---

## [Loading .nii files in vtk.js using itk-wasm](https://discourse.vtk.org/t/loading-nii-files-in-vtk-js-using-itk-wasm/12224)

<div class="topic-metadata">

**Author:** [@vax](https://discourse.vtk.org/u/vax)\
**Replies:** 2\
**Last updated:** [February 26, 2024, 9:21pm UTC](https://discourse.vtk.org/t/loading-nii-files-in-vtk-js-using-itk-wasm/12224 "2024-02-26T21:21:26Z")

</div>

Hi everyone, I need support understanding how to load .nii images using vtk.js. After going through some of the posts and conversations. I believe the way to do it is reading an array buffer into an itk image and then p…

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

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