Temperature results do not display with VTK file
See original GitHub issueI 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:
- Created 4 years ago
- Comments:5 (3 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@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
@thewtex Here is the
case1.vtkfile that I am working with.case1.vtk.zip