How to animate the ImageJ stack window

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

How to animate the ImageJ stack window

Student1
Hi,

I made a customized GUI to display the images that are on the stack. I have taken the contents out of the stack window placed it in my internal frame but when I try to animate the stack it doesn’t work at all. This is what I have tried so far:
ImageCanvas ic = new ImageCanvas(image);
StackWindow sw = new StackWindow(image,ic);
panel2.add(sw.getContentPane());
sw.setAnimate(true);
//sw.run();
//sw.getAnimate();
I don’t know what I am missing cause the sw.setAnimate(true) just displays the first image on the stack and doesn’t changed. If I comment that line out then it displays the entire stack but you have manually animate it.

Thanks

Mariam Dost
--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html
Reply | Threaded
Open this post in threaded view
|

Re: How to animate the ImageJ stack window

Michael Entrup
Hi Mariam,

my experiences with GUIs are not that much, but I think you are missing
an update or repaint call. Have a look at [1]. The method 'setSlice()'
uses the method 'updateAndRepaintWindow()'. This method is connected to
'win.getCanvas().repaint();' and 'win.repaint();'. Maybe you need to
wrap your own GUI into this structure. I have never done this, that is
why I can't give you a more concrete hint.

Best regards
Michael

[1] http://rsbweb.nih.gov/ij/developer/source/ij/ImagePlus.java.html


Am 28.05.2014 23:14, schrieb Student1:

> Hi,
>
> I made a customized GUI to display the images that are on the stack. I have taken the contents out of the stack window placed it in my internal frame but when I try to animate the stack it doesn’t work at all. This is what I have tried so far:
> ImageCanvas ic = new ImageCanvas(image);
> StackWindow sw = new StackWindow(image,ic);
> panel2.add(sw.getContentPane());
> sw.setAnimate(true);
> //sw.run();
> //sw.getAnimate();
> I don’t know what I am missing cause the sw.setAnimate(true) just displays the first image on the stack and doesn’t changed. If I comment that line out then it displays the entire stack but you have manually animate it.
>
> Thanks
>
> Mariam Dost
> --
> ImageJ mailing list: http://imagej.nih.gov/ij/list.html
>

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html