Greetings Patricia,
below please find some macro code that provides the matrix-table
representations of RoIs, provided the image without the RoIs is open in
ImageJ. The macro first asks for the RoI-file and saves the tables to
the folder where the RoI-file is stored.
//
requires("1.54m");
roiManager("reset");
roi=File.openDialog("Open the RoI-file.");
pth=File.getDirectory(roi);
roiManager("Open",roi);
n=roiManager("count");
for ( i=0; i<n; i++ ) {
roiManager("select",i);
run("Image to Results");
saveAs("Results",pth+"RoI-"+RoiManager.getName(i)+".csv");
close("Results");
}
run("Select None");
exit();
//
Good luck
Herbie
::::::::::::::::::::::::::::::::::::::::::::
Am 28.10.24 um 08:17 schrieb OBEID Patricia:
Thank you very much Wayne!
I would like to obtain the value of each pixel in several ROIs (2 to 3) of
the image and not in the whole image.
How can I apply the "Image to Results" command via a macro?
My ROIs are in a folder called "RoiSet.zip".
Many thanks
Patricia
-----Message d'origine-----
De�: Wayne Rasband <[email protected]>
Envoy�: dimanche 27 octobre 2024 14:06
��: [email protected]
Objet�: Re: Intensity of each pixel
On Oct 27, 2024, at 4:38 AM, OBEID Patricia <[email protected]> wrote:
Hello,
I would like to know if it is possible to obtain a table with the
intensity of each pixel in a ROI.
If so, how can I do this?
Use the Image>Transform>Image to Results command.
-wayne
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html