vmtkcenterlines example

931 views
Skip to first unread message

Greg Hanowski

unread,
Aug 31, 2013, 10:21:13 AM8/31/13
to vmtk-...@googlegroups.com
Hi,
I'm brand new to vmtk and this is my first post.  I need to create centerlines of my 3d models of arteries and veins, which are in .obj format.  I discovered vmtkcenterlines tutorial from a google search.  It appeared that it needed a .vtp file for input so I've spent the last 2 weeks figuring out how to compile VTK and modified their ReadOBJ and WriteVTP scripts to do the conversion.  Now I'm ready to create the centerlines.  I downloaded and installed vmtk on windows 8 and am able to bring up the PypePad program.  When I enter:
vmtkcenterlines -ifile foo.vtp -ofile foo_centerlines.vtp 
with my converted aorta segment as foo.vtp, an empty blue window appears. I'm guessing something must be wrong with the foo.vtp because I was expecting to see the same geometry that I can see in VTK
after reading in the .obj file.

Anyway, I need to build some confidence in the vmtkcenterlines script. I searched vmtkcenterlines in these archives and can see 172 threads of people having lots of problems. Can someone please
provide a very simple example of something that actually works? Something that explains every step clearly and doesn't leave anything to guess about. (For example, the vmtkcenterline tutorial
talks about adding source points but doesn't explain what those are. It says to zoom up to select them but doesn't say how to zoom up, etc).
Thank you,
Greg

Luca Antiga

unread,
Sep 2, 2013, 4:24:49 PM9/2/13
to vmtk-...@googlegroups.com
Hi Greg,
the centerline tutorial explains what source points are in the fifth paragraph. As the tutorial also suggests, you can get all the details on the algorithm on my PhD thesis. Zooming is covered in the Getting Started tutorial.

Luca

Greg Hanowski

unread,
Sep 2, 2013, 5:28:29 PM9/2/13
to vmtk-...@googlegroups.com
Hello Luca,
I see it now, thanks.

Centerlines are determined as the paths defined on Voronoi diagram sheets
that minimize the integral of the radius of maximal inscribed spheres along
the path, which is equivalent to finding the shortest paths in the radius
metric. They way this is done is by propagating an wave from a source point
(one endpoint of the centerline) using the inverse of the radius as the wave
speed and recording the wave arrival time on all the points of the Voronoi
diagram, and then backtracing the line from a target point (the other
endpoint of the centerline) down along the gradient of arrival times.

But isn't that a chicken or egg problem? We are trying to get the
centerline so we don't have its endpoints yet. If it was in a CAD program I
could easily draw a couple lines across vertexes and get the intersection
point, but that is a lot of work for the hundreds of artery and vein
sections I have.

I scanned all 178 pages of your PHD thesis and am quite impressed, but
overwhelmed at trying to understand it in the time available to me.

Could you recommend a sample data file that can be downloaded that I can
test the algorithm on? Something really simple to build on? Once I can see
it work, I will be better able gradually make more complicated ones work.

Greg
--
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/groups/opt_out.

Luca Antiga

unread,
Sep 3, 2013, 4:29:54 AM9/3/13
to vmtk-...@googlegroups.com
Hi Greg,
 think of the centerlines algorithm in vmtk as a navigator system. You know where you want to start and where you want to end up to and the algorithm tells you the right path to follow. You can utilize various methods to determine the endpoints. For instance, if your model is open-ended, you can identify the endpoints automatically as the barycenter of the outer sections (this is what -seedselector openprofiles option does). It really depends on how your model is.
I'm attaching a sample file and a few screenshots, I hope they'll be revealing.

Luca








trachea.vtp.zip

Greg Hanowski

unread,
Sep 4, 2013, 1:13:42 AM9/4/13
to vmtk-...@googlegroups.com

Hello Luca,

 

I got the trachea.vtp but don't see any screen shots.

 

1) I right-clicked on my vmtk icon and selected properties.  The "Target" field shows: C:\Program Files\vmtk\Install\bin\vmtk-exe.pyw  and the "Start in" field shows "C:\Program Files\vmtk\Install\lib\vtk-5.8".

2) So I put your trachea.vtp in the target directory

3) Next I brought up PypePad and entered "vmtkcenterlines -seedselector openprofiles -ifile trachea.vtp -ofile trachea_centerline.vtp" (no quotes)

4) Put the cursor on that line and select "Run current line" from the Run menu

5) That brought up a blue window showing the trachea geometry along with 3 white labels  0, 1, and 2 located at the center of the left, right and main branches, respectively.  (I could tell this by holding the LMB down and rotating the geometry).  I did not see the centerlines themselves and assumed they must only be in the trachea_centerline.vtp.  A search for that file, however, revealed nothing.

6) Then I noticed the q:Quit render/proceed option in the window so I pressed the "q" button on the keyboard.

7) Next the prompt said "Please input list of inlet profile ids:".  Not sure what it wanted so I entered "2".

8) Next the prompt said "Please input list of outlet profiles (leave empty for all available profiles)".  So I just hit the Enter button.

9) I briefly saw "Computing centerlines" in the geometry window and then it turned to white and had the following error messages:

ERROR: In C:\Users\orobix\Documents\VMTK\vmtk-build\VTK\Rendering\vtkFreeTypeUtilities (0000000003610/e40): no text in input

ERROR: IN C:\Users\orobix\Documents\VMTK\vmtk-build\VTK\IO\vtkXMLPolyDataWriter (000000000361E3A0): Error opening output file "tra*

ERROR: In C:\Users\orobix\Documents\VMTK\vmtk-build\VTK\Filtering\vtkStreamingDemandDrivenPipeline (00000000036BA830): Algorithm vtkX*

Debug: Off

Modified Time: 165868

Reference Count: 1

Registered Events: (none)

Request: REQUEST_DATA

FORWARD_DIRECTION: 0

ALGORITHM_AFTER_FORWARD: 1

FROM OUTPUT PORT: -1

 

*The title of the window said vtkOutputWindow (Not Responding) so I could not scroll it to the right to see the rest of the line

 

10) I closed PypePad and reran steps 3-7

11) This time around I entered 0 1 for the outlet profiles instead of leaving it blank.

12) Again, the blue window turned white with error messages.  This time, the first error ("no text in input") was gone but there was a new error at the end:

ERROR: In C:\Users\orobix\Documents\VMTK\vmtk-build\VTK\Filtering\vtkStreamingDemandDrivenPipeline (00000000036BCA10): Algorithm vtkX*

 

I'm guessing some kind of Windows 8 security crap is preventing the writing of trachea_centerline.vtp so I

13) Created empty folder C:\Users\Greg\Documents\BiologyModeling\VMTK_Centerlines (I then right-clicked on this folder and selected Properties to look at the permissions.  The

Read-only checkbox was checked.  I unchecked it and clicked Apply, then Ok.  But when I looked at properties again, Read-only was still checked.  I couldn't figure out how to make it stick.

I note that I have Full control but the check marks are grayed out and inaccessible)

 

Then I closed PypePad and reran steps 3-7, and 11 but this time around I used: -ofile C:\Users\Greg\Documents\BiologyModeling\VMTK_Centerlines\trachea_centerline.vtp in step 3

 

But alas, got the same white window with same error messages.

I also note, there is no C:\Users\orobix folder so don't know where it's coming up with that.

 

Hope you can shed some more light.

Thank you,

Greg

Luca Antiga

unread,
Sep 4, 2013, 6:18:36 AM9/4/13
to vmtk-...@googlegroups.com
Hi Greg,
 can you post the output (or a screenshot of what you see) of the error window for your last attempt?
From what I read it still looks like a permission problem on your Windows box.
Regards,

Luca

PS: the non-existing folder you see in the error message is related to the folder where the binary version has been compiled and frozen


You received this message because you are subscribed to a topic in the Google Groups "vmtk-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vmtk-users/U282bsvHBT8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vmtk-users+...@googlegroups.com.

Greg Hanowski

unread,
Sep 4, 2013, 11:39:59 AM9/4/13
to vmtk-...@googlegroups.com

Hello Luca,

 

Here is the last command I tried:

vmtkcenterlines -seedselector openprofiles -ifile trachea.vtp -ofile c:\VMTK_Centerllines\trachea_centerline.vtp

 

Yes, that's what it looks like to me too because of "Error opening output file..."

 

 

I pasted a screenshot above.  If it doesn't show up and there is a better way to get it to you, let me know.

 

I've searched for hours on google for permission issues regarding Windows 8 and tried as many things as I could think of.  Nothing worked.  From what I can see, it is an absolute nightmare.  It is so complex I don't know how anybody can figure it out.  I am the sole user of this computer.  I am the administrator.    I don't even have a password on it so when I reboot, there is no login.  Yet apparently I am not allowed to write to any folder I've created anywhere on the hard drive.   Advice to anybody considering "upgrading" to W8: Don't do it, you'll be sorry.  W8 sucks big time.

 

Here are some of the things I've tried:

1)  Created subfolder in the standard Documents folder and at C: level

2) Made sure the permissions of each group or user name listed was set to Full control

3) Clicked Advanced button in Security tab.  Disabled inheritance and made sure each Principal was set to Full control.

4) "Open as administrator" a dos shell.  Used the attrib -r -s Drive:Foldername to reset read-only flag and system flag, if set.

5) Created a text file in the folder called trachea_centerlines.vtp.  Set each Principal to Full Control.  (Thinking maybe if a file by that name already existed, maybe it would be able to modify it.)

 

I give up.

image001.png

Luca Antiga

unread,
Sep 6, 2013, 5:29:15 PM9/6/13
to vmtk-...@googlegroups.com
Hi Greg,
 I'm sorry with your experience with vmtk on Windows 8. I have no personal experience with that and do not have a W8 box around, so I can't really help.

Maybe the issue could be related to the fact that the vmtk installer might not be "signed" or might lack a manifest of some kind that could make W8 allow certain operations to it.

From what I'm reading on the Internet

http://www.verboon.info/index.php/2011/03/running-an-application-as-administrator-or-in-compatibility-mode/
http://technet.microsoft.com/en-us/magazine/ff431742.aspx

you should probably try running vmtk in Compatibility, Run as Administrator mode.

It would be great if you found the time to try this out and let me know.

Best,

Luca




On Wednesday, September 4, 2013 5:39:59 PM UTC+2, Greg Hanowski wrote:

Hello Luca,

 

Here is the last command I tried:

Greg Hanowski

unread,
Sep 6, 2013, 11:53:37 PM9/6/13
to vmtk-...@googlegroups.com

Hello Luca,

I normally start vmtk by clicking on the vmtk icon.  If you look at the properties of the icon you see:

 

Notice it starts in C:\Program Files\vmtk\Install\lib\vtk-5.8 where there are many .dll files needed.

There is no "run as administrator" option on .pyw files, only on .exe files.  Presumably because .pyw files run inside of pythonw.exe.  Using the properties window of python.exe, I set the compatibility to Windows 7 (there was no windows 8 option but I've read that W8 is really W7 under the hood, they just screwed up the interface to it).  I can "run as administrator" pythonw.exe.  When I do, I don't see anything happen and a prompt appears asking me if it ran ok.  No idea. 

 

So apparently I will need to open a command prompt "as administrator" and then enter the right line that will run vmtk-exe.pyw but also set the Start in folder.  Something like pythonw.exe vmtk-exe.pyw -s StartFolder.

But I will need help from someone who knows the Windows particulars better than me to get the syntax right.

 

Note that I tried running vmtk like usual after I had set the pythonw.exe compatibility to W7, but got the same error again, so apparently that is not enough.

 

Greg

 

From: vmtk-...@googlegroups.com [mailto:vmtk-...@googlegroups.com] On Behalf Of Luca Antiga
Sent: Friday, September 6, 2013 3:29 PM
To: vmtk-...@googlegroups.com
Subject: Re: [vmtk-users] vmtkcenterlines example

 

Hi Greg,


 I'm sorry with your experience with vmtk on Windows 8. I have no personal experience with that and do not have a W8 box around, so I can't really help.

Maybe the issue could be related to the fact that the vmtk installer might not be "signed" or might lack a manifest of some kind that could make W8 allow certain operations to it.

From what I'm reading on the Internet

http://www.verboon.info/index.php/2011/03/running-an-application-as-administrator-or-in-compatibility-mode/
http://technet.microsoft.com/en-us/magazine/ff431742.aspx

you should probably try running vmtk in Compatibility, Run as Administrator mode.

It would be great if you found the time to try this out and let me know.

Best,

Luca



On Wednesday, September 4, 2013 5:39:59 PM UTC+2, Greg Hanowski wrote:

Hello Luca,

 

Here is the last command I tried:

vmtkcenterlines -seedselector openprofiles -ifile trachea.vtp -ofile c:\VMTK_Centerllines\trachea_centerline.vtp

 

Yes, that's what it looks like to me too because of "Error opening output file..."

 

Image removed by sender.

Error! Filename not specified.


Error! Filename not specified.

Error! Filename not specified.

image001.png
image002.jpg

arumiat

unread,
Jan 10, 2015, 5:27:30 AM1/10/15
to vmtk-...@googlegroups.com
As an update for anyone experiencing the same problems for permission denied errors when trying to write these files on Windows (I'm using Windows 7, hard luck Greg), I used this link http://www.verboon.info/2011/03/running-an-application-as-administrator-or-in-compatibility-mode/
to set Python.exe to run with Administrator privileges, as this wasn't an option for vmtk-exe.py, and this solved the problem.

Anyone know if it's dangerous to run Python in general with Admin privileges?

Best,
T

Luca Antiga

unread,
Jan 10, 2015, 5:50:20 PM1/10/15
to vmtk-...@googlegroups.com
Hello Arumiat,
while good practices suggest that one should avoid running software with Admin privileges, I don't think there's any real threat in running vmtk this way, if this is the only way to make it work on your machine.
I'm wondering how many other users are affected by this issue, any feedback will be helpful.
Best,

Luca

--
You received this message because you are subscribed to a topic in the Google Groups "vmtk-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vmtk-users/U282bsvHBT8/unsubscribe.
To unsubscribe from this group and all its topics, 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."
Reply all
Reply to author
Forward
0 new messages