Login  Register

Re: Using getTitle()

Posted by jmutterer on Mar 09, 2009; 2:07pm
URL: http://imagej.273.s1.nabble.com/Using-getTitle-tp3687039p3687040.html

On Mon, Mar 9, 2009 at 2:29 PM, mnqslbs2 <[hidden email]> wrote:

> Hello all,


Hello,


> The stacks are called "Series003 Red" and "Series003 Green" however the 003
> sometimes changes to 004, or 005 etc.  Everything else remains the same.
>

Get the part of the title string that starts at the beginning and extends to
the last 'space', and use it to build the images names:

name = getTitle();
prefix = substring (name, 0, lastIndexOf(name," "));
run("Merge Channels...", "red=["+prefix+" Red] green=["+prefix+" Green]
blue=*None* gray=*None*");
rename (prefix+"_merged.tif");
saveAs("Tiff");

Sincerely,

Jerome