![](https://secure.gravatar.com/avatar/3aa58c446bbefaff35dbd90e27a3a107.jpg?s=120&d=mm&r=g)
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