TypeError with pointlist

46 views
Skip to first unread message

Hannes

unread,
Aug 12, 2020, 6:13:40 AM8/12/20
to vmtk-users
Dear vmtk-community,
my goal is to compute the centerline for an artery given as Surface Mesh (".vtk").
I used -seedselector pointlist -sourcepoints 48.478 32.2861 2.267 -targetpoints 73.062 53.0041 -132.212 and computed the centerline.

I get a TypeError:

Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\envs\venv\lib\site-packages\vmtk\pypeserver.py", line 46, in RunPypeProcess
    pipe.Execute()
  File "C:\ProgramData\Anaconda3\envs\venv\lib\site-packages\vmtk\pype.py", line 324, in Execute
    scriptObject.Execute()
  File "C:\ProgramData\Anaconda3\envs\venv\lib\site-packages\vmtk\vmtkcenterlines.py", line 595, in Execute
    self.SeedSelector.Execute()
  File "C:\ProgramData\Anaconda3\envs\venv\lib\site-packages\vmtk\vmtkcenterlines.py", line 128, in Execute
    for i in range(len(self.SourcePoints)/3):
TypeError: 'float' object cannot be interpreted as an integer


How can I fix this error?

Thanks,
Hannes

Evan Kao

unread,
Aug 12, 2020, 8:07:26 PM8/12/20
to vmtk-...@googlegroups.com
Hello Hannes,

It's a bug, I think leftover from years ago when VMTK switched from Python 2 to 3.  It was fixed in the original source code a couple years ago, but apparently not in the conda package.  Fortunately, it should be easy to fix.  You can see the changes in this commit.  Just find the file (vmtkcenterlines.py) and line (128, and also 133) where the error occurs, and add another division symbol.

- Evan

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/vmtk-users/4c197a1d-af23-47e2-a0b8-16a009d1c69eo%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages