# vtk.js

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

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

**Page:** 4

---

## [The surface exceeds the contour range](https://discourse.vtk.org/t/the-surface-exceeds-the-contour-range/13333)

<div class="topic-metadata">

**Author:** [@sheonny](https://discourse.vtk.org/u/sheonny)\
**Replies:** 3\
**Last updated:** [February 26, 2024, 6:21am UTC](https://discourse.vtk.org/t/the-surface-exceeds-the-contour-range/13333 "2024-02-26T06:21:13Z")

</div>

I want to convert vtkCutter’s cutting results to surface， First，I use vtkClosedPolyLineToSurfaceFilter，give the result as follows The surface exceeds the contour range！Is there a better way to solve this problem?

---

## [vtkAnnotatedCubeActor handle clicked face](https://discourse.vtk.org/t/vtkannotatedcubeactor-handle-clicked-face/13346)

<div class="topic-metadata">

**Author:** [@Vixen](https://discourse.vtk.org/u/Vixen)\
**Replies:** 1\
**Last updated:** [February 23, 2024, 2:42pm UTC](https://discourse.vtk.org/t/vtkannotatedcubeactor-handle-clicked-face/13346 "2024-02-23T14:42:02Z")

</div>

is there a way to get which face of the vtkAnnotatedCubeActor has been clicked? trying to use a CellPicker as described here results in a pickedCellId = -1 regardless of which face has been clicked? what I am trying …

---

## [vtkRenderer.setPreserveColorBuffer typo in either the .d.ts or the .js, same with setPreserveDepthBuffer](https://discourse.vtk.org/t/vtkrenderer-setpreservecolorbuffer-typo-in-either-the-d-ts-or-the-js-same-with-setpreservedepthbuffer/13303)

<div class="topic-metadata">

**Author:** [@JohnSkinner](https://discourse.vtk.org/u/JohnSkinner)\
**Replies:** 0\
**Last updated:** [February 12, 2024, 1:31pm UTC](https://discourse.vtk.org/t/vtkrenderer-setpreservecolorbuffer-typo-in-either-the-d-ts-or-the-js-same-with-setpreservedepthbuffer/13303 "2024-02-12T13:31:03Z")

</div>

The typescript declaration file for vtkRenderer (the .d.ts) declares setPreserveColorBuffer // with big ‘B’, but the javascript definition uses setPreserveColorbuffer // with little ‘b’. So for now I @ts-ignore to work…

---

## [vtkCutter: How to Separate Groups of Points in Multiple Contour Results in vtk.js](https://discourse.vtk.org/t/vtkcutter-how-to-separate-groups-of-points-in-multiple-contour-results-in-vtk-js/13088)

<div class="topic-metadata">

**Author:** [@Alireza](https://discourse.vtk.org/u/Alireza)\
**Replies:** 5\
**Last updated:** [February 1, 2024, 6:58pm UTC](https://discourse.vtk.org/t/vtkcutter-how-to-separate-groups-of-points-in-multiple-contour-results-in-vtk-js/13088 "2024-02-01T18:58:48Z")

</div>

How to get the groups of points out of the vtkCutter when there is more than one contour as the result For instance in this example, If i manipulate the planes/origin and the result be more than one closed contour, I wo…

---

## [How to read and display .mhd , .zraw dataset using vtk.js ?](https://discourse.vtk.org/t/how-to-read-and-display-mhd-zraw-dataset-using-vtk-js/13213)

<div class="topic-metadata">

**Author:** [@Samuel-san](https://discourse.vtk.org/u/Samuel-san)\
**Replies:** 0\
**Last updated:** [February 1, 2024, 1:35am UTC](https://discourse.vtk.org/t/how-to-read-and-display-mhd-zraw-dataset-using-vtk-js/13213 "2024-02-01T01:35:30Z")

</div>

Hello everyone, please I want to be able to read and display .mhd , .zraw dataset using vtk.js, but I coudn’t. I saw online that I can use vtkXMLImageDataReader but still does not work. Someone to help me out please ? …

---

## [How to use ImageCroppingWidget ez](https://discourse.vtk.org/t/how-to-use-imagecroppingwidget-ez/13036)

<div class="topic-metadata">

**Author:** [@iorileslie](https://discourse.vtk.org/u/iorileslie)\
**Replies:** 0\
**Last updated:** [January 9, 2024, 10:43am UTC](https://discourse.vtk.org/t/how-to-use-imagecroppingwidget-ez/13036 "2024-01-09T10:43:38Z")

</div>

I am a beginner in vtk.js I have a name.vtkjs file. I try to use ‘ImageCroppingWidget’, but it does not work. there are some examples,but for \*\*.vti file

---

## [Error occurs when using vtkPixelSpaceCallbackMapper with TypeScript](https://discourse.vtk.org/t/error-occurs-when-using-vtkpixelspacecallbackmapper-with-typescript/12853)

<div class="topic-metadata">

**Author:** [@mkubota](https://discourse.vtk.org/u/mkubota)\
**Replies:** 2\
**Last updated:** [December 28, 2023, 8:51pm UTC](https://discourse.vtk.org/t/error-occurs-when-using-vtkpixelspacecallbackmapper-with-typescript/12853 "2023-12-28T20:51:18Z")

</div>

I tried this example in typescript, but below error occured. SphereAndLabels.ts:44:22 - error TS2345: Argument of type '(coordsList: any) =\> void' is not assignable to parameter of type '() =\> any'. Target signature p…

---

## [volume rendering issues with two objects](https://discourse.vtk.org/t/volume-rendering-issues-with-two-objects/12922)

<div class="topic-metadata">

**Author:** [@gzt036](https://discourse.vtk.org/u/gzt036)\
**Replies:** 3\
**Last updated:** [December 19, 2023, 7:25am UTC](https://discourse.vtk.org/t/volume-rendering-issues-with-two-objects/12922 "2023-12-19T07:25:48Z")

</div>

loading two volumes and place them separately, you will see the rendering issues with z-order. basically the one on top will always blocking the other one, no matter what direction you look at. Could this be fixe…

---

## [Disable/Reset orientation of the Vtp file](https://discourse.vtk.org/t/disable-reset-orientation-of-the-vtp-file/12923)

<div class="topic-metadata">

**Author:** [@Ossama\_Elbelamachi](https://discourse.vtk.org/u/Ossama_Elbelamachi)\
**Replies:** 1\
**Last updated:** [December 18, 2023, 4:20pm UTC](https://discourse.vtk.org/t/disable-reset-orientation-of-the-vtp-file/12923 "2023-12-18T16:20:19Z")

</div>

Hello everyone, I’m using vtk.js to render a vtp file in Reactjs app. I’m trying to reset the orientation of the object but it’s not working at all I tried to set the orientation to 0 0 0 ( actor.setOrientation(0,0,0), …

---

## [Efficient Extraction of Single Slices from 3D Image Data without Scalar Data Looping](https://discourse.vtk.org/t/efficient-extraction-of-single-slices-from-3d-image-data-without-scalar-data-looping/12886)

<div class="topic-metadata">

**Author:** [@Alireza](https://discourse.vtk.org/u/Alireza)\
**Replies:** 0\
**Last updated:** [December 12, 2023, 4:24pm UTC](https://discourse.vtk.org/t/efficient-extraction-of-single-slices-from-3d-image-data-without-scalar-data-looping/12886 "2023-12-12T16:24:13Z")

</div>

What is the quickest method to extract a single slice from any axis of the 3D imageData? For example, if I need slice number 10 in the J direction of the imageData, I prefer to avoid the need for looping over scalar data…

---

## [An error occurs when using “USE\_CELL\_DATA” scalarMode to color the object](https://discourse.vtk.org/t/an-error-occurs-when-using-use-cell-data-scalarmode-to-color-the-object/12856)

<div class="topic-metadata">

**Author:** [@yuki](https://discourse.vtk.org/u/yuki)\
**Replies:** 0\
**Last updated:** [December 6, 2023, 3:37am UTC](https://discourse.vtk.org/t/an-error-occurs-when-using-use-cell-data-scalarmode-to-color-the-object/12856 "2023-12-06T03:37:03Z")

</div>

An object was established by using vtkjs, which is shown in the figure below. And from the mapper, we know that the numberOfPoints of this model is 3, and the numberOfCells is 2 (All cells are lines). We used the cod…

---

## [VTKJS is so slow on MAC](https://discourse.vtk.org/t/vtkjs-is-so-slow-on-mac/12842)

<div class="topic-metadata">

**Author:** [@LY226](https://discourse.vtk.org/u/LY226)\
**Replies:** 0\
**Last updated:** [December 5, 2023, 2:39am UTC](https://discourse.vtk.org/t/vtkjs-is-so-slow-on-mac/12842 "2023-12-05T02:39:53Z")

</div>

When VTKJS renders a large grid, it is stuck on a specific MAC, and Threejs can be rendered smoothly. (1) Under the mac, Firefox and Safair can be rendered smoothly; (2) Chrome can also be rendered smoothly when the user…

---

## [How to render a surface based on the coordinate data of multiple points](https://discourse.vtk.org/t/how-to-render-a-surface-based-on-the-coordinate-data-of-multiple-points/12768)

<div class="topic-metadata">

**Author:** [@zhangzhi93](https://discourse.vtk.org/u/zhangzhi93)\
**Replies:** 1\
**Last updated:** [November 23, 2023, 10:16pm UTC](https://discourse.vtk.org/t/how-to-render-a-surface-based-on-the-coordinate-data-of-multiple-points/12768 "2023-11-23T22:16:51Z")

</div>

I have some coordinate points, and I have rendered the point cloud image, but now the requirements have changed. I want to render a surface according to these points. I use vtkTriangleFilter to achieve it, and found that…

---

## [vtkPolyData translate Data](https://discourse.vtk.org/t/vtkpolydata-translate-data/12748)

<div class="topic-metadata">

**Author:** [@0ZzYy0](https://discourse.vtk.org/u/0ZzYy0)\
**Replies:** 3\
**Last updated:** [November 23, 2023, 12:10am UTC](https://discourse.vtk.org/t/vtkpolydata-translate-data/12748 "2023-11-23T00:10:49Z")

</div>

I applied a translation matrix to the data of PolyData, but CellPicker could not pick up the translated model after translation, I want to know what position did not update to cause this problem?

---

## [vtkLineWidget Modify Line Color ?](https://discourse.vtk.org/t/vtklinewidget-modify-line-color/12754)

<div class="topic-metadata">

**Author:** [@sheonny](https://discourse.vtk.org/u/sheonny)\
**Replies:** 2\
**Last updated:** [November 20, 2023, 12:10pm UTC](https://discourse.vtk.org/t/vtklinewidget-modify-line-color/12754 "2023-11-20T12:10:17Z")

</div>

May I ask how to modify the line color for vtkLineWidget

---

## [PBR Example in VTK.js don't work](https://discourse.vtk.org/t/pbr-example-in-vtk-js-dont-work/12716)

<div class="topic-metadata">

**Author:** [@user12345](https://discourse.vtk.org/u/user12345)\
**Replies:** 3\
**Last updated:** [November 17, 2023, 6:01pm UTC](https://discourse.vtk.org/t/pbr-example-in-vtk-js-dont-work/12716 "2023-11-17T18:01:59Z")

</div>

I can’t seem to get the PBR example to work, nor can I run the example code on my machine and see the example display PBR. In both cases, I can fiddle with the colour and the fov, but none of the pbr settings actually wo…

---

## [how to use rotateX in volume rendering](https://discourse.vtk.org/t/how-to-use-rotatex-in-volume-rendering/8850)

<div class="topic-metadata">

**Author:** [@gzt036](https://discourse.vtk.org/u/gzt036)\
**Replies:** 25\
**Last updated:** [November 14, 2023, 12:43am UTC](https://discourse.vtk.org/t/how-to-use-rotatex-in-volume-rendering/8850 "2023-11-14T00:43:34Z")

</div>

The volume actor renders fine to begin with. However, once I rotate it (uncomment the rotateX line) it looks terrible and wrong, why is that? const actor = imageDataToVol3D(image\_data\_obj); renderer.addActor(actor); //a…

---

## [Volume Contour with Image Cropping Widget simultaneously (vtk.js)](https://discourse.vtk.org/t/volume-contour-with-image-cropping-widget-simultaneously-vtk-js/12698)

<div class="topic-metadata">

**Author:** [@albanez](https://discourse.vtk.org/u/albanez)\
**Replies:** 0\
**Last updated:** [November 13, 2023, 9:05pm UTC](https://discourse.vtk.org/t/volume-contour-with-image-cropping-widget-simultaneously-vtk-js/12698 "2023-11-13T21:05:35Z")

</div>

Hello i’m new to vtk and i working in a project that we need to load a model from dicom files and be able to do some basic features, some of kitware github examples are exactly what we need. Image Cropping and Volume Con…

---

## [What is the best way to get screen coordinates in a react application?](https://discourse.vtk.org/t/what-is-the-best-way-to-get-screen-coordinates-in-a-react-application/12682)

<div class="topic-metadata">

**Author:** [@rodrigobasilio2022](https://discourse.vtk.org/u/rodrigobasilio2022)\
**Replies:** 1\
**Last updated:** [November 10, 2023, 9:56pm UTC](https://discourse.vtk.org/t/what-is-the-best-way-to-get-screen-coordinates-in-a-react-application/12682 "2023-11-10T21:56:41Z")

</div>

If I am in a react application, how do I convert the canvas coordinates of an htmldiv object into vtk coordinates in order to use it in a picker operation?

---

## [ImageReslice behave](https://discourse.vtk.org/t/imagereslice-behave/12610)

<div class="topic-metadata">

**Author:** [@Xoz](https://discourse.vtk.org/u/Xoz)\
**Replies:** 3\
**Last updated:** [November 9, 2023, 1:13pm UTC](https://discourse.vtk.org/t/imagereslice-behave/12610 "2023-11-09T13:13:40Z")

</div>

Hi everyone, I’ve met an issue when using ImageReslice, it’s like this, I have a cursor to control the resliceAxes of the resclice, when it is located at some position which makes the cutting plane be close to standard …

---

## [How to pick widget inside square](https://discourse.vtk.org/t/how-to-pick-widget-inside-square/12545)

<div class="topic-metadata">

**Author:** [@Nosnickers](https://discourse.vtk.org/u/Nosnickers)\
**Replies:** 3\
**Last updated:** [November 2, 2023, 12:55am UTC](https://discourse.vtk.org/t/how-to-pick-widget-inside-square/12545 "2023-11-02T00:55:24Z")

</div>

Gif above shows that, when dragged lineWidget inside a square, the widget cannot be selected. How to select the actor or widget in this scenario, on account of more interaction with the widget. Any help will be a…

---

## [Creating a simple Circle with custom normal vector in vtk.js](https://discourse.vtk.org/t/creating-a-simple-circle-with-custom-normal-vector-in-vtk-js/4904)

<div class="topic-metadata">

**Author:** [@MeLays](https://discourse.vtk.org/u/MeLays)\
**Replies:** 2\
**Last updated:** [October 30, 2023, 9:20am UTC](https://discourse.vtk.org/t/creating-a-simple-circle-with-custom-normal-vector-in-vtk-js/4904 "2023-10-30T09:20:04Z")

</div>

Hello, I’m currently working on a project that I’m porting from python into the browser using vtk.js. The python version features circles with a given radius and a normal vector, created like this: area = vtk.vtkRegul…

---

## [ResliceCursorWidget axes distortion](https://discourse.vtk.org/t/reslicecursorwidget-axes-distortion/12507)

<div class="topic-metadata">

**Author:** [@Javi-r](https://discourse.vtk.org/u/Javi-r)\
**Replies:** 0\
**Last updated:** [October 19, 2023, 11:37am UTC](https://discourse.vtk.org/t/reslicecursorwidget-axes-distortion/12507 "2023-10-19T11:37:41Z")

</div>

Is there any way to remove the distortion on the axes of ResliceCursorWidget in VTK.JS V28? In previous versions when the widget was svg it didn’t happen.

---

## [React Example, useEffect return not clearing resize listener](https://discourse.vtk.org/t/react-example-useeffect-return-not-clearing-resize-listener/12498)

<div class="topic-metadata">

**Author:** [@weuniok](https://discourse.vtk.org/u/weuniok)\
**Replies:** 2\
**Last updated:** [October 18, 2023, 2:00pm UTC](https://discourse.vtk.org/t/react-example-useeffect-return-not-clearing-resize-listener/12498 "2023-10-18T14:00:40Z")

</div>

Hey, this may be a silly question, but I just started using vtk.js and tried implementing this React example ( Using vtk.js with React | vtk.js ). It includes unmount clear routine on useEffect, so I added conditional m…

---

## [How to update color of transformed actor?](https://discourse.vtk.org/t/how-to-update-color-of-transformed-actor/12445)

<div class="topic-metadata">

**Author:** [@fernim](https://discourse.vtk.org/u/fernim)\
**Replies:** 0\
**Last updated:** [October 9, 2023, 3:58am UTC](https://discourse.vtk.org/t/how-to-update-color-of-transformed-actor/12445 "2023-10-09T03:58:34Z")

</div>

I’ve set the color property of the actor to red but when I transformed the actor by setUserMatrix() the actor always changed into black (the red color disappeared) For more information, I’ve already instanced scalarVis…

---

## [typescript .d.ts updates needed](https://discourse.vtk.org/t/typescript-d-ts-updates-needed/12395)

<div class="topic-metadata">

**Author:** [@JohnSkinner](https://discourse.vtk.org/u/JohnSkinner)\
**Replies:** 0\
**Last updated:** [September 30, 2023, 9:08pm UTC](https://discourse.vtk.org/t/typescript-d-ts-updates-needed/12395 "2023-09-30T21:08:28Z")

</div>

when using typescript with strict on, i see these issues that are due to .d.ts incompleteness. Error: node\_modules/@kitware/vtk.js/Common/Core/ScalarsToColors.d.ts:137:19 - error TS7006: Parameter ‘scalars’ implicitly h…

---

## [cutter performance](https://discourse.vtk.org/t/cutter-performance/12282)

<div class="topic-metadata">

**Author:** [@Xoz](https://discourse.vtk.org/u/Xoz)\
**Replies:** 7\
**Last updated:** [September 25, 2023, 7:14am UTC](https://discourse.vtk.org/t/cutter-performance/12282 "2023-09-25T07:14:29Z")

</div>

Hi everyone, I’ve met a performance issue with vtkCutter, the situation is I have some polyDatas to be cut and displayed, so for 1 polyData there are 3 cuttors and actors for 3 renderers like this: For the slices ma…

---

## [Using VTK.js with .vdb files?](https://discourse.vtk.org/t/using-vtk-js-with-vdb-files/12246)

<div class="topic-metadata">

**Author:** [@scottm](https://discourse.vtk.org/u/scottm)\
**Replies:** 1\
**Last updated:** [September 21, 2023, 4:05pm UTC](https://discourse.vtk.org/t/using-vtk-js-with-vdb-files/12246 "2023-09-21T16:05:20Z")

</div>

Hi, Is there currently any support for loading .vdb files in vtk.js. I have seen examples for c++ but non for VTK.js. Thanks.

---

## [Human Orientation Marker in vtk.js](https://discourse.vtk.org/t/human-orientation-marker-in-vtk-js/12326)

<div class="topic-metadata">

**Author:** [@Alireza](https://discourse.vtk.org/u/Alireza)\
**Replies:** 5\
**Last updated:** [September 20, 2023, 7:31pm UTC](https://discourse.vtk.org/t/human-orientation-marker-in-vtk-js/12326 "2023-09-20T19:31:29Z")

</div>

As I see right now there is Cube and Axis orientation markers in the vtk.js, I know 3D Slicer has this nice human marker too If it is possible, but has not been a priority, we can could contribute if we can get some…

---

## [How can I update this code to vtk.js version 28?](https://discourse.vtk.org/t/how-can-i-update-this-code-to-vtk-js-version-28/12283)

<div class="topic-metadata">

**Author:** [@Javi-r](https://discourse.vtk.org/u/Javi-r)\
**Replies:** 4\
**Last updated:** [September 15, 2023, 9:20pm UTC](https://discourse.vtk.org/t/how-can-i-update-this-code-to-vtk-js-version-28/12283 "2023-09-15T21:20:36Z")

</div>

I want to upgrade this to vtk.js v28 const wobj = resliceCursorWidget.updateReslicePlane( obj.reslice, xyzToViewType\[obj.id\] ); lineWidget.getManipulator().setOriginFrom(wobj.origin); lineWidget.getManipulator().set…

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

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