Trouble with ImagePlus.setSlice() method in ImageJ ver 1.37j

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

Trouble with ImagePlus.setSlice() method in ImageJ ver 1.37j

Soft Aliance
Hi all,
I want to update the image window inside a loop. Imageplus.setSlice(int
nslice) method is not doing that. In the sense I could see the scrollbar at
the bottom is moving. But the image canvas is not getting updated. It gets
updated only at the end of the loop.  I have tried giving a delay of one
second and neither the status bar on the top nor the image canvas gets
updated.
my code is something similar to

ImagePlus imp = WindowManager.getCurrentImage();
for(int CurSlice = 0 ; CurSlice <  imp.getStackSize() ; CurSlice ++)
{
         imp.setSlice(CurSlice);
        // IJ.wait(1000);  //Commenting or uncommenting this line did not
have any effect
}
Infact MultiMeasure plugin when I use it to measure in stacks same problem
exists. The image window is not updated while the scrollbar keeps moving.
--
Balaji J
Department of biochemistry
Weil Medical College of Cornell University, New York - 100 21.
alt email: [hidden email]
Reply | Threaded
Open this post in threaded view
|

Re: Trouble with ImagePlus.setSlice() method in ImageJ ver 1.37j

dscho
Hi,

On Sun, 30 Jul 2006, Soft Aliance wrote:

> But the image canvas is not getting updated.

> ImagePlus imp = WindowManager.getCurrentImage();
> for(int CurSlice = 0 ; CurSlice <  imp.getStackSize() ; CurSlice ++)
> {
>         imp.setSlice(CurSlice);

You probably want to call "updateDisplay()" after this:

http://rsb.info.nih.gov/ij/developer/macro/functions.html#U

>        // IJ.wait(1000);  //Commenting or uncommenting this line did not
> have any effect
> }

Hth,
Dscho