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

Possibly wrong allocation of nucleus and cytoplasm #15

Closed tstoeger closed 9 years ago

tstoeger commented 9 years ago

The object count of nucleus and cytoplasm is not 1:1 in

/BIOL/sonas/biol_uzh_pelkmans_s5/Data/Users/Prisca/240215_siRNA_SM_TfRecycling_SimpleRestart [ append at end varying letters for increasing restarts]

24% of sites have different amount of nucleus and cytoplasm (irrespective of whether ShrinkOrExpand or ShrinkObjects safely was used) ; there are 0% of sites where nucleus and cells differ

Quickly checked one other project (\195.176.109.11\biol_uzh_pelkmans_s7\Data\Users\RNAFish\IndividualExperiments\150430_mycHprtRescanB\JoinedHprtMycRescan\BATCH ) -> there there is no single site where object counts differ between nucleus and cytoplasm

note that wrong object counts per se is not the problem. The problem is that the relation of nuclei and cytoplasm is not 1:1 which can create all kind of wrong allocations of measurement data later on (e.g: swapping measurement data of different cytoplasm to other nuclei...).

Possibly related to https://github.com/pelkmanslab/iBRAIN_BRUTUS/issues/9

Since we already have some test pipelines, a systematic comparison of their results might be able to narrow down the source of the problem.

tstoeger commented 9 years ago

Trying locally with a shortened pipeline (which basically stops immediately after the tertiary object detection, and which I can not upload to github because of the file format! - while trying to make a defined testset), the number of cytoplasms is different than on cluster (and indeed correct)

Testing full pipe locally is not possible due to https://github.com/pelkmanslab/iBRAIN_BRUTUS/issues/12 - which may or may not be related. Thus I now could not make a simple testset. Please try to figure out origin of this bug (or bugs) on /BIOL/sonas/biol_uzh_pelkmans_s5/Data/Users/Prisca/240215_siRNA_SM_TfRecycling_SimpleRestart . - I will not be able to contribute by making a defined test set. - Possibly problems (including wrong illumination correction / fusion error / mismatch between counted nuclei and cytoplasms) are linked.

Whatever the causes of all these open problems, there appears to be a at least one serious problem.

ewiger commented 9 years ago

This problem is not related to NaNs in illumination correction which was fixed.

The bug description is the following:

Possible solution: add a sanity check into IdentifyPrimaryIterative to avoid mis-segmenting the whole image as nucleus (primary object) (see #14 )

Example site images were the bug is reproducible:

TIFF/141007_SMsiRNA_M11_T0001F015L01A03Z01C01.png TIFF/141007_SMsiRNA_M11_T0001F015L01A02Z01C02.png TIFF/141007_SMsiRNA_M11_T0001F015L01A01Z01C03.png TIFF/141007_SMsiRNA_M11_T0001F015L01A03Z01C04.png
tstoeger commented 9 years ago

Using

141007_SMsiRNA_C04_T0001F005L01A01Z01C03 site

I could now exclude that the wrong count is introduced after the initial IdentifyTertiaryModule

The amount of unique elements gets reduced from 96 to 92 upon the line

SubregionObjectImage(ErodedPrimaryObjectImage~=0) = 0;

In addition the measurement of "object counts" itself is wrong as it counts objects by looking for the highest Id of an present object instead of really counting the objects. (which might mask the present problem if any object, which is not the last object has been removed)

handles.Measurements.Image.ObjectCount{handles.Current.SetBeingAnalyzed}(1,column) = max(SubregionObjectImage(:));