Class Stack

Constructors

  • Create a new stack from an array of images. The images must have the same bit depth and color model.

    Parameters

    • images: Image[]

      Array of images from which to create the stack.

    Returns Stack

Properties

alpha: boolean

Do the images have an alpha channel?

bitDepth: BitDepth

The bit depth of the images.

channels: number

The number of channels of the images.

colorModel: ImageColorModel

The color model of the images.

sameDimensions: boolean

Whether all the images of the stack have the same dimensions.

size: number

The stack size.

Methods

  • Clone a stack. The images are a copy of the original images.

    Returns Stack

    A new stack with the same images.

  • Filter the images in the stack.

    Parameters

    • callback: ((image) => boolean)

      Function to decide which images to keep.

        • (image): boolean
        • Parameters

          Returns boolean

    Returns Stack

    New filtered stack.

  • Get the image at the given index.

    Parameters

    • index: number

      The index of the image.

    Returns Image

    The image.

  • Get the images of the stack. Mainly for debugging purposes.

    Returns Image[]

    The images.

  • Get a value from an image of the stack.

    Parameters

    • stackIndex: number

      Index of the image in the stack.

    • row: number

      Row index of the pixel.

    • column: number

      Column index of the pixel.

    • channel: number

      The channel to retrieve.

    Returns number

    The value at the given position.

  • Get a value from an image of the stack. Specify the pixel position using its index.

    Parameters

    • stackIndex: number

      Index of the image in the stack.

    • index: number

      The index of the pixel.

    • channel: number

      The channel to retrieve.

    Returns number

    The value at the given position.

  • Get the sum of all the histograms of the stack's images. If no channel is specified in the options, the images must be GREY.

    Parameters

    Returns Uint32Array

    The histogram of the stack.

  • Map a function on all the images of the stack.

    Parameters

    • callback: ((image) => Image)

      Function to apply on each image.

    Returns Stack

    New stack with the modified images.

  • Return the image containing the maximum values of all the images in the stack for each pixel. All the images must have the same dimensions.

    Returns Image

    The maximum image.

  • Return the image containing the average values of all the images in the stack for each pixel. All the images must have the same dimensions.

    Returns Image

    The mean image.

  • Return the image containing the median values of all the images in the stack for each pixel. All the images must have the same dimensions.

    Returns Image

    The median image.

  • Return the image containing the minimum values of all the images in the stack for each pixel. All the images must have the same dimensions.

    Returns Image

    The minimum image.

  • Return a 16 bits depth image containing the sum values of all the images in the stack for each pixel.

    Returns Image

    The sum image.