Posted by
Joachim Walter on
Dec 09, 2007; 10:46pm
URL: http://imagej.273.s1.nabble.com/macro-for-Image5d-measuring-an-ROI-in-each-panel-tp3697819p3697821.html
Try this macro. It copies the values from the results table to a sorted
table.
Joachim
%<-snip----------------------------------------
macro "measure I5D-channels [m]" {
getDimensions(width, height, channels, slices, frames);
slicenum = getSliceNumber();
digits=4;
title = "Results "+channels+" channels";
qTitle = "["+title+"]";
// Make Table, if not present, yet
if (! isOpen(title))
{
run("New... ", "name="+qTitle+" type=Table width=60 height=16
menu");
heading = "Ch1";
for (i=2; i<=channels; i++)
{
heading = heading+"\tCh"+i;
}
print(qTitle, "\\Headings:"+heading);
}
// measure
run("Set Position", "channel=1");
run("Measure");
resultsLine=""+d2s(getResult("Mean"), digits);
for (i=2; i<=channels; i++)
{
run("Set Position", "channel="+i);
run("Measure");
resultsLine=resultsLine+"\t"+d2s(getResult("Mean"), digits);
}
print("[Results]","\\Clear");
print(qTitle, resultsLine);
} //end of macro
%<-snip-----------------------------------------
John Alexander schrieb:
> I made this macro to perform the "measure" command on each panel of an
> Image5d file ...
>
> all I am measuring is the integrated density.
>
> macro "I5D meaure [m]" {
> slicenum = getSliceNumber();
> run("Set Position", "x-position=1 y-position=1 channel=1 slice=" +
> slicenum +" frame=1 display=tiled");
> run("Measure");
> run("Set Position", "x-position=1 y-position=1 channel=2 slice=" +
> slicenum +" frame=1 display=tiled");
> run("Measure");
> run("Set Position", "x-position=1 y-position=1 channel=3 slice=" +
> slicenum +" frame=1 display=tiled");
> run("Measure");
> run("Set Position", "x-position=1 y-position=1 channel=4 slice=" +
> slicenum +" frame=1 display=tiled");
> run("Measure");
> }
>
> I then run this command on numerous ROI for each set of images.
>
> What I would like is for each result for each panel to be in a different
> column (to make transporting to excel easier). Currently, they are row
> after row, then in excel I have to split the entire data set into 4
> columns - which is not fun.
>
> John
>
>
>
>
> John Alexander wrote:
>
>> So I have many many 4 channel confocal images which I have put into
>> image5D format for ease in viewing and processing.
>> (I love the new panel feature of image 5d!)
>>
>> Currently, I draw an ROI on one panel, and Image5d draws the same ROI on
>> all corresponding panels. I then click in the center of each ROI and
>> hit 'm' to measure - one at a time.
>>
>> I would like to make a macro so that I can draw an ROI and have the
>> measure results for each panel put into the clipboard automatically -
>> rather than have to go to each panel individually ...
>>
>> I tried using the "record macro", but it does not register a difference
>> between the individual panels of the image5D file ...
>>
>>
>> any advice on how to best do this?
>>
>> John
>>
>>
>
>
--
-----------------------------------------------
Dr. Joachim Walter
TILL I.D. GmbH
c\o BioImaging Zentrum
Großhaderner Str. 2
D-82152 Martinsried
Tel.: +49-89-2180-74189
Fax: +49-89-2180-9974189
Geschäftsführer: Dr. Rainer Uhl
HRB 129399 Amtsgericht München
USt.-IdNr. DE 205045721
------------------------------------------------------------------