[vtkusers] Read Vector Field from Structured Point VTK file

Andras Lasso lasso at queensu.ca
Sun Dec 18 10:05:41 EST 2016


Your file contains a vector volume. You can read it into a vtkImageData and then set as DisplacementGridData in vtkGridTransform. The grid transform can very efficiently apply displacements to meshes or images (vtkTransformPolyDataFilter, vtkImageReslice) and can be used for generating data for visualization.

You can have a look at how visualization of displacement fields (VTK transforms) are implemented 3D in Slicer or in Paraview.
Example visualizations in 3D Slicer:
https://www.slicer.org/wiki/Documentation/Nightly/Modules/Transforms#Transform_display_options
Source code:
https://github.com/Slicer/Slicer/blob/master/Modules/Loadable/Transforms/Logic/vtkSlicerTransformLogic.cxx

Andras


From: vtkusers [mailto:vtkusers-bounces at vtk.org] On Behalf Of Adam Mueller
Sent: December 17, 2016 12:00
To: vtkusers at vtk.org
Subject: Re: [vtkusers] Read Vector Field from Structured Point VTK file

Hi Andras Lasso, I got a 3D Vector Field represented by a vtk ascii file this:

# vtk DataFile Version 3.0

Data converted from AVS by write_vtk module

ASCII

DATASET STRUCTURED_POINTS

DIMENSIONS 30 30 10

ORIGIN 0.000000 0.000000 0.000000

SPACING 1.000000 1.000000 1.000000





POINT_DATA 90000

VECTORS data float

-7 -9 20

-6.5 -9.2 20

...
Such that the first line of the vectors (-7 -9 20) is the Vector at position 0 0 0 and the very last line is the vector at position 30 30 10. I want to read in these Vektors and visualize the vectorfield on the one hand. But on the other hand i want to be able to have a function givemevector(x,y,z), which returns the vector at given position (x,y,z) I didn't get to work any of those things.
________________________________
View this message in context: Re: Read Vector Field from Structured Point VTK file<http://vtk.1045678.n5.nabble.com/Re-Read-Vector-Field-from-Structured-Point-VTK-file-tp5741498p5741576.html>
Sent from the VTK - Users mailing list archive<http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html> at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161218/f9bd14c0/attachment.html>


More information about the vtkusers mailing list