ExportData chokes on fields with zero identified objects



The ExportData Data Tool fails in CP 1.0.5122_XP32 when both:
a) IdentifyPrimAutomatic has failed to identify primary objects during at least one cycle, and
b) IdentifySecondary has been invoked on the same primary objects.

Information about primary objects may be exported but attempting to export Image or secondary object data fails with the error:

Error using ==> cat
CAT arguments dimensions are not consistent.

CPwritemeasurements in C:\opt\CellProfiler_1.0.5122_XP32\CellProfiler_mcr\CPsubfunctions\CPwritemeasurements.m (76)
ExportData in C:\opt\CellProfiler_1.0.5122_XP32\CellProfiler_mcr\DataTools\ExportData.m (99)

A trivial pipeline and sample images that reproduce the error, with an output file produced by same, can be found at dl.getdropbox.com/u/3720/testset.zip.

I should note that this appears unrelated to the similar bug reported elsewhere in this forum, as it does not require the use of the Relate module to reproduce it and does not require measurements to be taken.


Exporting the Image.xls file produced in batch mode
Error when exporting cells to Excel
Export to Excel

A quick but possibly insufficient fix:

Add after line 72 of CPwritemeasurements.m:
if isempty(Measurements{j})

and again after line 209.

I’m pretty sure this only works because Parent is the first field to be processed. When there are no objects (and thus no parents), handles.Measurements.Cells.Parent{<empty_image_index>} returns a 1x0 empty matrix; most of the other fields instead seem to contain a 1xn matrix of zeros – it’s the attempt to concatenate a set of zeros to an empty matrix that fails.



Hi Tim,

Thanks for posting this. We had also noticed problems when images had zero objects defined and exported. These should be fixed in the next release of CellProfiler.

Also note this post (viewtopic.php?f=3&t=349#p1509) addresses similar issues which may “relate” to the Relate module. I believe this is fixed here, too, though we are in the process of checking these, including testing the case in which there are cycles with zero objects.


Export to Excel