Hello Firas,
 indeed vmtkbranchextractor changes the dataset (it generates more lines), so 
the order with which points appear changes. Same thing for 
vmtkcenterlinesections.
If you want to combine point arrays you could use vmtksurfaceprojection, which 
will
project scalar values from one surface (in a broad sense - also a centerline is 
a surface
made of 1D cells) to another.
However, this will only project point data, such as radius, and not cell data, 
such as
groupid. To do that, you first need to convert point data to cell data using 
vmtksurfacecelldatatopointdata, but your mileage might vary, depending on what 
you
want to integrate.
In general, though, if you really need to integrate for your own specific 
needs, I can show 
you how to do it using Python code. That way you're not stuck with how things 
have been
pre-packaged. It's really hard to envision any possible combination.
Let me know what exact quantities you'd like to have and on what dataset, and I 
can
think of practical suggestions to get there. Eventually, if something general 
enough
comes out of this, we'll include it in vmtk.

As a starting point, look at vtkvmtkPolyBallLine (in 
vtkVmtk/ComputationalGeometry). With 
this class you can do 

polyBallLine = vtkvmtk.vtkvmtkPolyBallLine()
polyBallLine.SetInput(centerlines)
polyBallLine.SetPolyBallRadiusArrayName('MaximumInscribedSphereRadius')
polyBallLine.UseRadiusInformationOn()

With this object, having the coordinates of a point, you can find out the cell, 
subId (the id
of the point along the line) and pcoord (the normalized parametric coordinate 
along the 
segment from subId to subId+1) on the centelrine that is closest to the point 
provided.

So, for example
point = [1.0,1.0,1.0]
polyBallLine.EvaluateFunction(point)
cellId = polyBallLine.GetLastPolyBallCellId()
subId = polyBallLine.GetLastPolyBallCellSubId()
pcoord = polyBallLine.GetLastPolyBallCellPCoord()

# now get the cell from the input dataset
cell = centerlines.GetCell(cellId)
# so you can get the pointId
pointId = cell.GetPointId(subId)

(see the code in vtkVmtk/vtkvmtkPolyDataCenterlineProjection.cxx as an example 
in C++)

At this point, you have both the cellId and the pointId of the point on the 
centerline that is
closest to your input point (which could be a point belonging to the centerline 
where you
want to project your data onto). Using cellId and pointId, you can access both 
point data 
and cell data to get the quantities from one dataset to the other.

I hope I'm pointing you in the right direction. As I mentioned, if you provide 
me with more
detail on the specific quantities you need and on what dataset you want them, I 
can be more
specific.

Best regards


Luca


On Nov 21, 2010, at 5:22 PM, Firas Mualla wrote:

> Hi Luca,
> 
> We get usefule vessel features from several vmtk scripts, and it would
> be nice if we can combine them. In principle, it is always possible to
> do the combination if we have the same geometry (points), because then
> we can iterate over the points array, and for each point, we get the
> features from (e.g. vmtkcenterlinegeometry, vmtkbranchextractor, and
> say vmtkcenterlinesections). If we have the same centerline input for
> the previous three scripts, we can for example get  at each point the
> curvature, the torsion, the centerlineId, the groupId, the area of the
> inter-sections...etc.
> 
> I've checked the outputs of the previous three scripts, and noticed
> that vmtkcenterlinegeometry has the same points array of the input, on
> the otherhand vmtkbranchextractor gives different points array (at
> least the order is different). vmtkcenterlinesections contains the
> sections points, and as I think each section is belonged to a cell. Is
> there a way in vmtk to do this combination?
> 
> many thanks Luca in advance
> 
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> vmtk-users mailing list
> vmtk-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/vmtk-users


------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
vmtk-users mailing list
vmtk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vmtk-users

Reply via email to