Login  Register

Re: Macro problem

Posted by Gabriel Landini on Jan 19, 2007; 4:49pm
URL: http://imagej.273.s1.nabble.com/Macro-problem-tp3700547p3700551.html

Hi,
I do not understand the problem well, but here are some comments.

On Friday 19 January 2007 16:19, Karsten Rodenacker wrote:
> I have images with title say "Xxx.zvi  Ch2" and would like to RGB
> Merge... them. Here appears the space(s) in the title to make
> problems. The parser stops after zvi.
>    stit="Xxx.zvi  Ch";
>    run("RGB Merge...","red="+stit+"1 green="+stit+"0 blue="+stit+"1");

I think that the merging plugin may have a problem parsing the spaces.
What about renaming the "Xxx Chx" to "R", "G" and "B" or similar and use those
names instead? Or replace the " " in the name with "_".

> I tried then to use the image id, but these (neg.) numbers are not
> accepted.
>    selectImage(stit+1); bb=getImageID();
>    selectImage(stit+0); gg=getImageID();
>    selectImage(stit+3); rr=getImageID();
>    run("RGB Merge...","red="+rr+" green="+gg+" blue="+bb);

I think this expects the title of the images, not the ID.

I hope it helps.

G.