Re: unable to select windows if they have the same name
Posted by
Michael Schmid on
Aug 12, 2008; 11:36am
URL: http://imagej.273.s1.nabble.com/unable-to-select-windows-if-they-have-the-same-name-tp3695409p3695414.html
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.