Dear Eduouardo,

Please consider the following macro code:

open("

http://imagej.1557.x6.nabble.com/file/t382607/brut0000-1.jpg");

run("32-bit");

run("Log");

rename("I0");

open("

http://imagej.1557.x6.nabble.com/file/t382607/MAX_seq.jpg");

run("32-bit");

run("Log");

rename("I");

// Difference 1

imageCalculator("Subtract create 32-bit", "I","I0");

run("Multiply...", 0.02173);

rename("Difference1");

// Difference 2

selectWindow("I0");

run("Multiply...", 0.02173);

selectWindow("I");

run("Multiply...", 0.02173);

imageCalculator("Subtract create 32-bit", "I","I0");

rename("Difference2");

// Difference 1 - Difference 2

imageCalculator("Subtract create 32-bit", "Difference1","Difference2");

rename("Difference1-2");

getMinAndMax(min, max);

print(max);

The result of the maximum difference I get is 3.5763E-7 which is within the calculation errors.

Also I guess you are aware that calculations shouldn't be done using jpeg pictures since the format is destrutive.

Additionally, I got all the pasted code using the "Plugins>Macro>Record..." feature.

Feel free to contact me if something is still not clear.

I wish you a happy week-end and Eastern.

Take care,

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

----- Mail original -----

De: "Edouardo" <

[hidden email]>

À: "imagej" <

[hidden email]>

Envoyé: Jeudi 9 Avril 2020 21:47:06

Objet: 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

<

http://imagej.1557.x6.nabble.com/file/t382607/brut0000-1.jpg>

<

http://imagej.1557.x6.nabble.com/file/t382607/MAX_seq.jpg>

--

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