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¶
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¶
getWidth¶
-
public int
getWidth
()¶ Returns the width of the images in the dataset.
Returns: The width of the images in the dataset.
saveAsTiffStack¶
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.