Pymorph Label function

15 views
Skip to first unread message

Pankaj Kumar

unread,
Aug 31, 2017, 6:15:25 PM8/31/17
to pythonvision
Hi,

I am using the image matrix which has been dilated using pymorph.dilation, however, when I try to label those dilated cells using pymorph.label then it gives me a following error:

Traceback (most recent call last):
  File "<editor selection>", line 1, in <module>
  File "C:\Python27\Lib\site-packages\pymorph\mmorph.py", line 737, in label
    f = pad4n(f, Bc, 0)
  File "C:\Python27\Lib\site-packages\pymorph\mmorph.py", line 4486, in pad4n
    g[ ch: -ch, cw: -cw] = f
TypeError: slice indices must be integers or None or have an __index__ method

However, when I use mahotas.label then it works well. Can you please help me in it ?

Thanks in advance.

Luis Pedro Coelho

unread,
Aug 31, 2017, 6:17:01 PM8/31/17
to Pankaj Kumar, pythonvision
Hi Pankaj,

Any reason for using pymorph? I maintained it for a while (even though I
didn't start the project), but I don't think anybody is working on it
nowadays.

Except in the few cases where there are pymorph functions not in other
packages, I would recommend the mahotas function (it's also much faster
as it's compiled C++ code).

HTH
Luis

Luis Pedro Coelho | EMBL | http://luispedro.org
My blog: http://metarabbit.wordpress.com
> --
> You received this message because you are subscribed to the Google Groups
> "pythonvision" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to pythonvision...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Pankaj Kumar

unread,
Sep 4, 2017, 10:31:14 AM9/4/17
to Luis Pedro Coelho, pythonvision
Dear Luis,

Many thanks for your response. In that case, I will continue to use Mahotas libraries.

Regards,
Pankaj Kumar

---

Reply all
Reply to author
Forward
0 new messages