# Vmtkcenterlines -seedselector pointlist problem

**URL:** <https://discourse.slicer.org/t/vmtkcenterlines-seedselector-pointlist-problem/14744>\
**Category:** VMTK\
**Created:** [November 23, 2020, 6:08pm UTC](https://discourse.slicer.org/t/vmtkcenterlines-seedselector-pointlist-problem/14744 "2020-11-23T18:08:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haim\_Ezer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/haim_ezer/32/8942_2.png) [@Haim\_Ezer](https://discourse.slicer.org/u/Haim_Ezer)\
**Post date:** [November 23, 2020, 6:08pm UTC](https://discourse.slicer.org/t/vmtkcenterlines-seedselector-pointlist-problem/14744/1 "2020-11-23T18:08:13Z")

</div>

Hello, Luca, Everyone,  
vmtkcenterlines.py -ifile “Case1.vtk” -seedselector pointlist -sourcepoints 0.00571137 -0.01748690 -0.02422070 -targetpoints 0.00571797 -0.00042939 -0.02172360  
But what I get is this:  
Traceback (most recent call last):  
File “C:\ProgramData\VMTK\lib\site-packages\vmtk\pypeserver.py”, line 46, in RunPypeProcess  
pipe.Execute()  
File “C:\ProgramData\VMTK\lib\site-packages\vmtk\pype.py”, line 324, in Execute  
scriptObject.Execute()  
File “C:\ProgramData\VMTK\lib\site-packages\vmtk\vmtkcenterlines.py”, line 595, in Execute  
self.SeedSelector.Execute()  
File “C:\ProgramData\VMTK\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  
ANY IDEAS?  
Thanks  
Haim

---

<div class="post-metadata">

**Author:** ![lantiga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lantiga/32/8424_2.png) [@lantiga](https://discourse.slicer.org/u/lantiga)\
**Post date:** [November 24, 2020, 7:45am UTC](https://discourse.slicer.org/t/vmtkcenterlines-seedselector-pointlist-problem/14744/2 "2020-11-24T07:45:54Z")

</div>

Hi @Haim_Ezer,  
you bumped into an issue related to the Python 3 port.

```python
for i in range(len(self.SourcePoints)/3):

```

should instead be

```python
for i in range(len(self.SourcePoints)//3):

```

Bottomline: in Python 2 division of an integer by an integer yields an integer, while the result of `/` between two numbers in Python 3 yields a float irrespective of the type of the operands. For that you need integer division `//`, which returns an integer irrespective of the type of the operands.

Anyhow, the change is came right after the last release (one more good reason to organize a new release). To patch it in the meantime, you can open your `C:\ProgramData\VMTK\lib\site-packages\vmtk\vmtkcenterlines.py` file with an editor and fix lines 128 and 133 by replacing `/3` with `//3`.

This should solve it in the meantime.

Luca

---

<div class="post-metadata">

**Author:** ![Haim\_Ezer](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/haim_ezer/32/8942_2.png) [@Haim\_Ezer](https://discourse.slicer.org/u/Haim_Ezer)\
**Post date:** [November 26, 2020, 5:47am UTC](https://discourse.slicer.org/t/vmtkcenterlines-seedselector-pointlist-problem/14744/3 "2020-11-26T05:47:12Z")

</div>

Thx Luca,  
This solved my problem!

Just wanted to share an observation:  
It turns that when I scale may surface, the results are amazing!  
I use vmtksurfacescaling - scale 5, and this solves most of the unexpected  
problems.

Thanks again,  
Haim
