Dear Ido,
in fact this should be an easy thing to do and unfortunately it isn't, due to
the way things are implemented: the dat file is just either point data or cell
data, not both. I should come up with a smarter format eventually. Anyway, as
you already found out, you can parse through the vtk format pretty easily.
Your assumptions are correct: in the vtk format, points come first, in the form
of
POINTS n float
x0 y0 z0 x1 y1 z1 ...
where (x0,y0,z0) are the coordinates of point with index 0, n is the number of
points and 'float' is the numeric type of the coordinates.
Then come the cells. In the case of centerlines, you will find, e.g.
LINES 3 286
which tell you that your data has three centerlines, with a total of 286
entries.
Each line following the above statement is made of:
n id0 id1 id2 id3
where n is the number of point indices that the line is made of, and id0 id1
are the indices of the points (which
refer to the coordinates in the POINTS section).
This should allow you to browse through the data.
Best regards
Luca
On Jul 20, 2011, at 8:37 AM, ido yerushalmy wrote:
> Hi all,
> I am trying to extract the radius along a vessel, using its centerline.
> That is, to get the maximum inscribed sphere radius for each point along the
> centerline.
>
> Following the discussion at:
> https://sourceforge.net/mailarchive/message.php?msg_id=21964561
> I have managed to extract a *.dat file describing the X/Y/Z of each point and
> its associated radius.
> This was alright for a single vessel with no bifurcations.
>
> The new problem I'm facing is to extract the radius for a vessel that splits.
> I would like to get the radius along each branch separately.
> I have started by extracting the branches of the centerline (using
> vmtkbranchextractor) and then merging them using vmtkcenterlinemerge. In this
> process I have followed the discussion at:
> https://sourceforge.net/mailarchive/message.php?msg_id=22171493
> When I save the file as *.dat (vmtksurfacewriter -ifile
> CT_merged_centerline.vtp -ofile mergedRadius.dat), I get the points and
> associated radius but don't know to which branch they belong to.
> So now I'm trying to export it as *.vtk : vmtksurfacewriter -ifile
> CT_merged_centerline.vtp -ofile mergedRadius.vtk
>
> When I open mergedRadius.vtk (attached) in a text editor, I see the following
> line: LINES 3 123
> I assume this means the following:
> There are 3 lines, with a total of 123 points in them
> The values following this line correspond to the center-points indices
> The indices are separated into 3 groups by a new-line character. Each group
> includes all points of a single branch
> Are these assumptions correct? If not, how can I associate the maximum
> inscribed sphere to a specific branch in an orderly manner?
>
> Thanks,
> Ido
> <mergedRadius.vtk>------------------------------------------------------------------------------
> 10 Tips for Better Web Security
> Learn 10 ways to better secure your business today. Topics covered include:
> Web security, SSL, hacker attacks & Denial of Service (DoS), private keys,
> security Microsoft Exchange, secure Instant Messaging, and much more.
> http://www.accelacomm.com/jaw/sfnl/114/51426210/_______________________________________________
> vmtk-users mailing list
> vmtk-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/vmtk-users
------------------------------------------------------------------------------
Got Input? Slashdot Needs You.
Take our quick survey online. Come on, we don't ask for help often.
Plus, you'll get a chance to win $100 to spend on ThinkGeek.
http://p.sf.net/sfu/slashdot-survey
_______________________________________________
vmtk-users mailing list
vmtk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vmtk-users