# Multiplying the log of two images by a constant is giving different results. Classic List Threaded 5 messages Open this post in threaded view
|

## Multiplying the log of two images by a constant is giving different results.

 Good morning, I'm sorry to bother but I'm new to ImageJ. I am trying to apply the Beer-Lambert law to get Absorbance of my images. I have a stack (named I) and the z-projection of max intensity (named I0). Absorbance = ln(I0)-ln(I). I understood that the log in Imagej is ln(p)*255/ln(255) so I have to multiply by 0.02173 to get the ln of my image. The problem: 0.02173*[log(I0)-log(I)] gives me a different value than 0.02173*log(I0)-0.02173*log(I) hence if I make the difference of the two images and then multiply by the constant I get a different value of mean intensity than multiply each image by the constant and the make the difference. Is it a problem in my software? Or is it how imagej function? Because all my data could either be good or wrong. Thank you very much for your help, Best regards, Edouardo -- Sent from: http://imagej.1557.x6.nabble.com/-- ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Open this post in threaded view
|

## Re: Multiplying the log of two images by a constant is giving different results.

 Dear Eduardo, Make sure your calculations are done with pictures in 32Bits depth. Otherwise the best would probably be to make an example of your pictures available. My best regards, Philippe Philippe CARL Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie 74 route du Rhin 67401 ILLKIRCH Tel : +33(0)3 68 85 42 89 ----- Le 9 Avr 20, à 18:59, Edouardo [hidden email] a écrit : Good morning, I'm sorry to bother but I'm new to ImageJ. I am trying to apply the Beer-Lambert law to get Absorbance of my images. I have a stack (named I) and the z-projection of max intensity (named I0). Absorbance = ln(I0)-ln(I). I understood that the log in Imagej is ln(p)*255/ln(255) so I have to multiply by 0.02173 to get the ln of my image. The problem: 0.02173*[log(I0)-log(I)] gives me a different value than 0.02173*log(I0)-0.02173*log(I) hence if I make the difference of the two images and then multiply by the constant I get a different value of mean intensity than multiply each image by the constant and the make the difference. Is it a problem in my software? Or is it how imagej function? Because all my data could either be good or wrong. Thank you very much for your help, Best regards, Edouardo -- Sent from: http://imagej.1557.x6.nabble.com/-- ImageJ mailing list: http://imagej.nih.gov/ij/list.html-- ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Open this post in threaded view
|

## Re: Multiplying the log of two images by a constant is giving different results.

 Dear Philippe, Thank you for your answer, I'm working with 8-bits grayscale images. I'll attach a frame and the z_projection of the sequence. What I'm doing is math->log of each image and then make difference of MAX-seq and brut and then multiply the result with 0.02173 to get ln(I0)-ln(I).  But I realized that if I multiply each log with the constant to get the ln of each image and then make the difference I get different mean values. I am also coupling with a python code using the library pims and I am getting the same result as the second case in ImageJ. I am struggling to understand why doing cte*[log(I0)-log(I)] is different than cte*log(I0)-cte*log(I), the last case being the one I get using python code. Thank you very much, Bien Cordialement, Edouardo -- Sent from: http://imagej.1557.x6.nabble.com/-- ImageJ mailing list: http://imagej.nih.gov/ij/list.html