VMTK <--> MATLAB

651 views
Skip to first unread message

Haim Ezer

unread,
Jun 2, 2014, 6:35:24 AM6/2/14
to vmtk-...@googlegroups.com
Dear Luca, everybody,

I am trying to transfer data, back and forth from VMTK to MATLAB and back.

I am currently doing it using the .dat file format.

The problem is that when I read  back the data, in VMTK, I am unable to show the centerline.

My pipe is:

vmtkcenterlinegeometry -ifile "C:/.../centerlines.vtp" -smoothing 1 -outputsmoothed 1 --pipe vmtksurfacewriter -i @vmtkcenterlinegeometry.o -ofile "C:/.../centerlines_geometry.dat" -celldata 1 -mode ascii  

And when I try to read this:

vmtksurfacereader -ifile "C:/Users/Hezer/Dropbox/The_origin/DATA/Aneurisk DATA/Models/C0001_models/C0001/morphology/centerlines_geometry.dat" --pipe vmtksurfaceviewer -array Curvature -scalarrange 0 .7

it gets stuck with reading Tecplot surface file.

I am unable to read and write vtp files in matlab.

I tried to transfer the data from python to MATLAB, using wormhole:


but it seems that the python data is merely a memory reference, and not a python variable.

any help will be appreciated.

Thanks

Haim




Luca Antiga

unread,
Jun 6, 2014, 3:49:54 AM6/6/14
to vmtk-...@googlegroups.com
Hello Haim,
 indeed dat is just for exporting points and related data in tabular format, but roundtripping is not really doable unless you merge the information written by Matlab with an existing file directly in VTK. I think this could be the best way to go.

If you show me the kind of information that matlab writes in the dat file I can send you a snippet for merging it back on centerlines.

Best,

Luca




--
You received this message because you are subscribed to the Google Groups "vmtk-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vmtk-users+...@googlegroups.com.
To post to this group, send email to vmtk-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Luca Antiga, PhD
Co-founder and Principal Scientist, OROBIX Srl
via L.A. Muratori 3, 24123 Bergamo, Italy

twitter: @lantiga
mobile: +39.347.43.16.596

"This message originates from OROBIX Srl and its contents and attachments are privileged and confidential and are intended only for the individual(s) or entity(ies) named above. This message should not be forwarded, distributed or disclosed. Any unauthorized use, dissemination and duplication is strictly prohibited and may be unlawful. All personal messages express views solely of the sender, which are not to be attributed to OROBIX Srl, and may not be copied or distributed without this disclaimer. If you are not the intended recipient or received this message in error, please delete this message and notify the sender by reply e-mail. Opinions, conclusions and other information in this message that do not relate to the official business of OROBIX Srl shall be understood as neither given nor endorsed by it."

Elena Faggiano

unread,
Jun 6, 2014, 2:46:45 PM6/6/14
to vmtk-...@googlegroups.com
Hello Haim,

you can try to read/write (or only write if the import in matlab of your .dat do the trick) the .vtk ascii file format. It is not so difficult to read .vtk in Matlab and to write it again, you just have to learn how vtk format works (you can also find some Matlab submissions with codes to do that). 

Best,
Elena


Haim Ezer

unread,
Jun 9, 2014, 7:29:02 AM6/9/14
to vmtk-...@googlegroups.com
Hello, Luca, Elena,

Thank you for your reply.

I am attaching the DAT file.

All MATLAB does, is cut some parts of the centerlines, and I would like to present them, in VMTK.

I kind of figured out, by myself, what Elena wrote (It took me a few weeks) and currently working on the MATLAB code for this.

Kind regards

Haim
centerlines_geometry.dat
Reply all
Reply to author
Forward
0 new messages