Assertion error while using the PlaneCA1PC

20 views
Skip to first unread message

Gilles Vanwalleghem

unread,
Sep 17, 2015, 2:10:54 AM9/17/15
to sima-users
Hello,

First thanks for the package. I am trying to use it to analyze our nuclear targeted GCaMP (May the nuclear targeting be the issue ?). So I am trying to apply the tutorial to our dataset :

segmentation_approach = sima.segment.PlaneCA1PC(
    num_pcs=30,
    max_dist=(4, 4),
    spatial_decay=(2, 2),
    cut_max_pen=0.10,
    cut_min_size=50,
    cut_max_size=150,
    x_diameter=6,
    y_diameter=6,
    circularity_threhold=.5,
    min_roi_size=20,
    min_cut_size=40
)
dataset.segment(segmentation_approach, 'auto_ROIs')

And I end up with an assertion error :
Either on the local computer 

\Anaconda\lib\site-packages\sima\segment\normcut.pyc in calculate(self, dataset)
    405                             (y + dy < shape[0]):
    406                         w = self._weight(r0, r1)
--> 407                         assert np.isfinite(w)
    408                         a = x + y * shape[1]
    409                         b = a + dx + dy * shape[1]

AssertionError: 

or on a virtual machine :

/home/ubuntu/anaconda/lib/python2.7/site-packages/sima/segment/normcut.pyc in calculate(self, dataset)
    405                             (y + dy < shape[0]):
    406                         w = self._weight(r0, r1)
--> 407                         assert np.isfinite(w)
    408                         a = x + y * shape[1]
    409                         b = a + dx + dy * shape[1]

AssertionError: 

Do you have any advice on what to change ? I am trying to run other segmentation approaches and so far it looks like they are proceeding.

Thank you

Patrick Kaifosh

unread,
Sep 22, 2015, 10:40:21 PM9/22/15
to sima-...@googlegroups.com
It's hard to tell you much just based on the error message. You could
try using pdb and see if you can figure out any clues (e.g. find out
what caused w to become non-finite)? I don't think the nuclear targeting
would be the issue there, but I wouldn't recommend the PlaneCA1PC for
nuclear targeted-GCaMP in general because it relies on an assumption
that the GCaMP signal is darker in the nucleus and brighter in the
cytoplasm -- definitely not true in your case. With nuclear GCaMP, I
imagine the segmentation problem should be a fair bit easier. However,
we haven't written any code for that case. Maybe you will?

Gilles Vanwalleghem wrote:
> Hello,
>
> First thanks for the package. I am trying to use it to analyze our
> nuclear targeted GCaMP (May the nuclear targeting be the issue ?). So
> I am trying to apply the tutorial to our dataset :
>
> segmentation_approach = sima.segment.PlaneCA1PC(
> num_pcs=30,
> max_dist=(4, 4),
> spatial_decay=(2, 2),
> cut_max_pen=0.10,
> cut_min_size=50,
> cut_max_size=150,
> x_diameter=6,
> y_diameter=6,
> circularity_threhold=.5,
> min_roi_size=20,
> min_cut_size=40
> )
> dataset.segment(segmentation_approach, 'auto_ROIs')
>
> And I end up with an assertion error :
> Either on the local computer
>
> \Anaconda\lib\site-packages\sima\segment\normcut.pycin calculate(self,
> dataset)
> 405 (y + dy < shape[0]):
> 406 w = self._weight(r0, r1)
> --> 407 assert np.isfinite(w)
> 408 a = x + y * shape[1]
> 409 b = a + dx + dy * shape[1]
>
> AssertionError:
>
> or on a virtual machine :
>
> /home/ubuntu/anaconda/lib/python2.7/site-packages/sima/segment/normcut.pyc in calculate(self, dataset)
> 405 (y + dy < shape[0]):
> 406 w = self._weight(r0, r1)
> --> 407 assert np.isfinite(w)
> 408 a = x + y * shape[1]
> 409 b = a + dx + dy * shape[1]
>
> AssertionError:
>
> Do you have any advice on what to change ? I am trying to run other segmentation approaches and so far it looks like they are proceeding.
>
> Thank you
> --
> You received this message because you are subscribed to the Google
> Groups "sima-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to sima-users+...@googlegroups.com
> <mailto:sima-users+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/sima-users/9c6e9ef1-f8f3-494a-b04a-8dfe1dcae103%40googlegroups.com
> <https://groups.google.com/d/msgid/sima-users/9c6e9ef1-f8f3-494a-b04a-8dfe1dcae103%40googlegroups.com?utm_medium=email&utm_source=footer>.
> For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages