pelkmanslab / CellProfilerPelkmans

A fork of CellProfiler1.0 developed by members of Pelkmans Lab https://www.pelkmanslab.org
GNU General Public License v2.0
1 stars 1 forks source link

single primary objects filling site #14

Closed tstoeger closed 9 years ago

tstoeger commented 9 years ago

Various later modules (including parts of original CP code) crashed because no background pixel was present. E.g: #11 , but also problem on Discard...Objects

Presence of at least one background pixel (outside of primary objects / nuclei) is inherent assumption of CP. - Possibly there could thus be some later modules, which do not cause break because of forcing a computational "errors", but simply allocate wrong data.

Possibly absence of background pixels is combination of IdentifyPrimary(Iterative?) and low threshold correction factors in different test pipelines.

To me the safest way of preventing these errors / mistakes would be to create a check in IdentifyPrimaryAutomatic / IdentifyPrimaryAutomaticIterative and IdentifySpots2D immediately after the final labelmatrix is constructed and then remove all objects from that site (this will circumvent the generation of any wrong data later on)

Eg. something like if ~any(LabelMatrix(:) == 0) LabelMatrix = zeros(size(LabelMatrix)); end

Otherwise individual later modules would need careful maintenance / review for the handling of such situations / assumption of presence of at least one background pixel (including standard CP modules)