Macro problem

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

Macro problem

Karsten Rodenacker
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 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);
Any ideas? "" are seemingly not implemented.

Hints are appreciated

Karsten Rodenacker
-------------------------------------------------------------------- :-)
GSF - Forschungszentrum     Institute of Biomathematics and Biometry
D-85758 Oberschleissheim    Postfach 11 29
Karsten.Rodenacker_AT_gsf.de | http://ibb.gsf.de/
http://ibb.gsf.de/homepage/karsten.rodenacker/
Tel: +49 89 31873401 | FAX: ..193401
Reply | Threaded
Open this post in threaded view
|

Re: Macro problem

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

Re: Macro problem

jchanson
In reply to this post by Karsten Rodenacker
This is just a guess, but for the "selectImage" commands, you might need
to put the numbers inside quotes.
   selectImage(stit+"1"); bb=getImageID();
   selectImage(stit+"0"); gg=getImageID();
   selectImage(stit+"3"); rr=getImageID();
   run("RGB Merge...","red="+rr+" green="+gg+" blue="+bb);

Jeff
Senior Imaging Analyst
Eli Lilly and Company
[hidden email]




Karsten Rodenacker <[hidden email]>
Sent by: ImageJ Interest Group <[hidden email]>
01/19/2007 11:19 AM
Please respond to
ImageJ Interest Group <[hidden email]>


To
[hidden email]
cc

Subject
Macro problem






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 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);
Any ideas? "" are seemingly not implemented.

Hints are appreciated

Karsten Rodenacker
-------------------------------------------------------------------- :-)
GSF - Forschungszentrum     Institute of Biomathematics and Biometry
D-85758 Oberschleissheim    Postfach 11 29
Karsten.Rodenacker_AT_gsf.de | http://ibb.gsf.de/
http://ibb.gsf.de/homepage/karsten.rodenacker/
Tel: +49 89 31873401 | FAX: ..193401
Reply | Threaded
Open this post in threaded view
|

Re: Macro problem

ctrueden
In reply to this post by Karsten Rodenacker
Hi Karsten,

If there are spaces in your title, try putting it in brackets. For
example, the Macro Recorder (Plugins>Macros>Record...) gave me this
command when I recorded a merge of three-channel ZVI data with spaces
in the title:

  run("RGB Merge...", "red=[image.zvi - Ch1] green=[image.zvi - Ch2]
blue=[image.zvi - Ch3]");

So maybe you could do something like:

  stit="Xxx.zvi  Ch";
  run("RGB Merge...","red=["+stit+"1] green=["+stit+"0] blue=["+stit+"1]");

-Curtis

On 1/19/07, Karsten Rodenacker <[hidden email]> 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 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);
> Any ideas? "" are seemingly not implemented.
>
> Hints are appreciated
>
> Karsten Rodenacker
> -------------------------------------------------------------------- :-)
> GSF - Forschungszentrum     Institute of Biomathematics and Biometry
> D-85758 Oberschleissheim    Postfach 11 29
> Karsten.Rodenacker_AT_gsf.de | http://ibb.gsf.de/
> http://ibb.gsf.de/homepage/karsten.rodenacker/
> Tel: +49 89 31873401 | FAX: ..193401
>
Reply | Threaded
Open this post in threaded view
|

Re: Macro problem

Karsten Rodenacker-2
Thanks Curtis, that was it.
Karsten

Am 19.01.2007 um 19:18 schrieb Curtis Rueden:

>  run("RGB Merge...","red=["+stit+"1] green=["+stit+"0] blue=["+stit
> +"1]");