Re: dialog box
Posted by Michael Doube-2 on Nov 09, 2005; 2:08pm
URL: http://imagej.273.s1.nabble.com/dialog-box-tp3704509p3704512.html
Thanks for the suggestion Gabriel
>Could you embed the data in the image
>
>
I wrote a script that can do this. However, it won't run if included
after a line that automates image sequence opening, only by itself.
How can I make all of this macro work in one go - for example after a
key press? It seems to stop after the first line.
Thanks
Mike
-----------CartilageOpener.txt-------------
//import image sequence
run("Image Sequence...", "number=999 starting=1 increment=1 scale=100
file=tif");
//Make a dialog box
Dialog.create("Specimen Information");
Dialog.addCheckbox("Lateral to left (uncheck if right)", true);
Dialog.addCheckbox("Surface milled (uncheck if polished)", true);
Dialog.show();
left = Dialog.getCheckbox();
milled = Dialog.getCheckbox();
//do for all slices
if (nSlices>1)
n = getSliceNumber();
for (i=1; i<=nSlices; i++) {
setSlice(i);
//set logical values
if (left==true)
left = 1;
else
left = 0;
if (milled==true)
milled = 1;
else
milled = 0;
//append to metadata string
image = getMetadata();
setMetadata(left+""+milled+""+image);
setSlice(n);
}
--
Michael Doube BPhil BVSc MRCVS
MPhil / PhD Student
Dental Institute
Barts and The London School of Medicine and Dentistry
Queen Mary, University of London
New Rd
London E1 1BB
United Kingdom
Phone +44 (0)20 7377 7000 ext 2681