Interface Image3D

All Known Implementing Classes:
ByteStackWrapper, FloatStackWrapper, ShortStackWrapper

public interface Image3D
Interface for accessing the values of a 3D stack. Implementations should provide efficient access to the inner data, without checking coordinate bounds. Data can be accessed either as integer or as double.

Example of use:


	ImageStack stack = IJ.getImage().getStack();
	Image3D image = new ByteStackWrapper(stack);
	int val = image.get(0, 0, 0);
Author:
David Legland
  • Method Summary

    Modifier and Type Method Description
    int get​(int x, int y, int z)
    Returns the value at the specified coordinates as an integer.
    int getSize​(int dim)
    Returns the number of voxels along the specified dimension.
    double getValue​(int x, int y, int z)
    Returns the value at the specified coordinates as a double.
    double getValue​(Cursor3D pos)
    Returns the value at the specified coordinates as a double.
    void set​(int x, int y, int z, int value)
    Changes the value at the specified coordinates, using an integer to specify the new value.
    void setValue​(int x, int y, int z, double value)
    Changes the value at the specified coordinates, using a double to specify the new value.
    void setValue​(Cursor3D pos, double value)
    Changes the value at the specified coordinates, using a double to specify the new value.
  • Method Details

    • getSize

      int getSize​(int dim)
      Returns the number of voxels along the specified dimension.
      Parameters:
      dim - the dimension, between 0 and 2
      Returns:
      the size along the given dimension, as a number of voxels
    • get

      int get​(int x, int y, int z)
      Returns the value at the specified coordinates as an integer.
      Parameters:
      x - the x-coordinate of the voxel (0-indexed)
      y - the y-coordinate of the voxel (0-indexed)
      z - the z-coordinate of the voxel (0-indexed)
      Returns:
      the value at the specified position
    • set

      void set​(int x, int y, int z, int value)
      Changes the value at the specified coordinates, using an integer to specify the new value.
      Parameters:
      x - the x-coordinate of the voxel (0-indexed)
      y - the y-coordinate of the voxel (0-indexed)
      z - the z-coordinate of the voxel (0-indexed)
      value - the new value at the specified position
    • getValue

      double getValue​(int x, int y, int z)
      Returns the value at the specified coordinates as a double.
      Parameters:
      x - the x-coordinate of the voxel (0-indexed)
      y - the y-coordinate of the voxel (0-indexed)
      z - the z-coordinate of the voxel (0-indexed)
      Returns:
      the value at the specified position
    • getValue

      double getValue​(Cursor3D pos)
      Returns the value at the specified coordinates as a double.
      Parameters:
      pos - the position as a Cursor3D
      Returns:
      the value at the specified position
    • setValue

      void setValue​(int x, int y, int z, double value)
      Changes the value at the specified coordinates, using a double to specify the new value.
      Parameters:
      x - the x-coordinate of the voxel (0-indexed)
      y - the y-coordinate of the voxel (0-indexed)
      z - the z-coordinate of the voxel (0-indexed)
      value - the new value at the specified position
    • setValue

      void setValue​(Cursor3D pos, double value)
      Changes the value at the specified coordinates, using a double to specify the new value.
      Parameters:
      pos - the position of the voxel
      value - the new value at the specified position