'Names and Types' Error on Some Images but not Others

Hi,

First of all thank you for making this software available and arranging an active forum for it.

I use cellprofiler for looking at yeast cells in time-lapse microscopies. The idea is to determine when each cell starts growing. First I use ilastik to make a binary image of the cells vs background. Then my cellprofiler pipeline uses this binary image and the original DIC80 image to extract features from cells and track them in time. Afterwards I use cellprofiler-analyst to classify the cell clumps into one, two, three or more cells.

Now the issue is that my cellprofiler pipeline works nicely on a subset of images and gives error for another subset. The error persists when I try this with cellprofiler versions 2.1.1 and 2.2.0 and in headless and GUI modes and in Ubuntu, Mint and our cluster which uses RHEL.

Here is a link to a sample of images that works and a sample that does not work. The pipelines are identical except for the input images.

Some info that might be useful: I noticed that the images produced by ilastik have different bit-depths for the two sets but changing the bit depth did not help. The pixel classification “binary” images were created using the same ilastik project file but on different computers.

Thank you very much for your help.

Sincerely,

Abbas Jariani

The error:

Traceback (most recent call last):
File “/home/abbas/mySoft/CellProfiler-2.2.0rc3/cellprofiler/gui/pipelinecontroller.py”, line 2826, in do_step
self.__pipeline.run_module(module, workspace)
File “/home/abbas/mySoft/CellProfiler-2.2.0rc3/cellprofiler/pipeline.py”, line 2067, in run_module
module.run(workspace)
File “/home/abbas/mySoft/CellProfiler-2.2.0rc3/cellprofiler/modules/namesandtypes.py”, line 1400, in run
stack)
File “/home/abbas/mySoft/CellProfiler-2.2.0rc3/cellprofiler/modules/namesandtypes.py”, line 1581, in add_objects
cpmeas.OBJECT)
File “/home/abbas/mySoft/CellProfiler-2.2.0rc3/cellprofiler/modules/namesandtypes.py”, line 1515, in add_provider_measurements
img = provider.provide_image(m)
File “/home/abbas/mySoft/CellProfiler-2.2.0rc3/cellprofiler/modules/namesandtypes.py”, line 2048, in provide_image
rescale=False, **properties).astype(int)
File “/usr/local/lib/python2.7/dist-packages/python_bioformats-1.0.5-py2.7.egg/bioformats/formatreader.py”, line 950, in load_using_bioformats
channel_names)
File “/usr/local/lib/python2.7/dist-packages/python_bioformats-1.0.5-py2.7.egg/bioformats/formatreader.py”, line 793, in read
image.shape = (height, width)
ValueError: total size of new array must be unchanged

OK now I see what’s wrong. For some reason the ilastik output was generated with grayscale for some cases but with color for others. I leave the thread here just in case of usefulness for other people.

1 Like

Thank you @Abbas_Jariani for the helpful post and I’m glad you found the answer to your own question. I wanted to highlight your method for using Ilastik with CellProfiler, because I think this is a good work flow for others interested in using both together.