unable to select windows if they have the same name

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

unable to select windows if they have the same name

John Alexander-7
I have a series of images with the same names.

This isn't a problem in a macro since I use the imageID as my identifier
to select images ... but when doing things manually ... I just noticed
that the list of images one sees when looking in the ImageJ->Window list
must use the image name rather than the ID since I am unable to select
any image other than the first.

I doesn't matter which image I click on in that list - only the first
one is ever selected.

This is now proving problematic if I have 30 images opened with the same
name - and I want to manually go through them - I have no way of quickly
select the 5th image manually.  I have to shuffle all the windows to one
side to find the one I want.

Not really a bug report, but, the list is rather useless as a means to
select images in my particular case.  Plus (and I have not confirmed
this) it makes me wonder if the selectImage() would not work properly if
I used an id that is positive.

John




--
John K. Alexander, Ph.D.
Post-Doctoral Fellow
William Green Laboratory
University of Chicago
Dept. Neurobiology, Pharmacology, and Physiology
947 East 58th Street
Abott Hall 402
Chicago, IL 60637
(off) 773-702-9386
(fax) 773-702-3774
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: unable to select windows if they have the same name

Gabriel Landini
On Friday 01 August 2008 16:40:29 John Alexander wrote:

> I just noticed that the list of images one sees when looking in the
> ImageJ->Window list
> must use the image name rather than the ID since I am unable to select
> any image other than the first.

Even if it used the ID, it would quite ugly to go through a list of same-named
images. Is that image 123 or 124? There is too much room for doing mistakes.
 
> This is now proving problematic if I have 30 images opened with the same
> name - and I want to manually go through them - I have no way of quickly
> select the 5th image manually.  I have to shuffle all the windows to one
> side to find the one I want.

This sounds like the Monty Python sketch where everybody is called Bruce.
What about something like renaming your images with the ID as you open them?

> Not really a bug report, but, the list is rather useless as a means to
> select images in my particular case.

Give every image a number or suffix and that would sort it.

> Plus (and I have not confirmed  
> this) it makes me wonder if the selectImage() would not work properly if
> I used an id that is positive.

According to the documentation, the ID is a unique negative number.

Cheers,
G.
Reply | Threaded
Open this post in threaded view
|

Re: unable to select windows if they have the same name

John Alexander-7
It hasn't really been a problem since I use the unique ID number as an
identifier in all my macros and rarely use the image name.  I use the
LOCI bioformats plug-in to open my images (they are in the proprietary
slidebook format) so I would still have to open all the images, then
rename them.  But there is no point since I use the unique ID anyways.

If you pass a positive id to selectImage() - it selects the idth image
on the window list.

Turns out the selectImage() works fine with all images being the same
name, as in the following snippet works fine ...

for (i=0;i<nImages;i++) {
selectImage(i+1);
ids[i]=getImageID();
}

what doesn't work is when you manually try to click on the 6th image,
only the first (of that filename) is selected.

This is a problem when I am manually processing a set of images.



Gabriel Landini wrote:

> On Friday 01 August 2008 16:40:29 John Alexander wrote:
>
>> I just noticed that the list of images one sees when looking in the
>> ImageJ->Window list
>> must use the image name rather than the ID since I am unable to select
>> any image other than the first.
>
> Even if it used the ID, it would quite ugly to go through a list of same-named
> images. Is that image 123 or 124? There is too much room for doing mistakes.
>  
>> This is now proving problematic if I have 30 images opened with the same
>> name - and I want to manually go through them - I have no way of quickly
>> select the 5th image manually.  I have to shuffle all the windows to one
>> side to find the one I want.
>
> This sounds like the Monty Python sketch where everybody is called Bruce.
> What about something like renaming your images with the ID as you open them?
>
>> Not really a bug report, but, the list is rather useless as a means to
>> select images in my particular case.
>
> Give every image a number or suffix and that would sort it.
>
>> Plus (and I have not confirmed  
>> this) it makes me wonder if the selectImage() would not work properly if
>> I used an id that is positive.
>
> According to the documentation, the ID is a unique negative number.
>
> Cheers,
> G.
>

--
John K. Alexander, Ph.D.
Post-Doctoral Fellow
William Green Laboratory
University of Chicago
Dept. Neurobiology, Pharmacology, and Physiology
947 East 58th Street
Abott Hall 402
Chicago, IL 60637
(off) 773-702-9386
(fax) 773-702-3774
[hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: unable to select windows if they have the same name

Harry Parker
In reply to this post by John Alexander-7
John,
Here's a simple fix: You could write a simple (5 line?) macro to append the ID to the displayed name of each open image, using the rename command.
How do you keep them straight manually, if they all have the same name, anyway?

--
Harry Parker
Senior Imaging Systems Engineer
Digital Imaging Systems, Inc.



----- Original Message ----
From: John Alexander <[hidden email]>
To: [hidden email]
Sent: Friday, August 1, 2008 12:40:58 PM
Subject: Re: unable to select windows if they have the same name

It hasn't really been a problem since I use the unique ID number as an
identifier in all my macros and rarely use the image name.  I use the
LOCI bioformats plug-in to open my images (they are in the proprietary
slidebook format) so I would still have to open all the images, then
rename them.  But there is no point since I use the unique ID anyways.

If you pass a positive id to selectImage() - it selects the idth image
on the window list.

Turns out the selectImage() works fine with all images being the same
name, as in the following snippet works fine ...

for (i=0;i<nImages;i++) {
selectImage(i+1);
ids[i]=getImageID();
}

what doesn't work is when you manually try to click on the 6th image,
only the first (of that filename) is selected.

This is a problem when I am manually processing a set of images.



Gabriel Landini wrote:

> On Friday 01 August 2008 16:40:29 John Alexander wrote:
>
>> I just noticed that the list of images one sees when looking in the
>> ImageJ->Window list
>> must use the image name rather than the ID since I am unable to select
>> any image other than the first.
>
> Even if it used the ID, it would quite ugly to go through a list of same-named
> images. Is that image 123 or 124? There is too much room for doing mistakes.
>  
>> This is now proving problematic if I have 30 images opened with the same
>> name - and I want to manually go through them - I have no way of quickly
>> select the 5th image manually.  I have to shuffle all the windows to one
>> side to find the one I want.
>
> This sounds like the Monty Python sketch where everybody is called Bruce.
> What about something like renaming your images with the ID as you open them?
>
>> Not really a bug report, but, the list is rather useless as a means to
>> select images in my particular case.
>
> Give every image a number or suffix and that would sort it.
>
>> Plus (and I have not confirmed  
>> this) it makes me wonder if the selectImage() would not work properly if
>> I used an id that is positive.
>
> According to the documentation, the ID is a unique negative number.
>
> Cheers,
> G.
>

--
John K. Alexander, Ph.D.
Post-Doctoral Fellow
William Green Laboratory
University of Chicago
Dept. Neurobiology, Pharmacology, and Physiology
947 East 58th Street
Abott Hall 402
Chicago, IL 60637
(off) 773-702-9386
(fax) 773-702-3774
[hidden email]



     
Reply | Threaded
Open this post in threaded view
|

Re: unable to select windows if they have the same name

ctrueden
In reply to this post by John Alexander-7
Hi John,

Though I do recommend programming with image IDs rather than names in
your macros, I still think that Bio-Formats should generate unique but
predictable window names whenever possible. If you could describe a
circumstance where you are seeing all identical window names, we can
work on improving the behavior.

-Curtis

On Fri, Aug 1, 2008 at 11:40 AM, John Alexander <[hidden email]> wrote:

> It hasn't really been a problem since I use the unique ID number as an
> identifier in all my macros and rarely use the image name.  I use the
> LOCI bioformats plug-in to open my images (they are in the proprietary
> slidebook format) so I would still have to open all the images, then
> rename them.  But there is no point since I use the unique ID anyways.
>
> If you pass a positive id to selectImage() - it selects the idth image
> on the window list.
>
> Turns out the selectImage() works fine with all images being the same
> name, as in the following snippet works fine ...
>
> for (i=0;i<nImages;i++) {
> selectImage(i+1);
> ids[i]=getImageID();
> }
>
> what doesn't work is when you manually try to click on the 6th image,
> only the first (of that filename) is selected.
>
> This is a problem when I am manually processing a set of images.
>
>
>
> Gabriel Landini wrote:
>> On Friday 01 August 2008 16:40:29 John Alexander wrote:
>>
>>> I just noticed that the list of images one sees when looking in the
>>> ImageJ->Window list
>>> must use the image name rather than the ID since I am unable to select
>>> any image other than the first.
>>
>> Even if it used the ID, it would quite ugly to go through a list of same-named
>> images. Is that image 123 or 124? There is too much room for doing mistakes.
>>
>>> This is now proving problematic if I have 30 images opened with the same
>>> name - and I want to manually go through them - I have no way of quickly
>>> select the 5th image manually.  I have to shuffle all the windows to one
>>> side to find the one I want.
>>
>> This sounds like the Monty Python sketch where everybody is called Bruce.
>> What about something like renaming your images with the ID as you open them?
>>
>>> Not really a bug report, but, the list is rather useless as a means to
>>> select images in my particular case.
>>
>> Give every image a number or suffix and that would sort it.
>>
>>> Plus (and I have not confirmed
>>> this) it makes me wonder if the selectImage() would not work properly if
>>> I used an id that is positive.
>>
>> According to the documentation, the ID is a unique negative number.
>>
>> Cheers,
>> G.
>>
>
> --
> John K. Alexander, Ph.D.
> Post-Doctoral Fellow
> William Green Laboratory
> University of Chicago
> Dept. Neurobiology, Pharmacology, and Physiology
> 947 East 58th Street
> Abott Hall 402
> Chicago, IL 60637
> (off) 773-702-9386
> (fax) 773-702-3774
> [hidden email]
>
Reply | Threaded
Open this post in threaded view
|

Re: unable to select windows if they have the same name

Gabriel Landini
On Monday 11 August 2008, Curtis Rueden wrote:
> Though I do recommend programming with image IDs rather than names in
> your macros, I still think that Bio-Formats should generate unique but
> predictable window names whenever possible. If you could describe a
> circumstance where you are seeing all identical window names, we can
> work on improving the behavior.

Now that you brought the issue of names and IDs...
Although IDs seem to handle images faster than names, some plugins expect
image names. Is there a shortcut to use IDs instead?

For instance, the image calculator expects names. Can the IDs be used in these
cases without having to invoke getTitle(selectImage(ID)) or something like
that? (not sure the syntax is correct, btw).

Cheers

G.
Reply | Threaded
Open this post in threaded view
|

Re: unable to select windows if they have the same name

Michael Schmid
Hi Gabriel,

plugins that need image names in dialog don't accept IDs
in place of titles. The only exception that I am aware of is the
built-in Image Calculator, which has its own macro call
   imageCalculator(operator, img1, img2)
where img1 and img2 can be image titles or IDs.

So you need someting like
   selectImage(ID1);
   title1 = getTitle();
   selectImage(ID2);
   title2 = getTitle();
   run("myPlugIn", "image1="+title1 + " image2="+title2");

It won't work if there are multiple images with the same title.
In that case, you have to rename them - one could write a short
macro for that.

Best wishes,

Michael
________________________________________________________________

On 12 Aug 2008, at 01:08, Gabriel Landini wrote:

> On Monday 11 August 2008, Curtis Rueden wrote:
>> Though I do recommend programming with image IDs rather than names in
>> your macros, I still think that Bio-Formats should generate unique  
>> but
>> predictable window names whenever possible. If you could describe a
>> circumstance where you are seeing all identical window names, we can
>> work on improving the behavior.
>
> Now that you brought the issue of names and IDs...
> Although IDs seem to handle images faster than names, some plugins  
> expect
> image names. Is there a shortcut to use IDs instead?
>
> For instance, the image calculator expects names. Can the IDs be  
> used in these
> cases without having to invoke getTitle(selectImage(ID)) or  
> something like
> that? (not sure the syntax is correct, btw).
>
> Cheers
>
> G.