Re: Get name of stack or how to choose an inactive window
Posted by
KJ-2-3 on
Mar 19, 2010; 1:24pm
URL: http://imagej.273.s1.nabble.com/Get-name-of-stack-or-how-to-choose-an-inactive-window-tp3688896p3688898.html
Hi Michael
Thanks a lot for giving me a push in the right direction.
A slight change to your suggestion gave me the wanted:
namePrefix=File.nameWithoutExtension
selectWindow(namePrefix + '-0001');
Hence now it can be any name, instead of a "known" name, but again thanks
for the guiding.
Sincerely
Kristian
On Fri, Mar 19, 2010 at 1:49 PM, Michael Schmid <
[hidden email]>wrote:
> 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
>>
>
--
----------------------------
Kristian Jensen
BSc.
Molekylærbiologi og Kemi
v. Roskilde Universitetscenter
Branddamsvej 201 1tv
2860 Søborg
51899229
[hidden email]