[vtkusers] Point cloud processing with Python-VTK

Christian Jauvin cjauvin at gmail.com
Fri Jun 24 14:37:57 EDT 2011


Hi,

I'm totally new to VTK, and I am currently studying the feasibility of
building a Python application for the visualization and processing of
point cloud data.

So far I've been able to write a basic loader and a simple visualizer
for the raw point cloud data in a few lines of code, and I've been
very impressed with the ease and performance offered.

My learning strategy is to incrementally add features to this simple
prototype. My first goal is to allow the user to manipulate a set of
"spheres" that can be arbitrarily located in the model, and should
offer certain interaction services. In particular, these spheres
should be independently movable, and behave as "selectors" of the
point data located inside them. Further on, I will need to compute
their centroids, and build a connection graph between them.

My first tentative was to create a vtkSphereSource and use the
"trackball actor" interaction style to manipulate it independently of
the point cloud objects. To override the user interaction with the
sphere, I tried to use a variation on the technique described here:

http://vtkedge.org/Wiki/VTK/Examples/Cxx/Interaction/SelectAnActor

but it seems that it is not directly translatable to wrapping adapters
like the Python one (in particular, I'm not able to extract any
pointer to the object being acted upon), as I've been able to deduce
from this thread:

http://vtk.1045678.n5.nabble.com/InteractionProp-in-Java-td3256249.html

I then tried to understand the different ways that the AddObserver()
pattern can be used to track interaction (which seems to be the
Pythonic way of doing), but this is where things start to get a bit
blurry for me, as I would need a more thorough tutorial, at least
sequentially introducing the basic principles.

I've also looked at the vtkSphereWidget, which seems a likely
candidate pattern for my requirement, but then again, I'm not able
(from the 2 or 3 examples offered online) to infer if this is the
right way or not.

I'm not asking for a full solution (as I know it's my job at this
point to triangulate the available data sources to build my
understanding), but just a few pointers to examples or pieces of
documentation that I might have overlooked would greatly help me.

Thanks in advance,

Christian



More information about the vtkusers mailing list