How do I save an ImageStack in a plug in

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

How do I save an ImageStack in a plug in

Philip Ershler
Hello,
        I am attempting to use a mildly modified version of the Batch_Converter.java and a slightly modified version of QT_Movie_Opener.java to batch process a significant number of Quicktime movies. I need to do a standard crop and then write the result out to a file.  Now I reveal how little of the ImageJ underpinnings I really understand. I get down to these lines of code in the QT_Movie_Opener.java

                new ImagePlus(path, stack).show();
                return;

        At this point the cropped stack is on the screen. How the heck do I get the stack out to a file?

Thanks, Phil

Philip R. Ershler Ph.D.
University of Utah
Cardiovascular Research and Training Institute
95 South 2000 East
Salt Lake City, UT 84112-5000
Reply | Threaded
Open this post in threaded view
|

Re: How do I save an ImageStack in a plug in

dscho
Hi Philip,

On Wed, 26 Oct 2011, Philip Ershler wrote:

> I am attempting to use a mildly modified version of the
> Batch_Converter.java and a slightly modified version of
> QT_Movie_Opener.java to batch process a significant number of Quicktime
> movies. I need to do a standard crop and then write the result out to a
> file.  Now I reveal how little of the ImageJ underpinnings I really
> understand. I get down to these lines of code in the
> QT_Movie_Opener.java
>
> new ImagePlus(path, stack).show();
> return;
>
> At this point the cropped stack is on the screen. How the heck do
> I get the stack out to a file?

Might be useful to have a look at the docs I wrote for such a situation:
fiji.sc/Introduction_into_Developing_Plugins#The_hierarchy_of_the_classes_representing_an_image

In short: instead of calling .show() on the freshly instantiated
ImagePlus, you should hand it to the IJ.saveAs() method.

Ciao,
Johannes