Cell Paint: Rules file from CPA and FlagImage module of CP


Hello all,
I am a student of the master’s course in Japan.
I cannot figure out how to generate rules file as text format by CPA for applying it to FlagImage module of CP.

I am trying to do Cell Paint assay referring to [Bray et al. Nat. Proc. 2016] and [Bray et al. J. of Biomol. Screening, 2012].
Now, I have a question about quality control, especially FlagImage module.
I cannot figure out how to generate rules file as text format by CPA for applying FlagImage module of CP.
I would like to eliminate saturated or blurry images from my images.
I can generate property files with the quality control pipeline provided in [Bray et al. Nat. Proc. 2016] .
Also, I can classify images with Classifier of CPA, and evaluate blurry threshold from histograms visually.

Would anyone give me some advice?



Once you have rules from your classification (using FastGentleBoosting as your classifier is easiest for this, as it’s the only module that returns rules instead of features), you can go to “Edit rules” in the Classifier -> Advanced menu, then select and copy them all into a text file. You can then use FlagImage’s “Rules” setting and upload that text file.

Does that make more sense?


Hi bcimini,

Thank you for your quick response!
Yes, I read this topic (I cannot find rules in CPA).

I can get the text file in which rules are written like
"IF (Nuclei_RadialDistribution_FracAtD_Hoechst_2of4 > 0.34689900000000001, [0.76363739159785271, -0.76363739159785271], [-0.99999997849088318, 0.99999997849088318])".
I have uploaded the rule file.rules.txt (720 Bytes)

Then, I receive the error ‘The rules describe objects instead of images’ from FlagImage module.
So, I am confused.

I think FlagImage module uses tags (0 or 1, pass the threshold or not) for each image.
But, the rules file contains rules for not images but objects like nuclei.

I am sorry for my insufficient explanation for 1st posting.


Ah! Then the problem is in your QC pipeline and/or your properties file- you’re classifying OBJECTS it sounds like, not images. When you drag and drop things into bins, were they whole images or cells?

Can you upload the pipeline you used to run QC and the properties file it generated?


Hi, bcimini

Sure, I have uploaded QC pipeline (083117_qc.cppipe (23.4 KB)) and the property file (Example.properties (6.2 KB))
I use whole images (TIF) which obtained with an automatic microscopy. These images contains a lot of cells.

Thank you for your help!


That’s not the standard QC pipeline included in Bray 2016- it should ONLY contain MeasureImageQuality modules between the input and Export modules. Run the standard pipeline on your images and then you’ll have more success.


OK, I will try with standard QC pipeline and post the result later.

Classification of images only

Hi bcimini,

Thank you for your help a lot.

Unfortunately, I cannot still open Classifier.

I used this QC pipeline (takataka_qc.cppipe (21.4 KB))
and got this properties file (takataka.properties (7.3 KB)).

When I open this properties file with Classifier on CPA, the error message “Propoerties field object_table is required for Classifier”.

Does this QC pipeline have something wrong??



What version of CPA are you using, the current stable? Your properties file looks exactly like ones I’ve used for this workflow that have worked fine…



My CPA is version 2.2.1 (stable) and OS is windows 10.
OK, I will reinstall CPA and try.
To make sure, I have attached the picture of the error message.


Aha, I found it- set your classification_type to “image”; you may also want to set check_tables to “no”, though that’s just to make it run faster.


Wow, Great!!!
Now, both Classifier and FlagImage module work well.
I overlook the final line in the Section “III” of the online manual of CPA.

I appreciate your kindly help for the beginner of image analysis with CPA!