Get windows titles

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

Get windows titles

lechristophe
Hi,

I'd like to know if there is a built-in macro function to get the name
or the ID of all open images (or stacks). I didn't find anything on the
built-in macro function webpage, appart from "nImages" to get the number
of open images.

Is there such a function or could someone suggest a simple way to do it ?

--
Christophe Leterrier

Postdoc
INSERM UMR641 Neurobiology of ionic channels
IFR Jean Roche - Mediterranee University
Marseille, France
Reply | Threaded
Open this post in threaded view
|

Re: Get windows titles

Martin du Saire
Christophe,

What if you made a list of image ID or titles as you opened them
using getImageID() or getTitle()?

M

At 07:49 AM 1/24/2007, you wrote:

>Hi,
>
>I'd like to know if there is a built-in macro function to get the
>name or the ID of all open images (or stacks). I didn't find
>anything on the built-in macro function webpage, appart from
>"nImages" to get the number of open images.
>
>Is there such a function or could someone suggest a simple way to do it ?
>
>--
>Christophe Leterrier
>
>Postdoc
>INSERM UMR641 Neurobiology of ionic channels
>IFR Jean Roche - Mediterranee University
>Marseille, France
Reply | Threaded
Open this post in threaded view
|

Re: Get windows titles

lechristophe
I have a Leica SP2 confocal which outputs TIFF images + .lei file + .txt
file
I use the Leica_TIFF_sequence importer to parse the .txt file and import
each serie (these are z stacks) as a separate stack (with the option of
separate stacks for each channel).
So the plugin ends with an arbitrary number of open stacks that I would
like to batch process.

I could avoid using this import plugin but I don't want to reprogram the
whole "get TIFFs to intelligent stacks" part. So I figured I could try
to get the stacks names into an array and process them one after another...

Christophe



Martin du Saire a écrit :

> Christophe,
>
> What if you made a list of image ID or titles as you opened them using
> getImageID() or getTitle()?
>
> M
>
> At 07:49 AM 1/24/2007, you wrote:
>> Hi,
>>
>> I'd like to know if there is a built-in macro function to get the
>> name or the ID of all open images (or stacks). I didn't find anything
>> on the built-in macro function webpage, appart from "nImages" to get
>> the number of open images.
>>
>> Is there such a function or could someone suggest a simple way to do
>> it ?
>>
>> --
>> Christophe Leterrier
>>
>> Postdoc
>> INSERM UMR641 Neurobiology of ionic channels
>> IFR Jean Roche - Mediterranee University
>> Marseille, France
>
Reply | Threaded
Open this post in threaded view
|

Re: Get windows titles

Ben.BigHair
In reply to this post by lechristophe
Christophe Leterrier wrote:
> Hi,
>
> I'd like to know if there is a built-in macro function to get the name
> or the ID of all open images (or stacks). I didn't find anything on the
> built-in macro function webpage, appart from "nImages" to get the number
> of open images.
>
> Is there such a function or could someone suggest a simple way to do it ?
>

Hello,

Perhaps something like the following would work for you?

Ben


//BEGIN
id = getImageList(false);
name = getImageList(true);

for (i=0;i<nImages();i++){
     write('ID = ' + id[i] + ',  NAME = ' + name[i]);
}

function getImageList( bReturnNames ){


     count = nImages();
     if (count == 0) then return -1;

     setBatchMode(true);
     currentID = getImageID();

     id = newArray(count);
     if (bReturnNames == true) {
         names = newArray(count);
     }

     for (i=0;i<count;i++){
         selectImage(i+1);
         id[i] = getImageID();
         if (bReturnNames == true) {
             names[i] = getTitle();
         }
     }

     selectImage(currentID);
     setBatchMode(false);
     if (bReturnNames == true) {
         return names;
     } else {
         return id;
     }
}
//END
Reply | Threaded
Open this post in threaded view
|

Re: Get windows titles

Wayne Rasband
In reply to this post by lechristophe
> I'd like to know if there is a built-in macro function to get the name
> or the ID of all open images (or stacks). I didn't find anything on
> the built-in macro function webpage, appart from "nImages" to get the
> number of open images.
>
> Is there such a function or could someone suggest a simple way to do
> it ?

Use selectImage() and getTitle() in a for loop to get the titles of all
open images.

    n = nImages;
    list = newArray(n);
    for (i=1; i<=n; i++) {
        selectImage(i);
        list[i-1] = getTitle;
    }

To avoid problems with duplicate titles, use getImageID() instead of
getTitle().

    n = nImages;
    list = newArray(n);
    for (i=1; i<=n; i++) {
        selectImage(i);
        list[i-1] = getImageID;
    }

Enable batch mode and the code will run a lot faster because ImageJ
does not have to bring each image to the front.

    n = nImages;
    list = newArray(n);
    setBatchMode(true);
    for (i=1; i<=n; i++) {
        selectImage(i);
        list[i-1] = getImageID;
    }
    setBatchMode(false);

-wayne
Reply | Threaded
Open this post in threaded view
|

blinking bar

Michael Cammer
In reply to this post by Ben.BigHair
The scroll bar at the bottom of a window containing a stack keeps blinking.

How can we get it to stop blinking?

Thank you.

____________________________________________________________________________
Michael Cammer   Analytical Imaging Facility   Albert Einstein Coll. of Med.
URL:  http://www.aecom.yu.edu/aif/ 
Reply | Threaded
Open this post in threaded view
|

Re: blinking bar

ctrueden
Hi Michael,

Presumably you are running on Windows. Once you grab the scroll bar
and drag it, it blinks. This behavior is a feature of Java (AWT)
scroll bars. If the image window isn't active, the blinking will stop.
But I know of no easy way to make it stop blinking while its window is
active.

If it *really* bothers you, and you are (or have access to) a
programmer, you could hack the ImageJ source to use
javax.swing.JScrollBar or javax.swing.JSlider instead of
java.awt.ScrollBar, or override ij.gui.ImageWindow with a custom
version...

-Curtis

On 1/24/07, Michael Cammer <[hidden email]> wrote:

> The scroll bar at the bottom of a window containing a stack keeps blinking.
>
> How can we get it to stop blinking?
>
> Thank you.
>
> ____________________________________________________________________________
> Michael Cammer   Analytical Imaging Facility   Albert Einstein Coll. of Med.
> URL:  http://www.aecom.yu.edu/aif/
>
Reply | Threaded
Open this post in threaded view
|

ROI question

Michal Lijowski-2
How  X and Y coordinates in the ROI name are related to coordinates
in results table?

Here is an example.
This is a list of ROIs.
  Length     Date   Time    Name
--------    ----   ----    ----
      500  10-28-05 14:56   0001-0536-0428.roi
      384  10-28-05 14:56   0002-0530-0431.roi
      368  10-28-05 14:56   0003-0537-0433.roi
      388  10-28-05 14:56   0004-0535-0437.roi
      416  10-28-05 14:56   0005-0533-0430.roi
      424  10-28-05 14:56   0006-0533-0431.roi
      372  10-28-05 14:56   0007-0533-0428.roi
      584  10-28-05 14:56   0008-0535-0438.roi

This is data from results table derived using above ROIs.
        Area    Mean     X       Y       BX      BY      Width
Height  
1       124.672 160.187  198.718 248.278 193.668 241.039 10.217
15.791      
2       69.454  161.425  200.470 246.157 195.061 241.504 10.217
9.289      
3       63.846  167.740  201.033 249.810 197.383 244.290 7.431
10.682      
4       64.493  163.669  203.218 248.640 200.170 241.968 6.038
13.004      
5       76.572  144.614  199.858 248.307 195.990 241.039 7.895
13.468      
6       74.846  148.274  200.196 247.146 195.525 241.039 9.753
13.004      
7       56.081  149.385  198.401 248.713 195.525 241.968 6.502
11.611        
8       125.751 146.027  203.738 247.897 195.990 241.039 15.326  14.862


The ROIs were drawn and results were obtained using ImageJ version
available in October 2005. From the current ImageJ online source code I
figured out that X and Y coordinates are derived from the coordinates of
the bounds of the rectangle surrounding ROI and its width and height.

The ROIs were drawn on 16 bit 128x128  grayscale DICOM images, scaled by
a factor of 3 and with magnifying glass tool focused on the specific
part of the image.  

My intention is to draw the ROIs again on the same images.

I appreciate any hints.

Michal
Reply | Threaded
Open this post in threaded view
|

Re: ROI question

Josh Doe-2
How do you wish to redraw the ROIs? Why not just load the ROI? Or
define the ROI by points you have saved?

I think you need to clarify your question a bit more. Are you using a
plugin or a macro? What data do you have to redraw/restore the ROIs?
-Josh D

On 1/24/07, Michal Lijowski <[hidden email]> wrote:

> How  X and Y coordinates in the ROI name are related to coordinates
> in results table?
>
> Here is an example.
> This is a list of ROIs.
>   Length     Date   Time    Name
> --------    ----   ----    ----
>       500  10-28-05 14:56   0001-0536-0428.roi
>       384  10-28-05 14:56   0002-0530-0431.roi
>       368  10-28-05 14:56   0003-0537-0433.roi
>       388  10-28-05 14:56   0004-0535-0437.roi
>       416  10-28-05 14:56   0005-0533-0430.roi
>       424  10-28-05 14:56   0006-0533-0431.roi
>       372  10-28-05 14:56   0007-0533-0428.roi
>       584  10-28-05 14:56   0008-0535-0438.roi
>
> This is data from results table derived using above ROIs.
>         Area    Mean     X       Y       BX      BY      Width
> Height
> 1       124.672 160.187  198.718 248.278 193.668 241.039 10.217
> 15.791
> 2       69.454  161.425  200.470 246.157 195.061 241.504 10.217
> 9.289
> 3       63.846  167.740  201.033 249.810 197.383 244.290 7.431
> 10.682
> 4       64.493  163.669  203.218 248.640 200.170 241.968 6.038
> 13.004
> 5       76.572  144.614  199.858 248.307 195.990 241.039 7.895
> 13.468
> 6       74.846  148.274  200.196 247.146 195.525 241.039 9.753
> 13.004
> 7       56.081  149.385  198.401 248.713 195.525 241.968 6.502
> 11.611
> 8       125.751 146.027  203.738 247.897 195.990 241.039 15.326  14.862
>
>
> The ROIs were drawn and results were obtained using ImageJ version
> available in October 2005. From the current ImageJ online source code I
> figured out that X and Y coordinates are derived from the coordinates of
> the bounds of the rectangle surrounding ROI and its width and height.
>
> The ROIs were drawn on 16 bit 128x128  grayscale DICOM images, scaled by
> a factor of 3 and with magnifying glass tool focused on the specific
> part of the image.
>
> My intention is to draw the ROIs again on the same images.
>
> I appreciate any hints.
>
> Michal
>
Reply | Threaded
Open this post in threaded view
|

Re: blinking bar

Wayne Rasband
In reply to this post by Michael Cammer
On Jan 24, 2007, at 12:03 PM, Michael Cammer wrote:

> The scroll bar at the bottom of a window containing a stack keeps
> blinking.
>
> How can we get it to stop blinking?

This bug is fixed in ImageJ 1.38h. It was only a problem on Windows. On
earlier versions, you can stop the blinking my clicking on the image.
With ImageJ 1.38a or later, you can avoid the blinking by using the
mouse wheel to scroll through the stack.

-wayne
Reply | Threaded
Open this post in threaded view
|

Re: ROI question

Michal Lijowski-2
In reply to this post by Josh Doe-2
I acquired results by drawing ROIs, adding them to ROI Manager,
measuring ROI,  and after I acquired all ROIs for all images in the
stack I saved them without paying attention to the coordinates
in the ROI name and their relation to the ROI coordinates.

I can open the ROI set with ROI Manager but somehow the relation between
coordinates of saved ROI and the coordinates of the actual image got
messed up. The images are 416.13 mm by 416.13 mm. But the coordinates in
the  name of the first ROI are 0536-0428 and the ROI coordinates from
the results table are x 198.718 and y 248.278 with corresponding width
and height 10.217 and 15.79.

So, using the current version of ImageJ  ROIs acquired 14 months ago are
outside the images.

Michal



On Thu, 2007-01-25 at 09:45 -0500, Josh D wrote:

> How do you wish to redraw the ROIs? Why not just load the ROI? Or
> define the ROI by points you have saved?
>
> I think you need to clarify your question a bit more. Are you using a
> plugin or a macro? What data do you have to redraw/restore the ROIs?
> -Josh D
>
> On 1/24/07, Michal Lijowski <[hidden email]> wrote:
> > How  X and Y coordinates in the ROI name are related to coordinates
> > in results table?
> >
> > Here is an example.
> > This is a list of ROIs.
> >   Length     Date   Time    Name
> > --------    ----   ----    ----
> >       500  10-28-05 14:56   0001-0536-0428.roi
> >       384  10-28-05 14:56   0002-0530-0431.roi
> >       368  10-28-05 14:56   0003-0537-0433.roi
> >       388  10-28-05 14:56   0004-0535-0437.roi
> >       416  10-28-05 14:56   0005-0533-0430.roi
> >       424  10-28-05 14:56   0006-0533-0431.roi
> >       372  10-28-05 14:56   0007-0533-0428.roi
> >       584  10-28-05 14:56   0008-0535-0438.roi
> >
> > This is data from results table derived using above ROIs.
> >         Area    Mean     X       Y       BX      BY      Width
> > Height
> > 1       124.672 160.187  198.718 248.278 193.668 241.039 10.217
> > 15.791
> > 2       69.454  161.425  200.470 246.157 195.061 241.504 10.217
> > 9.289
> > 3       63.846  167.740  201.033 249.810 197.383 244.290 7.431
> > 10.682
> > 4       64.493  163.669  203.218 248.640 200.170 241.968 6.038
> > 13.004
> > 5       76.572  144.614  199.858 248.307 195.990 241.039 7.895
> > 13.468
> > 6       74.846  148.274  200.196 247.146 195.525 241.039 9.753
> > 13.004
> > 7       56.081  149.385  198.401 248.713 195.525 241.968 6.502
> > 11.611
> > 8       125.751 146.027  203.738 247.897 195.990 241.039 15.326  14.862
> >
> >
> > The ROIs were drawn and results were obtained using ImageJ version
> > available in October 2005. From the current ImageJ online source code I
> > figured out that X and Y coordinates are derived from the coordinates of
> > the bounds of the rectangle surrounding ROI and its width and height.
> >
> > The ROIs were drawn on 16 bit 128x128  grayscale DICOM images, scaled by
> > a factor of 3 and with magnifying glass tool focused on the specific
> > part of the image.
> >
> > My intention is to draw the ROIs again on the same images.
> >
> > I appreciate any hints.
> >
> > Michal
> >
Reply | Threaded
Open this post in threaded view
|

Re: ROI question

Davide Coppola
When you create a Roi using
PolygonRoi(int[] xPoints, int[] yPoints, int nPoints, int type)
data stored in the two arrays are modified.
I think the same happens every time a new Roi is created, so you have
to backup the coordinates before you work on them.

This should fix your problem.

Regards.

2007/1/25, Michal Lijowski <[hidden email]>:

> I acquired results by drawing ROIs, adding them to ROI Manager,
> measuring ROI,  and after I acquired all ROIs for all images in the
> stack I saved them without paying attention to the coordinates
> in the ROI name and their relation to the ROI coordinates.
>
> I can open the ROI set with ROI Manager but somehow the relation between
> coordinates of saved ROI and the coordinates of the actual image got
> messed up. The images are 416.13 mm by 416.13 mm. But the coordinates in
> the  name of the first ROI are 0536-0428 and the ROI coordinates from
> the results table are x 198.718 and y 248.278 with corresponding width
> and height 10.217 and 15.79.
>
> So, using the current version of ImageJ  ROIs acquired 14 months ago are
> outside the images.
>
> Michal
>
>
>
> On Thu, 2007-01-25 at 09:45 -0500, Josh D wrote:
> > How do you wish to redraw the ROIs? Why not just load the ROI? Or
> > define the ROI by points you have saved?
> >
> > I think you need to clarify your question a bit more. Are you using a
> > plugin or a macro? What data do you have to redraw/restore the ROIs?
> > -Josh D
> >
> > On 1/24/07, Michal Lijowski <[hidden email]> wrote:
> > > How  X and Y coordinates in the ROI name are related to coordinates
> > > in results table?
> > >
> > > Here is an example.
> > > This is a list of ROIs.
> > >   Length     Date   Time    Name
> > > --------    ----   ----    ----
> > >       500  10-28-05 14:56   0001-0536-0428.roi
> > >       384  10-28-05 14:56   0002-0530-0431.roi
> > >       368  10-28-05 14:56   0003-0537-0433.roi
> > >       388  10-28-05 14:56   0004-0535-0437.roi
> > >       416  10-28-05 14:56   0005-0533-0430.roi
> > >       424  10-28-05 14:56   0006-0533-0431.roi
> > >       372  10-28-05 14:56   0007-0533-0428.roi
> > >       584  10-28-05 14:56   0008-0535-0438.roi
> > >
> > > This is data from results table derived using above ROIs.
> > >         Area    Mean     X       Y       BX      BY      Width
> > > Height
> > > 1       124.672 160.187  198.718 248.278 193.668 241.039 10.217
> > > 15.791
> > > 2       69.454  161.425  200.470 246.157 195.061 241.504 10.217
> > > 9.289
> > > 3       63.846  167.740  201.033 249.810 197.383 244.290 7.431
> > > 10.682
> > > 4       64.493  163.669  203.218 248.640 200.170 241.968 6.038
> > > 13.004
> > > 5       76.572  144.614  199.858 248.307 195.990 241.039 7.895
> > > 13.468
> > > 6       74.846  148.274  200.196 247.146 195.525 241.039 9.753
> > > 13.004
> > > 7       56.081  149.385  198.401 248.713 195.525 241.968 6.502
> > > 11.611
> > > 8       125.751 146.027  203.738 247.897 195.990 241.039 15.326  14.862
> > >
> > >
> > > The ROIs were drawn and results were obtained using ImageJ version
> > > available in October 2005. From the current ImageJ online source code I
> > > figured out that X and Y coordinates are derived from the coordinates of
> > > the bounds of the rectangle surrounding ROI and its width and height.
> > >
> > > The ROIs were drawn on 16 bit 128x128  grayscale DICOM images, scaled by
> > > a factor of 3 and with magnifying glass tool focused on the specific
> > > part of the image.
> > >
> > > My intention is to draw the ROIs again on the same images.
> > >
> > > I appreciate any hints.
> > >
> > > Michal
> > >
>


--
Davide "M3xican" Coppola

http://yawi3d.sf.net/