Hi Ben,
 the issue is the following:
- the .dat format that vmtk writes (in vmtksurfacewriter) is essentially a csv 
(don't ask me why I didn't name the extension csv directly... bah, I was young 
and creative :-) )
- the .dat/.csv format contains point data (or cell data) quantities, one row 
per point/cell, while topology is thrown away
- vmtksurfacereader reads surfaces (points + cells), and since .dat is an 
extension that Tecplot uses by default, I decided to map it to the Tecplot 
format (just like .tec) upon reading

So, what's happening in your case is that vmtk tries to read it in as a Tecplot 
file and it fails to parse the file correctly (with an admittedly obscure error 
message).

One thing you could do is to export in Tecplot format in the first place (using 
vmtksurfacewriter ... -ofile foo.tec), which is quite easy to parse and it is 
readable back into vmtk.
Other options are also possible, including extending vmtksurfacereader to 
actually support the .dat/.csv format, although in that case you would lose the 
connectivity information.


As for your other question: Voronoi diagrams are surfaces, whose vertices (i.e. 
points in the vtkPolyData) are centers of maximally inscribed spheres, whose 
radius is contained in the point 
data array named MaximumInscribedSphereRadius.

So the straight answer to your question is: points.

Hope this helps


Luca




On Apr 23, 2012, at 9:34 PM, Berkowitz, Benjamin M wrote:

> Luca,
> 
> I've been getting a bug when writing a .dat file, and trying to read it back 
> in: 
> 
> Reading Tecplot surface file.
> Traceback (most recent call last):
>   File "/Users/benberkowitz/vmtk-build/Install/bin/vmtksurfaceviewer", line 
> 64, in <module>
>     main.Execute()
>   File "/Users/benberkowitz/vmtk-build/Install/lib/vmtk/vmtk/pypescript.py", 
> line 615, in Execute
>     pipe.Execute()
>   File "/Users/benberkowitz/vmtk-build/Install/lib/vmtk/vmtk/pype.py", line 
> 272, in Execute
>     scriptObject.IORead()
>   File "/Users/benberkowitz/vmtk-build/Install/lib/vmtk/vmtk/pypescript.py", 
> line 567, in IORead
>     reader.Execute()
>   File 
> "/Users/benberkowitz/vmtk-build/Install/lib/vmtk/vmtk/vmtksurfacereader.py", 
> line 220, in Execute
>     self.ReadTecplotSurfaceFile()
>   File 
> "/Users/benberkowitz/vmtk-build/Install/lib/vmtk/vmtk/vmtksurfacereader.py", 
> line 107, in ReadTecplotSurfaceFile
>     self.PrintLog("Reading " + str(numberOfNodes)+" nodes.")
> UnboundLocalError: local variable 'numberOfNodes' referenced before assignment
> 
> There is one other question I had.  When working with the Voronoi diagrams, 
> I'm a little confused as what is actually represented by the data.  In the 
> .vtp files, if I want to get the centers and locations of the spheres, should 
> I be counting and reading the cells or the points in VTK?
> 
> Thanks,
> Ben Berkowitz
> 
> 
> 
> ------------------------------------------------------------------------------
> For Developers, A Lot Can Happen In A Second.
> Boundary is the first to Know...and Tell You.
> Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
> http://p.sf.net/sfu/Boundary-d2dvs2
> _______________________________________________
> vmtk-users mailing list
> vmtk-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/vmtk-users

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
vmtk-users mailing list
vmtk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/vmtk-users

Reply via email to