| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectij.ImageStack
ij.VirtualStack
ij.plugin.AVI_Reader
public class AVI_Reader
 ImageJ Plugin for reading an AVI file into an image stack
  (one slice per video frame)
 
  Version 2008-07-03 by Michael Schmid, based on a plugin by
  Daniel Marsh and Wayne Rasband
 Restrictions and Notes:
      - Only few formats supported:
          - uncompressed 8 bit with palette (=LUT)
          - uncompressed 8 & 16 bit grayscale
          - uncompressed 24 & 32 bit RGB (alpha channel ignored)
          - uncompressed 32 bit AYUV (alpha channel ignored)
          - various YUV 4:2:2 compressed formats
          - png or jpeg-encoded individual frames.
            Note that most MJPG (motion-JPEG) formats are not read correctly.
      - Does not read avi formats with more than one frame per chunk
      - Palette changes during the video not supported
      - Out-of-sequence frames (sequence given by index) not supported
      - Different frame sizes in one file (rcFrame) not supported
      - Conversion of (A)YUV formats to grayscale is non-standard:
        All 255 levels are kept as in the input (i.e. the full dynamic
        range of data from a frame grabber is preserved).
        For standard behavior, use "Brightness&Contrast", Press "Set",
        enter "Min." 16, "Max." 235, and press "Apply".
 Version History:
   2008-07-03
      - Support for 16bit AVIs coded by MIL (Matrox Imaging Library)
   2008-06-08
      - Support for png and jpeg/mjpg encoded files added
      - Retrieves animation speed from image frame rate
      - Exception handling without multiple error messages
   2008-04-29
      - Support for several other formats added, especially some YUV
        (also named YCbCr) formats
      - Uneven chunk sizes fixed
      - Negative biHeight fixed  
      - Audio or second video stream don't cause a problem
      - Can read part of a file (specify start & end frame numbers)
      - Can convert YUV and RGB to grayscale (does not convert 8-bit with palette)
      - Can flip vertically
      - Can create a virtual stack
      - Added slice label: time of the frame in the movie
      - Added a public method 'getStack' that does not create an image window
      - More compact code, especially for reading the header (rewritten)
      - In the code, bitmapinfo items have their canonical names
 The AVI format looks like this:
 RIFF                     RIFF HEADER
 |-AVI                    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)
   | | |-strd             OPTIONAL -- STREAM DATA (ignored in this plugin)
   | | |-strn             OPTIONAL -- STREAM NAME (ignored in this plugin)
   |LIST movi             MOVIE DATA
   | | [rec]              RECORD DATA (one record per frame for interleaved video; optional, unsupported in this plugin)
   | |  |-dataSubchunks   RAW DATA: '??wb' for audio, '??db' and '??dc' for uncompressed and
   |                      compressed video, respectively. "??" denotes stream number, usually "00" or "01"
   |-idx1                 AVI INDEX (required by some programs, ignored in this plugin)
 
| Constructor Summary | |
|---|---|
| AVI_Reader() | |
| Method Summary | |
|---|---|
|  void | deleteSlice(int n)Deletes the specified image from this virtual stack (if it is one), where 1<=n<=nslices. | 
|  int | getHeight()Returns the image height of the virtual stack | 
|  ImagePlus | getImagePlus()Returns the ImagePlus opened by run(). | 
|  ImageProcessor | getProcessor(int n)Returns an ImageProcessor for the specified frame of this virtual stack (if it is one) where 1<=n<=nslices. | 
|  int | getSize()Returns the number of images in this virtual stack (if it is one) | 
|  java.lang.String | getSliceLabel(int n)Returns the label of the specified slice in this virtual stack (if it is one). | 
|  int | getWidth()Returns the image width of the virtual stack | 
|  ImageStack | makeStack(java.lang.String path,
          int firstFrameNumber,
          int lastFrameNumber,
          boolean isVirtual,
          boolean convertToGray,
          boolean flipVertical)Create an ImageStack from an avi file with given path. | 
|  void | run(java.lang.String arg)The plugin is invoked by ImageJ using this method. | 
| Methods inherited from class ij.VirtualStack | 
|---|
| addSlice, addSlice, addSlice, addSlice, deleteLastSlice, getBitDepth, getDirectory, getFileName, getImageArray, getPixels, isVirtual, saveChanges, setBitDepth, setPixels, setSliceLabel, trim | 
| Methods inherited from class ij.ImageStack | 
|---|
| addUnsignedShortSlice, getColorModel, getRoi, getShortSliceLabel, getSliceLabels, isHSB, isRGB, setColorModel, setRoi, toString, update | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Constructor Detail | 
|---|
public AVI_Reader()
| Method Detail | 
|---|
public void run(java.lang.String arg)
run in interface PlugInpublic ImagePlus getImagePlus()
public ImageStack makeStack(java.lang.String path,
                            int firstFrameNumber,
                            int lastFrameNumber,
                            boolean isVirtual,
                            boolean convertToGray,
                            boolean flipVertical)
path - Directoy+filename of the avi filefirstFrameNumber - Number of first frame to read (first frame of the file is 1)lastFrameNumber - Number of last frame to read or 0 for reading all, -1 for all but last...isVirtual - Whether to return a virtual stackconvertToGray - Whether to convert color images to grayscale
public ImageProcessor getProcessor(int n)
getProcessor in class VirtualStackpublic int getWidth()
getWidth in class ImageStackpublic int getHeight()
getHeight in class ImageStackpublic int getSize()
getSize in class VirtualStackpublic java.lang.String getSliceLabel(int n)
getSliceLabel in class VirtualStackpublic void deleteSlice(int n)
deleteSlice in class VirtualStack| 
 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||