# Vmtk Vesselness Filtering: select seedpoint in Python

**URL:** https://discourse.slicer.org/t/vmtk-vesselness-filtering-select-seedpoint-in-python/24135
**Category:** Support
**Tags:** segmentation, python, vmtk, vessels
**Created:** [July 1, 2022, 9:31am UTC](https://discourse.slicer.org/t/vmtk-vesselness-filtering-select-seedpoint-in-python/24135 "2022-07-01T09:31:59Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![KateDelb](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/katedelb/32/14981_2.png) [@KateDelb](https://discourse.slicer.org/u/KateDelb)
#### Post date: [July 1, 2022, 9:31am UTC](https://discourse.slicer.org/t/vmtk-vesselness-filtering-select-seedpoint-in-python/24135/1 "2022-07-01T09:31:59Z")

</div>

Hey!

I’m using the VMTK VesselnessFilter to find my vessels in a T1ce image. I did this manually in 3DSlicer with no issues.  
However, I’m seeing that I get better results when I select a seedpoint to determine the min/max vessel diameter.

Now I’d like to implement the same process in python/JupyterNotebooks.  
I have a working piece of code that finds the vesselness, but can’t seem to figure out how to manually add a seedpoint.  
Here is the code:

> **#Push input volume to node**  
> InputVolumeNode = su.PushVolumeToSlicer(t1ce\_brain)
> 
> dim\_in = t1ce\_brain.GetSize()  
> spacing\_in = t1ce\_brain.GetSpacing()
> 
> **#Create output volume with same dim and spacing of InputVolume**  
> OutputNode = createEmptyVolume(dim\_in, spacing\_in, ‘VesselnessFiltered’) # invoke function
> 
> **#create vesselness filtering logic**  
> vfl = VesselnessFiltering.VesselnessFilteringLogic()  
> **#Select seed to determine min/max vessel diameter**  
> #TODO  
> **#compute VesselnessFiltering**  
> vfl.computeVesselnessVolume(InputVolumeNode, OutputNode, minimumDiameterMm=1, maximumDiameterMm=6, alpha=0.3, beta=0.3, contrastMeasure=130)

I can see that I can set the minimum/maximumDiameter inside the computeVesselnessVolume function, but I’m not sure how to find these automatically by setting a seedpoint (Fiducials.

I was looking through [SlicerExtension-VMTK/VesselnessFiltering/VesselnessFiltering.py at master · vmtk/SlicerExtension-VMTK · GitHub](https://github.com/vmtk/SlicerExtension-VMTK/blob/master/VesselnessFiltering/VesselnessFiltering.py) for hints, but this seems to be the code to select this point within the GUI node.  
using

> **#Select seed to determine min/max vessel diameter**  
> vfl.seedFiducialsNodeSelector((x,y,z))

gives the error

> AttributeError: ‘VesselnessFilteringLogic’ object has no attribute ‘seedFiducialsNodeSelector’

so I’m clearly not on the right path. How can I select this seedpoint in python?

Thanks for any help!

---

<div class="post-metadata">

### Author: ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)
#### Post date: [July 3, 2022, 1:51am UTC](https://discourse.slicer.org/t/vmtk-vesselness-filtering-select-seedpoint-in-python/24135/2 "2022-07-03T01:51:48Z")

</div>

You can probably use the same minimum and maximum diameters and contrast difference and other filtering parameters for similar images. So, you can determine the optimal parameters by using the module GUI and then use them in your Python scripts.
