ImageS

public interface ImageS

An abstraction layer for a 3-dimensional, 16-bit image stack in SASS. This interface allows developers to more easily substitute other backends for image data into SASS. For example, one could write an implementation for ImgLib2 datatypes to replace ImageJ’s original ImageStack. This interface should be used everywhere image data is passed between SASS components.

Author:Kyle M. Douglass

Methods

addImage

public void addImage(short[][] image)

Adds a single image to the dataset. This method accepts a 2D array of pixels and adds it to the end of the dataset. The size of the image in X and Y must be the same as the existing images.

Parameters:
  • image – The image data to add to the dataset.
Throws:

addImage

public void addImage(int[][] image)

Adds a single image to the dataset. This method accepts a 2D array of pixels and adds it to the end of the dataset. The size of the image in X and Y must be the same as the existing images. Integer data will be truncated into shorts.

Parameters:
  • image – The image data to add to the dataset.
Throws:

addImage

public void addImage(float[][] image)

Adds a single image to the dataset. This method accepts a 2D array of pixels and adds it to the end of the dataset. The size of the image in X and Y must be the same as the existing images. Float data will be truncated into shorts.

Parameters:
  • image – The image data to add to the dataset.
Throws:

concatenate

public void concatenate(ImageS dataset)

Appends another ImageS dataset to the end of this one.

Parameters:
  • dataset – The images to add to the dataset.
Throws:

getBitDepth

public int getBitDepth()

Returns the bit depth of the pixels.

Returns:The bit depth of the pixels.

getHeight

public int getHeight()

Returns the height of the images in the dataset.

Returns:The height of the images in the dataset.

getPixelData

public short[] getPixelData(int index)

Returns the image data at the slice corresponding to index.

Parameters:
  • index

getSize

public int getSize()

Returns the number of images in the dataset.

Returns:The number of images in the dataset.

getSlice

public int getSlice()

Gets the active slice of the dataset (0-indexed). This is the image that will be displayed in the viewer.

Returns:The index of the current slice.

getTitle

public String getTitle()

Returns the title (or, equivalently, the name) of the image dataset.

Returns:The title of the dataset.

getWidth

public int getWidth()

Returns the width of the images in the dataset.

Returns:The width of the images in the dataset.

saveAsTiffStack

public void saveAsTiffStack(File file)

Saves the images to a TIFF file.

Parameters:
  • file – The TIFF file where the dataset will be saved.

serializeToArray

public byte[] serializeToArray()

Serializes the dataset into a TIFF-encoded byte array.

Returns:The image data encoded as a TIFF-file byte string.

serializeToBuffer

public ByteBuffer serializeToBuffer()

Returns a buffer containing the dataset in a TIFF-encoded byte array.

Returns:A ByteBuffer containing the TIFF-encoded dataset.

setSlice

public void setSlice(int index)

Sets the active slice of the dataset (0-indexed). * This is the image that will be displayed in the viewer.

Parameters:
  • index – The index of the slice to activate.

setTitle

public void setTitle(String title)

Sets the title (or, equivalently, the name) of the dataset.

Parameters:
  • title – The title to give to the image dataset.

updateView

public void updateView()

Updates the dataset viewer to show the currently active slice.

view

public void view()

Displays the images.