Re: [Fwd: Re: virtual stack]
Posted by Albert Cardona on May 15, 2007; 7:08pm
URL: http://imagej.273.s1.nabble.com/Fwd-Re-virtual-stack-tp3699465p3699468.html
Hi Thomas,
> There is a boolean changes in imageplus but i do not know how to get
> its value from virtaul stack.
Add an ImageListener so that when the ImagePlus containing your
VirtualStack is sent to the listener through the method
imageUpdated(ImagePlus imp), then save whatever may have changed. This
though can be severe overkill.
Another option is to keep a pointer of the ImagePlus containing the
VirtualStack, then read its 'updated' boolean field.
And of course if there is a call to setPixels, save the image.
You may need an extended ImageProcessor as well to detect changes in the
pixels arrays, for example when methods setPixel and friends are called.
So your Opener should place the opened images in your extended
ImageProcessor (make a constructor in an extended ImageProcessor that
keeps the real ImageProcessor, and proxies method calls to it -so that
you can catch the changes).
> The idea to put it in getprocessor was to save any previous changes
> before displaying a new slice.
I think the above is not going to work, because no changes can be made:
setPixels goes nowhere in your stack, and the ImageProcessor
representing each slice is thrown away when browsing through the slices.
Albert