macro for Image5d - measuring an ROI in each panel

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

macro for Image5d - measuring an ROI in each panel

John Alexander-7
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
Reply | Threaded
Open this post in threaded view
|

How can I store the results of run("measure") in specific column of the results window?

John Alexander-7
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
>

--
John K. Alexander, Ph.D.
Post-Doctoral Fellow
William Green Laboratory
University of Chicago
Dept. Neurobiology, Pharmacology, and Physiology
947 East 58th Street
Abott Hall 402
Chicago, IL 60637
(off) 773-702-9386
(fax) 773-702-3774
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: macro for Image5d - measuring an ROI in each panel

Joachim Walter
In reply to this post by John Alexander-7
John,

when recording the macro, use the "Image5D->Set Position" plugin to
change the current channel. Actions of this plugin get recorded in the
macro.
Hope this helps,

Joachim

John Alexander schrieb:

> 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
Reply | Threaded
Open this post in threaded view
|

Re: How can I store the results of run("measure") in specific column of the results window?

Joachim Walter
In reply to this post by John Alexander-7
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
------------------------------------------------------------------