Hello Ivo,
thanks for taking your time for evaluating my code!

1. Matplotlib GUI. What interaction possibilities are missing in your opinion? Click and drag are available already, what else do you think would be helpful for a good illustration of the algorithm?
2. Cost computation. That's a good point. I am not sure if there is a way to effectively compute the shortest path exactly on a large image matrix. A good heuristic that limits search to a local neighbourhood might help here. The bottleneck seems to stem from the dictionary representation of the graph. The conversion takes extremely long for large images.
3. The gradient image. The notebook thresholds a gradient image in order to ignore the minor intensity differences along the boundary. That was chosen as a heuristic and as well as Gaussian smoothing are optional steps inside the algorithm. You can check the API here: https://github.com/pdyban/livewire/blob/master/livewire/livewiresegmentation.py

In my next step - until Juan or Emmanuelle reply - I will integrate the shortest path computation from skimage's graph module.

Thanks,
Pavlo

On Tuesday, 1 March 2016 16:12:27 UTC+1, Ivo Flipse wrote:


Hi Pavlo,

I did manage to get your example code working, though I agree with Stéfan that the Matplotlib GUI doesn't really enable great interactivity.

I also tried loading a different image (a frontal view X-ray of the hips), but since it was really big (4kx4k) your cost calculation became pretty slow, so there's room for improvement there ;-)
Also, the choice of filter and threshold didn't work out at all for my image, so that should probably be more configurable.
I was rather surprised how well it worked, given that it only calculates a minimal cost path. I reckon that once the edges aren't as strong as they are in this image, it won't perform as well.
Then fixing such segmentations suddenly becomes a lot more painful in my experience, because the algorithm won't help you anymore and you don't want to have to draw the entire path by hand.
Perhaps Emmanuelle or Juan has any suggestions on how we can make the calculations more robust?

Ivo