Skip to content

Simple viewer for VTK polydata(s) with scalars and vectors

Notifications You must be signed in to change notification settings

guatavita/PlotVTK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlotVTK

Table of contents

General info

Features Status
Append multiple polydata
Display two separate polydata (fixed/moving)
Toggle between the available scalars
Toggle glyph if vectors are present
Apply 10% deformation (if vectors)
Show colorbar
Save animation with 'a' if vectors

Bastien Rigaud, PhD Laboratoire Traitement du Signal et de l'Image (LTSI), INSERM U1099 Campus de Beaulieu, Université de Rennes 1 35042 Rennes, FRANCE [email protected]

Example

    filepath = r'C:\Data\Data_test\test_2.vtk'
    reader1 = vtk.vtkPolyDataReader()
    reader1.ReadAllScalarsOn()
    reader1.ReadAllVectorsOn()
    reader1.SetFileName(filepath)
    reader1.Update()
    polydata1 = reader1.GetOutput()

    filepath = r'C:\Data\Data_test\test.vtk'
    reader2 = vtk.vtkPolyDataReader()
    reader2.ReadAllScalarsOn()
    reader2.ReadAllVectorsOn()
    reader2.SetFileName(filepath)
    reader2.Update()
    polydata2 = reader2.GetOutput()

    transform = vtk.vtkTransform()
    transform.RotateWXYZ(10, 1, 0, 0)
    transformFilter_1 = vtk.vtkTransformPolyDataFilter()
    transformFilter_1.SetTransform(transform)
    transformFilter_1.SetInputData(polydata1)
    transformFilter_1.Update()
    polydata1_transformed = transformFilter_1.GetOutput()

    transformFilter_2 = vtk.vtkTransformPolyDataFilter()
    transformFilter_2.SetTransform(transform)
    transformFilter_2.SetInputData(polydata2)
    transformFilter_2.Update()
    polydata2_transformed = transformFilter_2.GetOutput()

    plot_vtk([polydata1, polydata2], secondary=[polydata1_transformed, polydata2_transformed])

Dependencies

pip install -r requirements.txt

About

Simple viewer for VTK polydata(s) with scalars and vectors

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages