Ch1 intensity from ch2 image?


When calculating global intensity parameters, BiofilmQ provides me with csv-files containing non-zero intensity values for every image, even though each image is a separate channel.
E.g. image X_ch1 and X_ch2 both have intensity values for ch1 and ch2, and the values are different between the two channels (which I interpret as BiofilmQ finding ch2-signal in the ch1-image, which should not be possible).

Is this a bug that I can ignore?
Is there anywhere I can learn more about the parameters BiofilmQ calculates?

I’ve attached a .csv with some example variables for a few images.
bq_regexp.csv (1.1 KB)


Hi Mark,

the global parameters depend on the settings in the “parameter calculation” tab.

By looking on the parameter names in the csv-file, I guess that you selected “Fluorescence properties” and added “Integrated intensity per object” for channel 1 and 2.

This should only be possible if you work on multi-channel data comprising at least two channels. Otherwise the drop-down menu will not provide the option to calculate the “Integrated intensity per object” for channel 2. (If it does I would be curious about your workflow)

I guess you wrote a custom script/program which collected the intensity information from each individual “*_global.csv” in the “./data/txt_output” folder?

For more information about the parameters you can have a look at the corresponding documentation website or have a look into the supplemental information of the BiofilmQ paper.

Best wishes,


Hi Eric,

That’s right in the parameters-file, both Integrated intensity per object for channel 1 and 2 are checked. The properties are calculated with a custom Matlab script using a single parameters-files.
The images are imported as tiff-stacks with separate channels, combined to be multichannel in BiofilmQ. The “*_global.csv”-files are created for each .tif-stack, which means that the number of global-files equals the number of .tif-files (instead of being halved, as it might be if BiofilmQ calculated properties for each multichannel image).
I still don’t understand why I get values for both channels for each .tif-file.

I get the same output with a manual workflow.

I wrote an R-script to import and combine the global-files, yeah. Works quite well.

The supplementary information is very useful, thank you! Somehow I missed that.


Hi Mark,

The easy option
The easiest option would be, to either upload the custom Matlab script and the parameters.mat here or in a private message (just click on my username). Then I can have a quick look what exactly you have done …

What I guess you have done
From your description, you seem to have a multi-channel image in BiofilmQ, but only segmented one of the available two channels. Afterwards you used the “parameter calculation” to calculate the fluorescent properties. Here, you calculated the integrated intensity per channel and object.

You have to keep in mind, that once you have segmented a channel, a “mask” is created which contains information about the pixels which belong to a certain object. Once the information is extracted, the same pixels can be investigated in the other channels of the multi-channel image.

Just an example workflow:
Let’s say, you are interested in the spatial expression profile of a certain gene.
To test this you can create a bacterial strain with two fluorescent reporters:

  • a constitutive reporter (ch1)
  • a reporter which indicated gene expression (ch2)

You import the corresponding images into BiofilmQ, create a segmentation based on (ch1). This creates the mask for the spatial distribution of the strain. To find out about the gene expression, you have to use the same mask for corresponding positions in the other channel (ch2).

This is why you can extract intensity information of multiple channels with a single segmentation. If you calculate the ratio between the two channels in the given .csv file you can see that files marked with “ch2” have a lower ratio between Intensity_Integrated_ch1_noBackground_mean
/ Intensity_Integrated_ch2_noBackground_mean than the files that are labelled as “ch1”. This is what I would expect in a multi-channel experiment, where the segmentation is created on the labelled channel.


Thank you, that makes a lot of sense and is very helpful! I hadn’t realized that the segmentation created a mask to use in any channel.
That answers my question, thank you!

Just in case you’re still interested, I uploaded the script and parameters files. It’s just a shameless copy of your example batch files.

batch_processing.m (2.8 KB) parameters.mat (7.0 KB)