# vtk.js

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

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

**Page:** 5

---

## [How to reset or clear the renderer window?](https://discourse.vtk.org/t/how-to-reset-or-clear-the-renderer-window/12228)

<div class="topic-metadata">

**Author:** [@sunita](https://discourse.vtk.org/u/sunita)\
**Replies:** 9\
**Last updated:** [September 9, 2023, 3:17am UTC](https://discourse.vtk.org/t/how-to-reset-or-clear-the-renderer-window/12228 "2023-09-09T03:17:24Z")

</div>

Dear VTK users, We are trying to reset or clear the renderer window using renderer.removeAllViewProps(). After execution it is not clearing the renderer window but it is clearing only after a mouse click on the window. …

---

## [bounds not correct for ImageResliceMapper](https://discourse.vtk.org/t/bounds-not-correct-for-imagereslicemapper/12209)

<div class="topic-metadata">

**Author:** [@hmilyma](https://discourse.vtk.org/u/hmilyma)\
**Replies:** 5\
**Last updated:** [August 31, 2023, 2:01pm UTC](https://discourse.vtk.org/t/bounds-not-correct-for-imagereslicemapper/12209 "2023-08-31T14:01:46Z")

</div>

Dear VTK team I think there is a bug for ImageResliceMapper. ImageResliceMapper: if (publicAPI.getSlicePolyData()) { bds = publicAPI.getSlicePolyData().getBounds(); } else if (image) { bds = image.getBounds(); i…

---

## [vtk.js ct](https://discourse.vtk.org/t/vtk-js-ct/12212)

<div class="topic-metadata">

**Author:** [@yyy\_zzz](https://discourse.vtk.org/u/yyy_zzz)\
**Replies:** 2\
**Last updated:** [August 31, 2023, 7:36am UTC](https://discourse.vtk.org/t/vtk-js-ct/12212 "2023-08-31T07:36:06Z")

</div>

I want to use VTK.js to apply Gaussian filtering to CT images. How should I proceed?

---

## [load 3D Glyphs .vtk file](https://discourse.vtk.org/t/load-3d-glyphs-vtk-file/12221)

<div class="topic-metadata">

**Author:** [@xl\_hao](https://discourse.vtk.org/u/xl_hao)\
**Replies:** 0\
**Last updated:** [August 31, 2023, 5:23am UTC](https://discourse.vtk.org/t/load-3d-glyphs-vtk-file/12221 "2023-08-31T05:23:40Z")

</div>

I used this example to load my own.vtK file, but the page only shows purple background, but I can open my own vtk file with paraview, I do not have any problem with my data, how to set up 3D Glyphs. my .vtk file is :G…

---

## [Error occurs when using vtkImageResliceMapper](https://discourse.vtk.org/t/error-occurs-when-using-vtkimagereslicemapper/12019)

<div class="topic-metadata">

**Author:** [@hmilyma](https://discourse.vtk.org/u/hmilyma)\
**Replies:** 7\
**Last updated:** [August 24, 2023, 3:52am UTC](https://discourse.vtk.org/t/error-occurs-when-using-vtkimagereslicemapper/12019 "2023-08-24T03:52:06Z")

</div>

Dear VTK team here is my code： const slicePlane = vtkPlane.newInstance(); slicePlane.setNormal(\[1, 0, 0\]); slicePlane.setOrigin(\[-177, -172, -22\]); const imageResliceMapper = vtkImageResliceMapper.newInstance(); imageR…

---

## [One cell multiple colors?](https://discourse.vtk.org/t/one-cell-multiple-colors/12184)

<div class="topic-metadata">

**Author:** [@davsch](https://discourse.vtk.org/u/davsch)\
**Replies:** 0\
**Last updated:** [August 23, 2023, 7:14am UTC](https://discourse.vtk.org/t/one-cell-multiple-colors/12184 "2023-08-23T07:14:24Z")

</div>

Hey there, I wanted to ask if there is a way to have two (or more) colors for one cell with scalar coloring in vtk.js? I don’t want to use USE\_POINT\_DATA as scalar mode since a point should handle multiple colors like t…

---

## [Picking tube between points of PolyLineWidget](https://discourse.vtk.org/t/picking-tube-between-points-of-polylinewidget/12154)

<div class="topic-metadata">

**Author:** [@PaulHax](https://discourse.vtk.org/u/PaulHax)\
**Replies:** 2\
**Last updated:** [August 22, 2023, 5:30pm UTC](https://discourse.vtk.org/t/picking-tube-between-points-of-polylinewidget/12154 "2023-08-22T17:30:33Z")

</div>

I’ed like to click on a “line” of the PolyLineWidget and add a point/handle there. I don’t know how to get the index of where I want to insert a new handle. How to do that? Assuming I want the “cell” of the line, atte…

---

## [Why can't I show dicom's image?](https://discourse.vtk.org/t/why-cant-i-show-dicoms-image/11995)

<div class="topic-metadata">

**Author:** [@t1413194910](https://discourse.vtk.org/u/t1413194910)\
**Replies:** 14\
**Last updated:** [August 16, 2023, 5:06pm UTC](https://discourse.vtk.org/t/why-cant-i-show-dicoms-image/11995 "2023-08-16T17:06:25Z")

</div>

Here’s my code.： test () { axios.get(‘src/views/modules/generator/demo01.dcm’, { responseType: ‘arraybuffer’ }).then(response =\> { const dicomData = this.parseDICOM(response.data) this.render3DModel(dicom…

---

## [Unable to import vtk libraries.](https://discourse.vtk.org/t/unable-to-import-vtk-libraries/12013)

<div class="topic-metadata">

**Author:** [@sunita](https://discourse.vtk.org/u/sunita)\
**Replies:** 6\
**Last updated:** [August 9, 2023, 7:06pm UTC](https://discourse.vtk.org/t/unable-to-import-vtk-libraries/12013 "2023-08-09T19:06:31Z")

</div>

Dear VTK Team, We are trying to use vtk.js as suggested in the following link. However, we are unable to import vtk libraries. Could you please answer why is so? Thank you so much for the help. Best regards, Suni…

---

## [vtk.js picking when VolumeRendering](https://discourse.vtk.org/t/vtk-js-picking-when-volumerendering/12109)

<div class="topic-metadata">

**Author:** [@mazurkin.daniel](https://discourse.vtk.org/u/mazurkin.daniel)\
**Replies:** 0\
**Last updated:** [August 7, 2023, 6:05am UTC](https://discourse.vtk.org/t/vtk-js-picking-when-volumerendering/12109 "2023-08-07T06:05:54Z")

</div>

Hello, I don’t understand how vtk.js stores information about voxel transparency and other data during volume rendering. This understanding is necessary in order to write a ray casting picking algorithm for models that h…

---

## [Unable to display the render window inside html canvas](https://discourse.vtk.org/t/unable-to-display-the-render-window-inside-html-canvas/12066)

<div class="topic-metadata">

**Author:** [@sunita](https://discourse.vtk.org/u/sunita)\
**Replies:** 3\
**Last updated:** [August 3, 2023, 10:39pm UTC](https://discourse.vtk.org/t/unable-to-display-the-render-window-inside-html-canvas/12066 "2023-08-03T22:39:01Z")

</div>

Dear All, We are trying to show the render window inside the html canvas using following example. However, we can not see the image in the html canvas. The code we used is as follows. The image looks blank. T…

---

## [Numpy to VTI](https://discourse.vtk.org/t/numpy-to-vti/12032)

<div class="topic-metadata">

**Author:** [@Jakob\_Troidl](https://discourse.vtk.org/u/Jakob_Troidl)\
**Replies:** 4\
**Last updated:** [August 1, 2023, 3:55pm UTC](https://discourse.vtk.org/t/numpy-to-vti/12032 "2023-08-01T15:55:25Z")

</div>

I want to convert a 3D numpy array into a .vti file (folder based), that is readable by this example. So far, I’ve used: from pyevtk.hl import imageToVTK import numpy as np array = np.ones((100, 100, 100)) imageToVTK(…

---

## [vtk.js volume picker](https://discourse.vtk.org/t/vtk-js-volume-picker/12050)

<div class="topic-metadata">

**Author:** [@mazurkin.daniel](https://discourse.vtk.org/u/mazurkin.daniel)\
**Replies:** 4\
**Last updated:** [July 31, 2023, 2:57am UTC](https://discourse.vtk.org/t/vtk-js-volume-picker/12050 "2023-07-31T02:57:07Z")

</div>

Hello, I am faced with the task of adapting VolumePicker for vtk.js from vtk so that it is possible to select a point on the volume that is rendered using VolumeRendering. Please tell me where to start, namely, the follo…

---

## [Color Transfer Function with indexed colors for vtkImageSlice vtk.js](https://discourse.vtk.org/t/color-transfer-function-with-indexed-colors-for-vtkimageslice-vtk-js/12054)

<div class="topic-metadata">

**Author:** [@Andrzej\_Marciniak](https://discourse.vtk.org/u/Andrzej_Marciniak)\
**Replies:** 0\
**Last updated:** [July 28, 2023, 4:20pm UTC](https://discourse.vtk.org/t/color-transfer-function-with-indexed-colors-for-vtkimageslice-vtk-js/12054 "2023-07-28T16:20:15Z")

</div>

I need to display the segmentation of MRI volume with use of Freesurfer LUT color table. In my case, only selected regions are represented with different label values (integers) - the data array contains unevenly distri…

---

## [vtk.js can't display dicom files](https://discourse.vtk.org/t/vtk-js-cant-display-dicom-files/12037)

<div class="topic-metadata">

**Author:** [@t1413194910](https://discourse.vtk.org/u/t1413194910)\
**Replies:** 2\
**Last updated:** [July 28, 2023, 2:01am UTC](https://discourse.vtk.org/t/vtk-js-cant-display-dicom-files/12037 "2023-07-28T02:01:31Z")

</div>

What’s causing this? Is it the dicom file?

---

## [After parsing the dicom file with dicom-parser.js, the imaging is black](https://discourse.vtk.org/t/after-parsing-the-dicom-file-with-dicom-parser-js-the-imaging-is-black/12016)

<div class="topic-metadata">

**Author:** [@t1413194910](https://discourse.vtk.org/u/t1413194910)\
**Replies:** 0\
**Last updated:** [July 25, 2023, 9:42am UTC](https://discourse.vtk.org/t/after-parsing-the-dicom-file-with-dicom-parser-js-the-imaging-is-black/12016 "2023-07-25T09:42:58Z")

</div>

My code is as follows ---------- Start -------- import ‘@kitware/vtk.js/Rendering/Profiles/Volume’ import ‘@kitware/vtk.js/Rendering/Profiles/Geometry’ import ‘@kitware/vtk.js/Rendering/Profiles/All’ import vtkFullS…

---

## [How can I add http headers to vtkHttpDataSetReader ?](https://discourse.vtk.org/t/how-can-i-add-http-headers-to-vtkhttpdatasetreader/11979)

<div class="topic-metadata">

**Author:** [@Javi-r](https://discourse.vtk.org/u/Javi-r)\
**Replies:** 1\
**Last updated:** [July 19, 2023, 3:33pm UTC](https://discourse.vtk.org/t/how-can-i-add-http-headers-to-vtkhttpdatasetreader/11979 "2023-07-19T15:33:27Z")

</div>

I am trying to upload a file in vtk.js .gz format from a server that needs authentication. I need add Authorization header to vtkHttpDataSetReader. How can I add headers to vtkHttpDataSetReader ? const reader = vtkHtt…

---

## [Conversion of NIfTI mask file into VTK polydata file](https://discourse.vtk.org/t/conversion-of-nifti-mask-file-into-vtk-polydata-file/11915)

<div class="topic-metadata">

**Author:** [@sunita](https://discourse.vtk.org/u/sunita)\
**Replies:** 13\
**Last updated:** [July 15, 2023, 6:51am UTC](https://discourse.vtk.org/t/conversion-of-nifti-mask-file-into-vtk-polydata-file/11915 "2023-07-15T06:51:29Z")

</div>

Dear VTK users, We are trying to convert 3D numpy array into VTK polydata file to be used in three.js vtk loader which only supports polydata file. When we generated vtk file using ITK-SNAP we could load it to vtk load…

---

## [How can I customize uniform variables that are used in replacement shader code in VTK.js?](https://discourse.vtk.org/t/how-can-i-customize-uniform-variables-that-are-used-in-replacement-shader-code-in-vtk-js/11802)

<div class="topic-metadata">

**Author:** [@Ranglage](https://discourse.vtk.org/u/Ranglage)\
**Replies:** 1\
**Last updated:** [July 14, 2023, 2:16pm UTC](https://discourse.vtk.org/t/how-can-i-customize-uniform-variables-that-are-used-in-replacement-shader-code-in-vtk-js/11802 "2023-07-14T14:16:14Z")

</div>

In VTK, I can obtain a shader object from actor.GetShaderProperty() and customize uniform variables using the GetFragmentCustomUniforms().SetUniform3f() method. However, in VTK.js, the actor object does not have a shader…

---

## [How do I render image from an array containing the rgb format for each pixel of 256x256 size of image. The array is a continuous series of data in 1D form obtained after operations on ndarray.](https://discourse.vtk.org/t/how-do-i-render-image-from-an-array-containing-the-rgb-format-for-each-pixel-of-256x256-size-of-image-the-array-is-a-continuous-series-of-data-in-1d-form-obtained-after-operations-on-ndarray/11911)

<div class="topic-metadata">

**Author:** [@Gopal\_Baidawar](https://discourse.vtk.org/u/Gopal_Baidawar)\
**Replies:** 0\
**Last updated:** [July 10, 2023, 6:28am UTC](https://discourse.vtk.org/t/how-do-i-render-image-from-an-array-containing-the-rgb-format-for-each-pixel-of-256x256-size-of-image-the-array-is-a-continuous-series-of-data-in-1d-form-obtained-after-operations-on-ndarray/11911 "2023-07-10T06:28:51Z")

</div>

Here’s the snippet of a code I tried to perform. function selectGrid(imageContainer, gridData, width = 256, height = 256) { const fullScreenRenderer = vtkFullScreenRenderWindow.newInstance({ rootContainer: imageCo…

---

## [Create one 3d texture for multi- volume rendering windows?](https://discourse.vtk.org/t/create-one-3d-texture-for-multi-volume-rendering-windows/11679)

<div class="topic-metadata">

**Author:** [@jackzzz](https://discourse.vtk.org/u/jackzzz)\
**Replies:** 3\
**Last updated:** [July 4, 2023, 4:04pm UTC](https://discourse.vtk.org/t/create-one-3d-texture-for-multi-volume-rendering-windows/11679 "2023-07-04T16:04:12Z")

</div>

I am developing a medical 3d application, For medical 3d application, there is a very common layout which includes one 3D(Volume rendering) window and three MPR windows(please refer to the image). I found that for four …

---

## [Does this example use WebGPU functionality?](https://discourse.vtk.org/t/does-this-example-use-webgpu-functionality/11848)

<div class="topic-metadata">

**Author:** [@865979216](https://discourse.vtk.org/u/865979216)\
**Replies:** 0\
**Last updated:** [June 29, 2023, 10:12am UTC](https://discourse.vtk.org/t/does-this-example-use-webgpu-functionality/11848 "2023-06-29T10:12:44Z")

</div>

【https://kitware.github.io/vtk-js/examples/PiecewiseGaussianWidget.html】，If WebGPU not been used, what should be done to use this function

---

## [vtk.js Renderer not showing Polydata](https://discourse.vtk.org/t/vtk-js-renderer-not-showing-polydata/11822)

<div class="topic-metadata">

**Author:** [@fleurgaudfernau](https://discourse.vtk.org/u/fleurgaudfernau)\
**Replies:** 5\
**Last updated:** [June 27, 2023, 10:45pm UTC](https://discourse.vtk.org/t/vtk-js-renderer-not-showing-polydata/11822 "2023-06-27T22:45:31Z")

</div>

Hello everyone, I am using vtk.js (imported as an external file) to add a mesh visualization section on my personal GitHub page. I’m working directly on my Github page so debugging is not very convenient. The following…

---

## [Questions about ImageCPRMapper](https://discourse.vtk.org/t/questions-about-imagecprmapper/11683)

<div class="topic-metadata">

**Author:** [@Xoz](https://discourse.vtk.org/u/Xoz)\
**Replies:** 1\
**Last updated:** [June 14, 2023, 11:22am UTC](https://discourse.vtk.org/t/questions-about-imagecprmapper/11683 "2023-06-14T11:22:57Z")

</div>

Hi everyone, I’ve done with the cpr function for a long time and recently finished a demo which almost meet the demand of efficiency based on webgl shader, then I saw that vtk added an ImageCPRMapper in recent updates w…

---

## [Can ParaView Web load unstructured grids for cropping and slicing processing？](https://discourse.vtk.org/t/can-paraview-web-load-unstructured-grids-for-cropping-and-slicing-processing/11634)

<div class="topic-metadata">

**Author:** [@missWangLP](https://discourse.vtk.org/u/missWangLP)\
**Replies:** 1\
**Last updated:** [June 8, 2023, 2:24pm UTC](https://discourse.vtk.org/t/can-paraview-web-load-unstructured-grids-for-cropping-and-slicing-processing/11634 "2023-06-08T14:24:53Z")

</div>

Do I have any methods for slicing and cropping unstructured grid data?

---

## [How to use vtk.js volume masking？](https://discourse.vtk.org/t/how-to-use-vtk-js-volume-masking/11558)

<div class="topic-metadata">

**Author:** [@aleaf2023](https://discourse.vtk.org/u/aleaf2023)\
**Replies:** 0\
**Last updated:** [May 29, 2023, 1:41am UTC](https://discourse.vtk.org/t/how-to-use-vtk-js-volume-masking/11558 "2023-05-29T01:41:40Z")

</div>

How to use vtk.js volume masking to image cutting？Where’s the example?

---

## [Device Orientation](https://discourse.vtk.org/t/device-orientation/11484)

<div class="topic-metadata">

**Author:** [@Xoz](https://discourse.vtk.org/u/Xoz)\
**Replies:** 4\
**Last updated:** [May 22, 2023, 11:13am UTC](https://discourse.vtk.org/t/device-orientation/11484 "2023-05-22T11:13:32Z")

</div>

Hi everyone, I’m working on a function to show a window in landscape mode in a portrait container, it’s like this(device oritention is still portrait): I rotated the container by 90deg to achieve this, but the getBo…

---

## [About vtkResliceCursorWidget](https://discourse.vtk.org/t/about-vtkreslicecursorwidget/11490)

<div class="topic-metadata">

**Author:** [@YaoDongcai](https://discourse.vtk.org/u/YaoDongcai)\
**Replies:** 2\
**Last updated:** [May 22, 2023, 1:43am UTC](https://discourse.vtk.org/t/about-vtkreslicecursorwidget/11490 "2023-05-22T01:43:23Z")

</div>

hi, in the vtkResliceCursorWidget example used according to the official documentation, I found that after using the real DICOM data, when I rotated it I found other white padding in the background, which I hope to elimi…

---

## [It seems that vtkLabelWidget is not being loaded.](https://discourse.vtk.org/t/it-seems-that-vtklabelwidget-is-not-being-loaded/11474)

<div class="topic-metadata">

**Author:** [@won](https://discourse.vtk.org/u/won)\
**Replies:** 3\
**Last updated:** [May 18, 2023, 2:55pm UTC](https://discourse.vtk.org/t/it-seems-that-vtklabelwidget-is-not-being-loaded/11474 "2023-05-18T14:55:51Z")

</div>

I see that you’re currently using version 28.1.0, and it appears that vtkLabelWidget is not available in the Widget.Widget3D. According to your findings on GitHub, the folder exists but the import statement is missing. A…

---

## [Rendering BarChart in vtkRemoteView](https://discourse.vtk.org/t/rendering-barchart-in-vtkremoteview/11475)

<div class="topic-metadata">

**Author:** [@Nikhil216](https://discourse.vtk.org/u/Nikhil216)\
**Replies:** 4\
**Last updated:** [May 18, 2023, 2:54pm UTC](https://discourse.vtk.org/t/rendering-barchart-in-vtkremoteview/11475 "2023-05-18T14:54:22Z")

</div>

I am working on web client which connects to a paraview server using vtk.js vtkRemoteView class. I use pvbatch with a python script to spawn the paraview server. Right now it connects and displays the render view and I c…

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

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