Hi all,
I am using the "Remove slcies..." function in a macro, and I would like to be able to set the first and last images using variables. If I use the methods below... not problems: run("Remove Slices...", "first=1 last=15 increment=2"); but I would like to be able to set first=X and last=Y dynamically to make the macro more robust., unfornuately the following doesn't work. a = X b = Y run("Remove Slices...", "first=a last=b increment=2"); // where a and b are integer variables. Is this not possible, or have I just messed up with my syntax? Cheers, Damon |
>Hi all,
> > I am using the "Remove slcies..." function in a macro, and I would >like to be able to set the first and last images using variables. >If I use the methods below... not problems: >run("Remove Slices...", "first=1 last=15 increment=2"); > >but I would like to be able to set first=X and last=Y dynamically to >make the macro more robust., unfornuately the following doesn't work. >a = X >b = Y >run("Remove Slices...", "first=a last=b increment=2"); // where a >and b are integer variables. > >Is this not possible, or have I just messed up with my syntax? > >Cheers, >Damon Just think of string/variable-combinations... run("Remove Slices...", "first=" + X + " last=" + Y + " increment=2") Watch the necessary blanks! HTH -- Herbie ------------------------ <http://www.gluender.de> |
In reply to this post by dpoburko
Probably syntax.
run("Remove Slices...", "first=" + a + "last=" + b + "increment=2"); Ryan Deaton Pathology Information Systems Specialist University of Illinois at Chicago 312-355-4338 -----Original Message----- From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Damon Poburko Sent: Monday, January 26, 2009 11:24 AM To: [hidden email] Subject: Re: variable in "Remove slices..." Hi all, I am using the "Remove slcies..." function in a macro, and I would like to be able to set the first and last images using variables. If I use the methods below... not problems: run("Remove Slices...", "first=1 last=15 increment=2"); but I would like to be able to set first=X and last=Y dynamically to make the macro more robust., unfornuately the following doesn't work. a = X b = Y run("Remove Slices...", "first=a last=b increment=2"); // where a and b are integer variables. Is this not possible, or have I just messed up with my syntax? Cheers, Damon |
Perfect. That did the trick. Thanks!
Ryan Deaton wrote: > Probably syntax. > > run("Remove Slices...", "first=" + a + "last=" + b + "increment=2"); > > Ryan Deaton > Pathology Information Systems Specialist > University of Illinois at Chicago > 312-355-4338 > > -----Original Message----- > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Damon > Poburko > Sent: Monday, January 26, 2009 11:24 AM > To: [hidden email] > Subject: Re: variable in "Remove slices..." > > Hi all, > > I am using the "Remove slcies..." function in a macro, and I would > like to be able to set the first and last images using variables. > If I use the methods below... not problems: > run("Remove Slices...", "first=1 last=15 increment=2"); > > but I would like to be able to set first=X and last=Y dynamically to > make the macro more robust., unfornuately the following doesn't work. > a = X > b = Y > run("Remove Slices...", "first=a last=b increment=2"); // where a and b > are integer variables. > > Is this not possible, or have I just messed up with my syntax? > > Cheers, > Damon > -- Damon Poburko, PhD Postdoctoral Research Fellow Stanford University School of Medicine Dept. of Molecular & Cellular Physiology 279 Campus Dr., Beckman B103, Stanford, CA 94305 Ph: 650 725 7564, fax: 650 725 8021 |
>Perfect. That did the trick. Thanks!
> >Ryan Deaton wrote: >>Probably syntax. >>run("Remove Slices...", "first=" + a + "last=" + b + "increment=2"); >> >>Ryan Deaton >>Pathology Information Systems Specialist >>University of Illinois at Chicago >>312-355-4338 >> -----Original Message----- >>From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of Damon >>Poburko >>Sent: Monday, January 26, 2009 11:24 AM >>To: [hidden email] >>Subject: Re: variable in "Remove slices..." >> >>Hi all, >> >> I am using the "Remove slcies..." function in a macro, and I >>would like to be able to set the first and last images using >>variables. >>If I use the methods below... not problems: >>run("Remove Slices...", "first=1 last=15 increment=2"); >> >>but I would like to be able to set first=X and last=Y dynamically >>to make the macro more robust., unfornuately the following doesn't >>work. >>a = X >>b = Y >>run("Remove Slices...", "first=a last=b increment=2"); // where a >>and b are integer variables. >> Is this not possible, or have I just messed up with my syntax? >> >>Cheers, >Damon I'm sure that what "Ryan Deaton" has proposed didn't do the trick, because the essential blanks are missing. Best -- Herbie ------------------------ <http://www.gluender.de> |
Gluender wrote:
>> Perfect. That did the trick. Thanks! >> >> Ryan Deaton wrote: >>> Probably syntax. run("Remove Slices...", "first=" + a + "last=" + b >>> + "increment=2"); >>> >>> Ryan Deaton >>> Pathology Information Systems Specialist >>> University of Illinois at Chicago >>> 312-355-4338 >>> -----Original Message----- >>> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf >>> Of Damon >>> Poburko >>> Sent: Monday, January 26, 2009 11:24 AM >>> To: [hidden email] >>> Subject: Re: variable in "Remove slices..." >>> >>> Hi all, >>> >>> I am using the "Remove slcies..." function in a macro, and I >>> would like to be able to set the first and last images using variables. >>> If I use the methods below... not problems: >>> run("Remove Slices...", "first=1 last=15 increment=2"); >>> >>> but I would like to be able to set first=X and last=Y dynamically to >>> make the macro more robust., unfornuately the following doesn't work. >>> a = X >>> b = Y >>> run("Remove Slices...", "first=a last=b increment=2"); // where a >>> and b are integer variables. >>> Is this not possible, or have I just messed up with my syntax? >>> >>> Cheers, >> Damon > > I'm sure that what "Ryan Deaton" has proposed didn't do the trick, > because the essential blanks are missing. > > Best blanks) did the trick. The thanks was meant to be to both of them. My apologies to Christopher. D |
Free forum by Nabble | Edit this page |