Cellprofiler: MeasureObjectNeighbors doesn't work for two different objects

Created on 12 May 2016  路  13Comments  路  Source: CellProfiler/CellProfiler

Runs fine if both objects are set the same, errors out even if the number of both kinds of objects is forced to be the same; seems to be independent of which neighbor-finding method is used. Still present as of the 20160504 nightly, Windows 10 64 bit.

Traceback (most recent call last):
File "cellprofiler\gui\pipelinecontroller.pyc", line 2847, in do_step
File "cellprofiler\pipeline.pyc", line 2103, in run_module
File "cellprofiler\modules\measureobjectneighbors.pyc", line 430, in run
IndexError: index 82 is out of bounds for axis 1 with size 78

See here http://forum.cellprofiler.org/t/measureobjectneighbors-error/3510
And also http://forum.cellprofiler.org/t/win64-cp-2-2-0rc2-rev-1b13225-console-errors/3507/2
http://forum.cellprofiler.org/t/measure-the-object-from-related-objects/3176

Bug Feature request

All 13 comments

Struck again- also fixed the issue title because it was making me not able to find the post.

I've been encountering an identical bug to those described above and will be thrilled when a fix comes out!

Philip Tan
Cardiac Systems Biology Lab
University of Virginia

Is the workaround here to use two separate MeasureObjectNeighbors modules in the pipeline, one for each object type? Or is the usage more complex than that?

I think the use case is the adjacency is being determined between two different objects.

+1 to what Mark said- the use case is 'how close are mitochondria to my nucleus?', which can't be solved by two MeasureObjectNeighbors sadly.

NumPy 1.12 regression?

Confirmed in the forum that it's still an issue in 3.0.0.

Is there a situation where measureObjectNeighbors _doesnt_ throw an index error? I haven't found it yet and I was hoping to use it. I'd be happy to help if anyone has a clue as to where the issue is.. or maybe add a note to the cell profiler docs and remove the option to find a specific object's neighbor?

I manage to make it work in version 3.1.5 for two different objects but for some image sets is working and for others not (the image sets are the same, i.e., biopsies). I can't understand why is working for some of them but not for the others.

@ge2sasag when you say "working", do you mean it doesn't throw an index error on some but does on others?
@nkicg6, do you have an example image set + minimal pipeline that produces the error you'd be willing to share?

I'm also now being stung by this bug in 3.1.9. I have cell types A and B. In my pipeline measuring neighbours for A-A or B-B works fine, but A-B triggers the following:

Failed to run module MeasureObjectNeighbors
Traceback (most recent call last):
  File "CellProfiler\cellprofiler\gui\pipelinecontroller.py", line 2919, in do_step
  File "CellProfiler\cellprofiler\pipeline.py", line 2034, in run_module
  File "CellProfiler\cellprofiler\modules\measureobjectneighbors.py", line 500, in run
IndexError: boolean index did not match indexed array along dimension 1; dimension is 24 but corresponding boolean dimension is 156

I've not found any image sets where there isn't an error.

Interestingly, there's another error when there are no objects in Group B to compare to:

Failed to run module MeasureObjectNeighbors
Traceback (most recent call last):
  File "CellProfiler\cellprofiler\gui\pipelinecontroller.py", line 2919, in do_step
  File "CellProfiler\cellprofiler\pipeline.py", line 2034, in run_module
  File "CellProfiler\cellprofiler\modules\measureobjectneighbors.py", line 473, in run
  File "site-packages\numpy\core\fromnumeric.py", line 2334, in amax
  File "site-packages\numpy\core\fromnumeric.py", line 83, in _wrapreduction
ValueError: zero-size array to reduction operation maximum which has no identity

I think this is a pretty common usage scenario.

Has anyone heard anything on this recently?

@asteeves88 - This fix for this has been added to CellProfiler 4, which we're aiming to release before Python 2's end of life in April.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dlogan picture dlogan  路  9Comments

0x00b1 picture 0x00b1  路  10Comments

0x00b1 picture 0x00b1  路  7Comments

nickholway picture nickholway  路  9Comments

AnneCarpenter picture AnneCarpenter  路  9Comments