Re: LUTs Tool, Changing the icons ?
Posted by
Tony Collins-2 on
URL: http://imagej.273.s1.nabble.com/LUTs-Tool-Changing-the-icons-tp3703235p3703236.html
Nice one. One problem I have with buttons that cycle is that I tend to
whizz past the option I'd like.
Could you use the isKeyDown("shift") to cycle backwards?
Tony
Gabriel Landini wrote:
> Hi,
> Following the previous LUTs thread, I wrote a little macro tool to load at
> startup (the corresponding fragment is below) .
> Pressing the new icon changes the LUT of the current greyscale image (cycles 4
> LUTs).
>
> Is this possible to change the picture in the button each time it is pressed?
>
> Cheers,
>
> Gabriel
>
> //-------------------->8--------------------
> var GLlut=0;
>
> macro 'Look Up Tables
> Tool-C900L222eCf00L323eCfa0L424eCff5L525eCde7L626eC7f0L727eCbfdL828eC7ffL929eC58fLa2aeC60fLb2beCd0dLc2ceCf8fLd2deCfcfLe2eeCfffLf2fe'{
> restorePreviousTool();
> }
>
> macro "Look Up Tables Tool Selected" {
> if (bitDepth()!=24){
> if (GLlut==0){
> run("Fire");
> GLlut++;
> }
> else if (GLlut==1){
> run("Spectrum");
> GLlut++;
> }
> else if (GLlut==2){
> run("Ice");
> GLlut++;
> }
> else if (GLlut==3){
> run("Grays");
> GLlut=0;
> }
> }
> restorePreviousTool();
> }
>
> //-------------------->8--------------------
--
Tony Collins, Ph.D.
http://www.uhnresearch.ca/wcif
tel. (416) 603 5367
*New Address from May 1st 2006*
McMaster Biophotonics Imaging Facility
Department of Biochemistry and Biomedical Sciences
McMaster University, 1200 Main Street West,
Hamilton, ON, L8N 3Z5