Calculating images in fiji

Hello to all,

Does anybody have a solution for my problem with Fiji?

  1. I opened RGB image and divide it in 3 channels, red, blue and green.
  2. Then i made one roi
  3. Then for example i take red channel and measure values of roi that i selected and fiji given me some values, for example mean value is 350
  4. Then i use multiply function for that R channel and multiply it by 2 and get new image.
  5. After that i used the same roi that i used in step 3 ( on regular image of R channel) and made measurements. The result for mean value was not 700, which i expected because 350x2 should be 700. It showed me different result it showed me 650.
    So i hope that you understand me, and i would be happy if someone can help me.
    Best regards.

Hi Pedja,

My first thought is to do with the bit-depth of your initial image. If your image is an 8-bit image for example, the max value you can have in your image is 255. If any of the values in your ROI are greater than 127 then they will max out at 255 because higher values can’t be held. This clipping of values could lead to your ROI mean being less than 2* the original value.

When you open your image it should have the bit depth of the image listed at the top. I would advise
you look at your histogram (Analyze > Histogram) to look at the values in your image before and after the math process to see if you are clipping the data as described before.



Hi Laura,

Thank you for your answer and help.
Yes my images are 8-bit, so any value higher than 255 is shown also as 255 and that i guess messed up my calculation.
But i still have some questions.
First this is the image that i want to process, this is the soybean field trial, after image upload i make ROI on one parcel and on that parcel i want to make this calculation 2G-R-B (to multiply values on green channel and subtract it with values on blue and red channel).

Next step that i do is to make RGB stack and divide it to R, G and B channel.
After that i measure values of ROI on that specific parcel on all three channels.
This are the results
Area Mean StdDev IntDen
R 32640|148.08|26.14 4823993
G 32640|144.11|20.53 4703596
B 32640|125.92|32.1 4109923
After that if i do simple math and multiply values of G channel for example for mean values i get 288.22.
The equation from the start was 2G-R-B= 288.22-148.08-125.95=14.22
So this is the value that i get when im using that mathematical method for calculating 2G-R-B value.
But if i try to get 2G-R-B value in this another way this are the steps:

  1. Split channels
  2. Multiply G channel of image using process>math>multiply by 2
  3. And then from that new G channel (2G) i subtract R channel and B channel and get new slide
  4. Than on that final image i put same ROI as on first get value of 9.99 for mean value and that is not the same as 14.22 that i get when i calculated 2G-R-B with mathematical way.
    So i dont know how this happened i should get same results or m i wrong?

Hi Pedja,

If you were only doing the multiplication step I would suggest first converting your image to 16-bit which is capable of holding 0-65535 values and thus is capable of doubling an 8-bit image without losing any information. However, because you are then subtracting two images from this image you will need to convert to 32-bit to allow for negative values.

So basically your different answers could be happening due to some values getting clipped at 255 as I described when doubling the green channel but also could be due to values getting clipped at zero once you take the other two images away from the doubled green channel.

If you repeat your steps again but before splitting the channels you add a step where you go to “Image > Type > 32-bit” and then do everything again you should get the exact same value. This command converts your image to what is called signed 32-bit floating-point grayscale. This allows you to hold a much larger number of values, including negative values.


1 Like

Hi Laura

I have done everything you suggested and it work, thank you very much, you helped me a lot.

Best regards,

1 Like