Posted by
CARL Philippe (LBP) on
Oct 20, 2014; 10:42am
URL: http://imagej.273.s1.nabble.com/Plugin-for-finding-average-of-top-5-intensities-in-an-image-file-tp5010099p5010115.html
Dear Yaseen,
There are a couple of ways of running a macro, but since you are a beginner I will describe you what is probably one of if not the easiest one.
So just create a file called whatever you want with underscores and the extension .ijm (like "my_macro.ijm") that you save in your Fiji/ImageJ plugin folder and containing the following ASCII code (the file should be created and saved through the software Notepad or an equivalent of it, i.e. do not use Word or similar software for this):
getDimensions(width, height, channels, slices, frames);
val = newArray(width * height);
for(i = 0; i != width; i++)
for(j = 0; j != height; j++)
val[i * height + j] = getPixel(i, j);
Array.sort (val);
Array.reverse (val);
sub = Array.trim(val, 5);
Array.getStatistics(sub, min, max, mean, stdDev);
print(mean);
Once done, just open your Fiji/ImageJ software, open the picture you want to get the values from and then run your macro from your Fiji/ImageJ plugin menu.
In the case you have still some difficulties using the macro after these explanations, it would maybe be better that you contact me out of the list.
My best regards,
Philippe
Philippe CARL
Laboratoire de Biophotonique et Pharmacologie
UMR 7213 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84
-----Message d'origine-----
De : ImageJ Interest Group [mailto:
[hidden email]] De la part de Yaseen Ladak
Envoyé : lundi 20 octobre 2014 12:28
À :
[hidden email]
Objet : Re: Plugin for finding average of top 5 intensities in an image file.
Hello Philippe,
So I should copy paste this in a file and save it where and what should be the extension. How should I also run it? I am very new to this.
Kind regards,
Yaseen Ladak
Email:
[hidden email]
Skype: yaseen.ladak
On 20 October 2014 11:10, Emanuele Martini <
[hidden email]> wrote:
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html