I would like to know if with ImageJ it is possible to count the number of pixels whose value of green is greater than that of red. And if possible, some idea of how to do it.
[Note that I’ve edited this]
- Open both channels as separate images, or split channels of an RGB image (Image>Color>Split channels…) [I assume each channel is either 8 or 16-bit; 8-bit would be the case with a typical RGB image]
- Subtract red from green (Process>Image Calculator, set Image1 to your green channel and Image2 to your red channel)
- Threshold the result image (Image>Adjust>Threshold) with a value of 1
- Rescale the pixel intensities (because thresholding sets pixels to 255) by using Calculator Plus (Process>Calculator Plus) with i1 and i2 set to your result image and k1 to 1/255 (which is 0.003921568627)
- Select the entire result image (Edit>Selection>Select All)
- Measure the selection (Analyze>Measure)
- Multiply area by the mean value. The result of this is the number of pixels where green is greater than red.
Thanks kephale, I’ll try to do it as you say. Regards