How can I plot a Hedgehog with programmatically-built data? (Python)

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I plot a Hedgehog with programmatically-built data? (Python)

Gaiajack
I'd like to draw a Hedgehog plot in Python. I had a look at this example:


But unfortunately the data for the plot there is just read from a file, "carotid.vtk" (a file which, by the way, I can't find anywhere on the Internet - maybe a download a link could be added to the examples page?). Thus it's quite opaque exactly how this data needs to be presented. I've been trying to guess my way to success by looking at some C code I found, but I'm not getting any joy.

Say I have a 2-dimensional python array of python 3-tuples representing the values of a vector field at each point of a regular 3d grid. What steps do I take to plot that as a hedgehog?

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers
Reply | Threaded
Open this post in threaded view
|

Re: How can I plot a Hedgehog with programmatically-built data? (Python)

Aron Helser
If you build VTK, with testing or with examples, the data files end up in the build directory. It's a binary file ~2.5Mb, or I'd attach it.
The example uses  vtkStructuredPointsReader to read the file, then  vtkPolyDataMapper , tells you carotid is probably a PolyData, so you can look for examples of constructing that. The example of exchanging data with Numpy arrays might be helpful.
HTH,
Aron


On Fri, Jul 6, 2018 at 4:10 AM J. <[hidden email]> wrote:
I'd like to draw a Hedgehog plot in Python. I had a look at this example:


But unfortunately the data for the plot there is just read from a file, "carotid.vtk" (a file which, by the way, I can't find anywhere on the Internet - maybe a download a link could be added to the examples page?). Thus it's quite opaque exactly how this data needs to be presented. I've been trying to guess my way to success by looking at some C code I found, but I'm not getting any joy.

Say I have a 2-dimensional python array of python 3-tuples representing the values of a vector field at each point of a regular 3d grid. What steps do I take to plot that as a hedgehog?
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers

_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Search the list archives at: http://markmail.org/search/?q=vtkusers

Follow this link to subscribe/unsubscribe:
https://public.kitware.com/mailman/listinfo/vtkusers