question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Temperature results do not display with VTK file

See original GitHub issue

I would like to use itk-jupyter-widgets to view battery simulation results in a JupyterLab notebook. Previously I used K3D to view the VTK file (see example below).

import k3d
import vtk

filename = 'case1.vtk'

reader = vtk.vtkUnstructuredGridReader()
reader.SetFileName(filename)
reader.Update()

geometryFilter = vtk.vtkGeometryFilter()
geometryFilter.SetInputData(reader.GetOutput())
geometryFilter.Update()

plot = k3d.plot()
thermal = k3d.vtk_poly_data(geometryFilter.GetOutput(), color_attribute=('Battery_Temperature', 296, 316))
plot += thermal
plot.display()

My attempt with the itk-jupyter-widget is shown below.

import vtk
from itkwidgets import view

file_name = 'case1.vtk'

reader = vtk.vtkUnstructuredGridReader()
reader.SetFileName(file_name)
reader.Update()

geometryFilter = vtk.vtkGeometryFilter()
geometryFilter.SetInputData(reader.GetOutput())
geometryFilter.Update()
case1 = geometryFilter.GetOutput()

view(geometries=case1)

The itk widget will display the VTK file in the notebook but the temperature gradient from the simulation results is not visible. In K3D, the temperature results were defined with color_attribute=('Battery_Temperature', 296, 316) but I do not see how to accomplish this with the itk widget.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
wiggingcommented, Jul 28, 2019

@thewtex Thank you for merging this feature. Do you know when it will be available as part of the pip package? Current version on pip is 0.17.1

1reaction
wiggingcommented, Jul 19, 2019

@thewtex Here is the case1.vtk file that I am working with.

case1.vtk.zip

Read more comments on GitHub >

github_iconTop Results From Across the Web

VTK File Formats
The main reason for creating yet another data file format is to offer a consistent data representation scheme for a variety of dataset...
Read more >
VTK File Formats
The main reason for creating yet another data file format is to offer a consistent data representation scheme for a variety of dataset...
Read more >
VTK/Writing VTK files using python - KitwarePublic
Introduction. The purpose of this wiki is to show how one can write VTK files using python. Why using python ?
Read more >
vtkOpenFOAMReader cannot read binary data when ... - GitLab
When I try to read the fields using vtkOpenFOAMReader, the Temperature field is not read showing the error 'unmatched )'.
Read more >
Simple visualizations of unstructured grids with VTK - HAL-Inria
Figure 5: Point scalar attributes "temperature" and cell scalar attributes. "subdomains". The "stripComplex.vtk file is shown below:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found