![](https://secure.gravatar.com/avatar/b8db648ce5b0b58a7dda6eab71e5a98f.jpg?s=120&d=mm&r=g)
Hi Luis, a bit prolonged reply, but as I remembered this messages thought to maybe get to you :) I wanted to try next on, with "skeleton-ing" some images, but "ndimage" doesn't have this function AFAIK. Then I googled and pointed to "pymorph" which I assume you are the author. So I'm curious, why did you recommended "mohotas", when "pymorph" seems like made for morphological analysis? Regards, klo On Mon, Apr 2, 2012 at 6:25 PM, Luis Pedro Coelho <lpc@cmu.edu> wrote:
On Saturday, March 31, 2012 08:08:41 PM klo uo wrote:
I tried grey opening on sample image with both modules. Approach seems good and result is bit identical with both modules (footprint=square(3)), and I thought to comment on differences on both modules:
- skimage requires converting data type to 'uint8' and won't accept anything less - ndimage grey opening is 3 times faster on my PC
Mahotas (which I wrote): http://luispedro.org/software/mahotas is closer in implementation to ndimage and should be as fast (as well as supporting multiple types).
It doesn't have the open() operation, but you can dilate() & erode() yourself:
def open(f, Bc, output=None): output = mahotas.dilate(f, Bc, output=output) return mahotas.erode(f, Bc, output=output)
(Also, I think that the skimage erode() & dilate() are for flat structuring elements only, but that doesn't seem to be an issue for you).
HTH, -- Luis Pedro Coelho | Institute for Molecular Medicine | http://luispedro.org