Class CompressedImageTiler

java.lang.Object
nom.tam.image.compression.CompressedImageTiler
All Implemented Interfaces:
ImageTiler

public class CompressedImageTiler extends Object implements ImageTiler
Class to extract individually compressed tiles from a compressed image. This class supports the FITS 3.0 standard and up, and will stream the results to a provided ArrayDataOutput.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Only constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the entire image reconstructed from the available tiles.
    getTile(int[] corners, int[] lengths)
    Returns a tile from the image of the specified size at the specified location.
    void
    getTile(Object output, int[] corners, int[] lengths)
    Fills the supplied array or output stream with the data from an image tile of the specified size at the specified location.
    void
    getTile(Object output, int[] corners, int[] lengths, int[] steps)
    Fills the supplied array our output stream with the sparsely sampled data from an image tile of the specified size at the specified location.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface nom.tam.image.ImageTiler

    getTile
  • Constructor Details

    • CompressedImageTiler

      public CompressedImageTiler(CompressedImageHDU compressedImageHDU)
      Only constructor. This will pull commonly accessed elements (header, data) from the HDU.
      Parameters:
      compressedImageHDU - The compressed Image HDU.
  • Method Details

    • getCompleteImage

      public Object getCompleteImage() throws IOException
      Description copied from interface: ImageTiler
      Returns the entire image reconstructed from the available tiles.
      Specified by:
      getCompleteImage in interface ImageTiler
      Returns:
      the complete reconstructed image from the available tiles, as a Java array. This may be an array of promitives (such as float[][]) for images, or an Object[] for binary tables.
      Throws:
      IOException - if there was an error accessing the tile data from the input.
      See Also:
    • getTile

      public void getTile(Object output, int[] corners, int[] lengths) throws IOException
      Description copied from interface: ImageTiler
      Fills the supplied array or output stream with the data from an image tile of the specified size at the specified location.
      Specified by:
      getTile in interface ImageTiler
      Parameters:
      output - A one-dimensional output array or stream. Data not within the valid limits of the image will be left unchanged. For an array, the length should be the product of lengths. Optionally provide an ArrayDataOutput to stream out data and not fill memory; useful for web applications.
      corners - the pixels indices where the tile starts in the full image. The array =hould contain a value for each image dimension.
      lengths - the tile size in pixels. The array =hould contain a value for each image dimension. For the supported 2D tiles, the values beyond the first two entries should be set to 1.
      Throws:
      IOException - if there was an error writing the tile to the output.
      See Also:
    • getTile

      public void getTile(Object output, int[] corners, int[] lengths, int[] steps) throws IOException
      Description copied from interface: ImageTiler
      Fills the supplied array our output stream with the sparsely sampled data from an image tile of the specified size at the specified location.
      Specified by:
      getTile in interface ImageTiler
      Parameters:
      output - A one-dimensional output array or stream. Data not within the valid limits of the image will be left unchanged. For an array, the length should be the product of lengths. Optionally provide an ArrayDataOutput to stream out data and not fill memory; useful for web applications.
      corners - the pixels indices where the tile starts in the full image. The array =hould contain a value for each image dimension.
      lengths - the tile size in pixels. The array =hould contain a value for each image dimension. For the supported 2D tiles, the values beyond the first two entries should be set to 1.
      steps - the sampling frequency of the original image, in pixels. The array =hould contain a value for each image dimension.
      Throws:
      IOException - if there was an error writing the tile to the output.
      See Also:
    • getTile

      public Object getTile(int[] corners, int[] lengths) throws IOException
      Description copied from interface: ImageTiler
      Returns a tile from the image of the specified size at the specified location. An image tile is returned as a one-dimensional array although the image will normally be multidimensional.
      Specified by:
      getTile in interface ImageTiler
      Parameters:
      corners - the pixels indices where the tile starts in the full image. The array =hould contain a value for each image dimension.
      lengths - the tile size in pixels. The array should contain a value for each image dimension. For the supported 2D tiles, the values beyond the first two entries should be set to 1.
      Returns:
      a Java array containing data for the requested tile. This will always be a flattened 1D array, even if the image is multidimensional
      Throws:
      IOException - if there was an error accessing the tile data from the input.
      See Also: