Rules

Dear all,

I would like to create a filter which could filter dead cells whose nuclei are little and round.
I need the two conditions in the same time ie Area and Formfactor.
With the module FilterObject, I have seen that it is possible to create two filters but how to create a AND.
Maybe I can use the rules ?
Then what are the lines I have to enter in the texte file rules.txt ?
IF (Nuclei_AreaShape_Area < 5000,… ???
IF (Nuclei_AreaShape_FormFactor < 0.4,… ???

Thanks very much for your help.

Mathieu

Hi,

Your idea would be fine, but those Rules are complicated (they come from CellProfiler Analyst’s Gentle Boosting machine learning classier). You could do this, but much easier is to click the button toward the bottom in FilterObjects labeled “Add another measurement”. You can add as many measurements as you like!

Hope that helps,
David

Thanks very much for your answer, it seems feasible like you say but I don’t succeed yet.

My question is how to design the filter in order to filter the round and little cells (AND)…and to keep the other.

I try to make it in two steps :

  1. first filter : keep the little area object (using a limit of the maximum area)= Little_Area_Nuclei
  2. second filter : on Little_Area_Nuclei, I select a minimum value of Form_Factor=0.8 = Little_Area_Round_Nuclei

Then how to remove these objects from my Nuclei objects?

If I try to do the invert (keep the good object by 1) select not too little object, I will loose my little elongated object…

cheers,

Mathieu Fallet

Hi,

A FilterObjects set something like this below will perform an AND operation on the two parameters. It will create a new object called “NonDeadCells” that satisfies both minimum criteria, e.g. here FormFactor > 0.7 and area > 400 pixels.


Then in subsequent modules and in the output files, you would only refer to “NonDeadCells” or whatever you call the newly filtered objects and disregard the previous unfiltered cells set of objects.

Does that make sense?
David

Thanks so much, I think it is clear now.
Cheers,
Mathieu

Argh…Finally I try as you say but clearly it will not do a AND between the two conditions.
My first condition remove the round object (FormFactor<0.6).
BUT I want to keep the big object (even the round) so I put a second condition on the area.
I will expect that a second condition on Area (Area>5000) will restore the big round object but no, it is impossible to restore the big round object, they have been deleted by the first condition…
hum ?

Hi,

Ah, I see what you mean now. Indeed, FilterObjects does not do an AND operation, but rather just sequential filtering steps. However I think you can do what you are proposing with a few extra steps (see attached pipeline example):

  • Filterobjects, then a separate FilterObjects for the other dimension
  • MaskObjects, in which you sequentially mask out the objects based on a single feature

But since this would be much easier if it were a built-in function, I will propose a new CellProfiler feature in FilterObjects, such that with multiple features the user can choose an AND or an OR operation on the multiple features.

Hope that finally helps!
David
DL_2filter.cppipe (12.6 KB)