Login  Register

Re: Get name of stack or how to choose an inactive window

Posted by Michael Schmid on Mar 19, 2010; 12:49pm
URL: http://imagej.273.s1.nabble.com/Get-name-of-stack-or-how-to-choose-an-inactive-window-tp3688896p3688897.html

Hi Kristian,

part of your question seems to be the most frequent one in this  
mailing list.
For String concatenation the operator is '+' in java and in the macro  
language as well.

  namePrefix="my first images";
  selectWindow(namePrefix + "-0001");

this will select the window named "my first images-0001" (in the  
title bar)

Howver, if you want to select a slice of a stack (i.e. multiple  
images in a single window, with a slider at the bottom), select the  
window by its name, then use the setSlice(n) macro command.

Michael
________________________________________________________________

On 19 Mar 2010, at 12:40, KJ wrote:

> Hi everybody
>
> Im working with a macro which basically takes a stack and  
> converting it into
> images - no problems until now.
>
> However my problem is when I'm trying to get the first image in the  
> stack
> (ie. not the active image).
>
> The stack is divided into images with "name of stack"-0001 and so on.
>
> I've figured that I most likely could use the command:
>
> selectWindow('-0001');
>
> But how do I get the "name of the stack" or how do I choose the  
> first window
> (the "name of the stack"-0001)
>
> Sincerely
> Kristian