Module ij

Class AVI_Writer

  • All Implemented Interfaces:
    PlugInFilter

    public class AVI_Writer
    extends java.lang.Object
    implements PlugInFilter
    This plugin implements the File/Save As/AVI command. Supported formats: Uncompressed 8-bit (gray or indexed color), 24-bit (RGB), JPEG and PNG compression of individual frames 16-bit and 32-bit (float) images are converted to 8-bit The plugin is based on the FileAvi class written by William Gandler, part of Matthew J. McAuliffe's MIPAV program, available from http://mipav.cit.nih.gov/. 2008-06-05: Support for jpeg and png-compressed output and composite images by Michael Schmid. 2015-09-28: Writes AVI 2.0 if the file size would be above approx. 0.9 GB The AVI format written looks like this: RIFF AVI RIFF HEADER, AVI CHUNK | LIST hdrl MAIN AVI HEADER | | avih AVI HEADER | | LIST strl STREAM LIST(s) (One per stream) | | | strh STREAM HEADER (Required after above; fourcc type is 'vids' for video stream) | | | strf STREAM FORMAT (for video: BitMapInfo; may also contain palette) | | | strn STREAM NAME | | | indx MAIN 'AVI 2.0' INDEX of 'ix00' indices | LIST movi MOVIE DATA (maximum approx. 0.95 GB) | | 00db or 00dc FRAME (b=uncompressed, c=compressed) | | 00db or 00dc FRAME | | ... | | ix00 AVI 2.0-style index of frames within this 'movi' list RIFF AVIX Only if required by size (this is AVI 2.0 extension) | LIST movi MOVIE DATA (maximum approx. 0.95 GB) | | 00db or 00dc FRAME | | ... | | ix00 AVI 2.0-style index of frames within this 'movi' list RIFF AVIX further chunks, each approx 0.95 GB (AVI 2.0) ...
    • Constructor Detail

      • AVI_Writer

        public AVI_Writer()
    • Method Detail

      • setup

        public int setup​(java.lang.String arg,
                         ImagePlus imp)
        Description copied from interface: PlugInFilter
        This method is called once when the filter is loaded. 'arg', which may be blank, is the argument specified for this plugin in IJ_Props.txt or in the plugins.config file of a jar archive containing the plugin. 'imp' is the currently active image. This method should return a flag word that specifies the filters capabilities.

        For Plugin-filters specifying the PlugInFilter.FINAL_PROCESSING flag, the setup method will be called again, this time with arg = "final" after all other processing is done.

        Specified by:
        setup in interface PlugInFilter
      • run

        public void run​(ImageProcessor ip)
        Asks for the compression type and filename; then saves as AVI file
        Specified by:
        run in interface PlugInFilter
      • writeImage

        public void writeImage​(ImagePlus imp,
                               java.lang.String path,
                               int compression,
                               int jpegQuality)
                        throws java.io.IOException
        Writes an ImagePlus (stack) as AVI file.
        Throws:
        java.io.IOException