question about adding component to a ImageWindow

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

question about adding component to a ImageWindow

xin zhang
Hi,

I am trying to add a TextPanel to an ImageWindow, however, no matter
how do I set the size of the TextPanel, I always get tiny TextPanel as
shown at http://terpconnect.umd.edu/~zhangx/imagej/nanoscopeiiireader/Picture-2.png

Has anybody any idea how to make the TextPanel take the whole width of
the window?

Thanks in advance.

Xin

--
***********************************************
Xin Zhang
Graduate Student
Department of Materials Science and Engineering
University of Maryland at College Park
Tel: (301)405-0900
Email: [hidden email], [hidden email]
Web:http://www.glue.umd.edu/~zhangx/
***********************************************
Reply | Threaded
Open this post in threaded view
|

Re: question about adding component to a ImageWindow

Patrick Pirrotte
Hi Xin,

If you want to extend ImageWindow or ImageCanvas you need to stay in AWT.
Try replacing JTextPane by java.awt.TextArea.

You can't mix heavyweight components (such as AWT) with lightweight
components (such as Swing). As ImageJ is written in AWT, inside Frames such
as ImageWindow/ImageCanvas only AWT components get correctly drawn. You can
put Swing components into a separate JFrame though, and several plugins do
so to profit from the larger component library offered by javax.swing.*.

Regards,

Patrick

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of xin
zhang
Sent: 07 October 2008 00:03
To: [hidden email]
Subject: question about adding component to a ImageWindow

Hi,

I am trying to add a TextPanel to an ImageWindow, however, no matter how do
I set the size of the TextPanel, I always get tiny TextPanel as shown at
http://terpconnect.umd.edu/~zhangx/imagej/nanoscopeiiireader/Picture-2.png

Has anybody any idea how to make the TextPanel take the whole width of the
window?

Thanks in advance.

Xin

--
***********************************************
Xin Zhang
Graduate Student
Department of Materials Science and Engineering University of Maryland at
College Park
Tel: (301)405-0900
Email: [hidden email], [hidden email]
Web:http://www.glue.umd.edu/~zhangx/
***********************************************
Reply | Threaded
Open this post in threaded view
|

Re: question about adding component to a ImageWindow

xin zhang
Hi, Patrick,

Thanks for the information, what I tried to put in the ImageWindow was
actually an object of ij.text.TextPanel.

So, any idea?

Xin

On Tue, Oct 7, 2008 at 3:27 AM, Patrick Pirrotte
<[hidden email]> wrote:

> Hi Xin,
>
> If you want to extend ImageWindow or ImageCanvas you need to stay in AWT.
> Try replacing JTextPane by java.awt.TextArea.
>
> You can't mix heavyweight components (such as AWT) with lightweight
> components (such as Swing). As ImageJ is written in AWT, inside Frames such
> as ImageWindow/ImageCanvas only AWT components get correctly drawn. You can
> put Swing components into a separate JFrame though, and several plugins do
> so to profit from the larger component library offered by javax.swing.*.
>
> Regards,
>
> Patrick
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of xin
> zhang
> Sent: 07 October 2008 00:03
> To: [hidden email]
> Subject: question about adding component to a ImageWindow
>
> Hi,
>
> I am trying to add a TextPanel to an ImageWindow, however, no matter how do
> I set the size of the TextPanel, I always get tiny TextPanel as shown at
> http://terpconnect.umd.edu/~zhangx/imagej/nanoscopeiiireader/Picture-2.png
>
> Has anybody any idea how to make the TextPanel take the whole width of the
> window?
>
> Thanks in advance.
>
> Xin
>
> --
> ***********************************************
> Xin Zhang
> Graduate Student
> Department of Materials Science and Engineering University of Maryland at
> College Park
> Tel: (301)405-0900
> Email: [hidden email], [hidden email]
> Web:http://www.glue.umd.edu/~zhangx/
> ***********************************************
>



--
***********************************************
Xin Zhang
Graduate Student
Department of Materials Science and Engineering
University of Maryland at College Park
Tel: (301)405-0900
Email: [hidden email], [hidden email]
Web:http://www.glue.umd.edu/~zhangx/
***********************************************
Reply | Threaded
Open this post in threaded view
|

Re: question about adding component to a ImageWindow

Patrick Pirrotte
Hi Xin,

Did you extend ImageCanvas as described in Panel_Window example?
(http://rsb.info.nih.gov/ij/plugins/download/Panel_Window.java)

As TextPanel is a subclass of java.awt.Panel, adding a panel should be no
problem...

....

 void addPanel() {
            add(new TextPanel("Title"));
            pack();
      Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
            Point loc = getLocation();
            Dimension size = getSize();
            if (loc.y+size.height>screen.height)
                getCanvas().zoomOut(0, 0);
         }
....

Regards,

Patrick

-----Original Message-----
From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of xin
zhang
Sent: 07 October 2008 16:41
To: [hidden email]
Subject: Re: question about adding component to a ImageWindow

Hi, Patrick,

Thanks for the information, what I tried to put in the ImageWindow was
actually an object of ij.text.TextPanel.

So, any idea?

Xin

On Tue, Oct 7, 2008 at 3:27 AM, Patrick Pirrotte
<[hidden email]> wrote:

> Hi Xin,
>
> If you want to extend ImageWindow or ImageCanvas you need to stay in AWT.
> Try replacing JTextPane by java.awt.TextArea.
>
> You can't mix heavyweight components (such as AWT) with lightweight
> components (such as Swing). As ImageJ is written in AWT, inside Frames
> such as ImageWindow/ImageCanvas only AWT components get correctly
> drawn. You can put Swing components into a separate JFrame though, and
> several plugins do so to profit from the larger component library offered
by javax.swing.*.

>
> Regards,
>
> Patrick
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> xin zhang
> Sent: 07 October 2008 00:03
> To: [hidden email]
> Subject: question about adding component to a ImageWindow
>
> Hi,
>
> I am trying to add a TextPanel to an ImageWindow, however, no matter
> how do I set the size of the TextPanel, I always get tiny TextPanel as
> shown at
> http://terpconnect.umd.edu/~zhangx/imagej/nanoscopeiiireader/Picture-2
> .png
>
> Has anybody any idea how to make the TextPanel take the whole width of
> the window?
>
> Thanks in advance.
>
> Xin
>
> --
> ***********************************************
> Xin Zhang
> Graduate Student
> Department of Materials Science and Engineering University of Maryland
> at College Park
> Tel: (301)405-0900
> Email: [hidden email], [hidden email]
> Web:http://www.glue.umd.edu/~zhangx/
> ***********************************************
>



--
***********************************************
Xin Zhang
Graduate Student
Department of Materials Science and Engineering University of Maryland at
College Park
Tel: (301)405-0900
Email: [hidden email], [hidden email]
Web:http://www.glue.umd.edu/~zhangx/
***********************************************
Reply | Threaded
Open this post in threaded view
|

Re: question about adding component to a ImageWindow

ctrueden
Hi Xin & Patrick,

Actually, you can use Swing inside of a heavyweight AWT window in most
circumstances -- there are just a couple of gotchas. For an example of
extending StackWindow (which extends ImageWindow) with additional
components, as well as mixing in Swing, check out LOCI's Data Browser
plugin:

https://skyking.microscopy.wisc.edu/trac/java/browser/trunk/components/loci-plugins/src/loci/plugins/DataBrowser.java

For more about mixing AWT and Swing, see this ancient (but still relevant)
article from Sun:

http://java.sun.com/products/jfc/tsc/articles/mixing/

Cheers,
Curtis

On Tue, Oct 7, 2008 at 10:31 AM, Patrick Pirrotte <
[hidden email]> wrote:

> Hi Xin,
>
> Did you extend ImageCanvas as described in Panel_Window example?
> (http://rsb.info.nih.gov/ij/plugins/download/Panel_Window.java)
>
> As TextPanel is a subclass of java.awt.Panel, adding a panel should be no
> problem...
>
> ....
>
>  void addPanel() {
>            add(new TextPanel("Title"));
>            pack();
>        Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
>            Point loc = getLocation();
>            Dimension size = getSize();
>            if (loc.y+size.height>screen.height)
>                getCanvas().zoomOut(0, 0);
>         }
> ....
>
> Regards,
>
> Patrick
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of xin
> zhang
> Sent: 07 October 2008 16:41
> To: [hidden email]
> Subject: Re: question about adding component to a ImageWindow
>
> Hi, Patrick,
>
> Thanks for the information, what I tried to put in the ImageWindow was
> actually an object of ij.text.TextPanel.
>
> So, any idea?
>
> Xin
>
> On Tue, Oct 7, 2008 at 3:27 AM, Patrick Pirrotte
> <[hidden email]> wrote:
> > Hi Xin,
> >
> > If you want to extend ImageWindow or ImageCanvas you need to stay in AWT.
> > Try replacing JTextPane by java.awt.TextArea.
> >
> > You can't mix heavyweight components (such as AWT) with lightweight
> > components (such as Swing). As ImageJ is written in AWT, inside Frames
> > such as ImageWindow/ImageCanvas only AWT components get correctly
> > drawn. You can put Swing components into a separate JFrame though, and
> > several plugins do so to profit from the larger component library offered
> by javax.swing.*.
> >
> > Regards,
> >
> > Patrick
> >
> > -----Original Message-----
> > From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
> > xin zhang
> > Sent: 07 October 2008 00:03
> > To: [hidden email]
> > Subject: question about adding component to a ImageWindow
> >
> > Hi,
> >
> > I am trying to add a TextPanel to an ImageWindow, however, no matter
> > how do I set the size of the TextPanel, I always get tiny TextPanel as
> > shown at
> > http://terpconnect.umd.edu/~zhangx/imagej/nanoscopeiiireader/Picture-2<http://terpconnect.umd.edu/%7Ezhangx/imagej/nanoscopeiiireader/Picture-2>
> > .png
> >
> > Has anybody any idea how to make the TextPanel take the whole width of
> > the window?
> >
> > Thanks in advance.
> >
> > Xin
> >
> > --
> > ***********************************************
> > Xin Zhang
> > Graduate Student
> > Department of Materials Science and Engineering University of Maryland
> > at College Park
> > Tel: (301)405-0900
> > Email: [hidden email], [hidden email]
> > Web:http://www.glue.umd.edu/~zhangx/<http://www.glue.umd.edu/%7Ezhangx/>
> > ***********************************************
> >
>
>
>
> --
> ***********************************************
> Xin Zhang
> Graduate Student
> Department of Materials Science and Engineering University of Maryland at
> College Park
> Tel: (301)405-0900
> Email: [hidden email], [hidden email]
> Web:http://www.glue.umd.edu/~zhangx/ <http://www.glue.umd.edu/%7Ezhangx/>
> ***********************************************
>
Reply | Threaded
Open this post in threaded view
|

Re: question about adding component to a ImageWindow

xin zhang
In reply to this post by Patrick Pirrotte
Hi, Patrick,

I didn't extend anything.

And the buttons work just fine.  However, the TextPanel just doesn't
respect the size I set.

It may be some problem in the code of TextPanel,  I will look into the
code further when I get time.

Xin

On Tue, Oct 7, 2008 at 11:31 AM, Patrick Pirrotte
<[hidden email]> wrote:

> Hi Xin,
>
> Did you extend ImageCanvas as described in Panel_Window example?
> (http://rsb.info.nih.gov/ij/plugins/download/Panel_Window.java)
>
> As TextPanel is a subclass of java.awt.Panel, adding a panel should be no
> problem...
>
> ....
>
>  void addPanel() {
>            add(new TextPanel("Title"));
>            pack();
>        Dimension screen = Toolkit.getDefaultToolkit().getScreenSize();
>            Point loc = getLocation();
>            Dimension size = getSize();
>            if (loc.y+size.height>screen.height)
>                getCanvas().zoomOut(0, 0);
>         }
> ....
>
> Regards,
>
> Patrick
>
> -----Original Message-----
> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of xin
> zhang
> Sent: 07 October 2008 16:41
> To: [hidden email]
> Subject: Re: question about adding component to a ImageWindow
>
> Hi, Patrick,
>
> Thanks for the information, what I tried to put in the ImageWindow was
> actually an object of ij.text.TextPanel.
>
> So, any idea?
>
> Xin
>
> On Tue, Oct 7, 2008 at 3:27 AM, Patrick Pirrotte
> <[hidden email]> wrote:
>> Hi Xin,
>>
>> If you want to extend ImageWindow or ImageCanvas you need to stay in AWT.
>> Try replacing JTextPane by java.awt.TextArea.
>>
>> You can't mix heavyweight components (such as AWT) with lightweight
>> components (such as Swing). As ImageJ is written in AWT, inside Frames
>> such as ImageWindow/ImageCanvas only AWT components get correctly
>> drawn. You can put Swing components into a separate JFrame though, and
>> several plugins do so to profit from the larger component library offered
> by javax.swing.*.
>>
>> Regards,
>>
>> Patrick
>>
>> -----Original Message-----
>> From: ImageJ Interest Group [mailto:[hidden email]] On Behalf Of
>> xin zhang
>> Sent: 07 October 2008 00:03
>> To: [hidden email]
>> Subject: question about adding component to a ImageWindow
>>
>> Hi,
>>
>> I am trying to add a TextPanel to an ImageWindow, however, no matter
>> how do I set the size of the TextPanel, I always get tiny TextPanel as
>> shown at
>> http://terpconnect.umd.edu/~zhangx/imagej/nanoscopeiiireader/Picture-2
>> .png
>>
>> Has anybody any idea how to make the TextPanel take the whole width of
>> the window?
>>
>> Thanks in advance.
>>
>> Xin
>>
>> --
>> ***********************************************
>> Xin Zhang
>> Graduate Student
>> Department of Materials Science and Engineering University of Maryland
>> at College Park
>> Tel: (301)405-0900
>> Email: [hidden email], [hidden email]
>> Web:http://www.glue.umd.edu/~zhangx/
>> ***********************************************
>>
>
>
>
> --
> ***********************************************
> Xin Zhang
> Graduate Student
> Department of Materials Science and Engineering University of Maryland at
> College Park
> Tel: (301)405-0900
> Email: [hidden email], [hidden email]
> Web:http://www.glue.umd.edu/~zhangx/
> ***********************************************
>



--
***********************************************
Xin Zhang
Graduate Student
Department of Materials Science and Engineering
University of Maryland at College Park
Tel: (301)405-0900
Email: [hidden email], [hidden email]
Web:http://www.glue.umd.edu/~zhangx/
***********************************************
Reply | Threaded
Open this post in threaded view
|

Autocorrelation function/plugin for ImageJ?

John Oreopoulos
In reply to this post by ctrueden
Dear ImageJ list server,

I was wondering if anyone has created an ImageJ plugin capable of  
performing autocorrelation of pixel intensities down a stack ("z" in  
this case for the stack is the parameter of time). I would be  
interested in implementing an ImageJ plugin for the purposes of  
analyzing fluorescence correlation spectroscopy (FCS) data collected  
with an image detector such as an EMCCD camera. This experimental  
technique has been described previously in this paper where the  
autocorrelation was implemented using IgorPro:

Kannan, B., et al., Electron multiplying charge-coupled device camera  
based fluorescence correlation spectroscopy. Analytical Chemistry,  
2006. 78(10): p. 3444-3451.

Thank you in advance for any responses.

John Oreopoulos
Reply | Threaded
Open this post in threaded view
|

Re: Autocorrelation function/plugin for ImageJ?

Thomas Boudier
Hi John,

Maybe you can use the correlate function inside FFT, here a macro how to
use it :

// open your stack
ID=getImageID();
ns=nSlices;
for(s=1;s<ns;s++){
selectImage(ID);
setSlice(s);
run("Duplicate...", "title=[s1]");
selectImage(ID);
setSlice(s+1);
run("Duplicate...", "title=[s2]");
run("FD Math...", "image1=[s1] operation=Correlate image2=[s2]
result=Result"+s+" do");
selectImage("s1");
close();
selectImage("s2");
close();
}


Thomas

> Dear ImageJ list server,
>
> I was wondering if anyone has created an ImageJ plugin capable of
> performing autocorrelation of pixel intensities down a stack ("z" in
> this case for the stack is the parameter of time). I would be
> interested in implementing an ImageJ plugin for the purposes of
> analyzing fluorescence correlation spectroscopy (FCS) data collected
> with an image detector such as an EMCCD camera. This experimental
> technique has been described previously in this paper where the
> autocorrelation was implemented using IgorPro:
>
> Kannan, B., et al., Electron multiplying charge-coupled device camera
> based fluorescence correlation spectroscopy. Analytical Chemistry,
> 2006. 78(10): p. 3444-3451.
>
> Thank you in advance for any responses.
>
> John Oreopoulos
>
>


--
/*****************************************************/
   Thomas Boudier, MCU Université Paris 6,
   UMR 7101 / IFR 83. Bat A 328, Jussieu.
   Tel : 0144273578/2013  Fax : 01 44 27 25 08
/****************************************************/
Reply | Threaded
Open this post in threaded view
|

Re: Autocorrelation function/plugin for ImageJ?

Unruh, Jay
In reply to this post by John Oreopoulos
John,

This technique is implemented in Enrico Gratton's SimFCS program as well as Paul Wiseman's Matlab programs.  The cell migration consortium website has a number of plugins related to this (http://cellmigration.org/resource/imaging/imaging_resources.shtml#protocols) but I'm not sure if they include temporal correlation analysis.

Jay
________________________________________
From: ImageJ Interest Group [[hidden email]] On Behalf Of John Oreopoulos [[hidden email]]
Sent: Wednesday, October 08, 2008 8:39 AM
To: [hidden email]
Subject: Autocorrelation function/plugin for ImageJ?

Dear ImageJ list server,

I was wondering if anyone has created an ImageJ plugin capable of
performing autocorrelation of pixel intensities down a stack ("z" in
this case for the stack is the parameter of time). I would be
interested in implementing an ImageJ plugin for the purposes of
analyzing fluorescence correlation spectroscopy (FCS) data collected
with an image detector such as an EMCCD camera. This experimental
technique has been described previously in this paper where the
autocorrelation was implemented using IgorPro:

Kannan, B., et al., Electron multiplying charge-coupled device camera
based fluorescence correlation spectroscopy. Analytical Chemistry,
2006. 78(10): p. 3444-3451.

Thank you in advance for any responses.

John Oreopoulos
Reply | Threaded
Open this post in threaded view
|

Re: Autocorrelation function/plugin for ImageJ?

Gluender-2
In reply to this post by John Oreopoulos
This question has been posed only some months ago.

I'm not quite sure about the "image"-aspect of this operation
because--as far as I understand--you will need a huge number of
_one-dimensional_ correlations, i.e. not correlations of images
(two-dimensional).

There exist many Applications and a lot of code that perform
one-dimensional correlations...

>Dear ImageJ list server,
>
>I was wondering if anyone has created an ImageJ plugin capable of
>performing autocorrelation of pixel intensities down a stack ("z" in
>this case for the stack is the parameter of time). I would be
>interested in implementing an ImageJ plugin for the purposes of
>analyzing fluorescence correlation spectroscopy (FCS) data collected
>with an image detector such as an EMCCD camera. This experimental
>technique has been described previously in this paper where the
>autocorrelation was implemented using IgorPro:
>
>Kannan, B., et al., Electron multiplying charge-coupled device
>camera based fluorescence correlation spectroscopy. Analytical
>Chemistry, 2006. 78(10): p. 3444-3451.
>
>Thank you in advance for any responses.
>
>John Oreopoulos

Best
--

                   Herbie

          ------------------------
          <http://www.gluender.de>