.. java:import:: ij ImageStack .. java:import:: ij ImagePlus .. java:import:: ij.process FloatProcessor .. java:import:: ij.io FileSaver .. java:import:: java.io File .. java:import:: java.nio ByteBuffer .. java:import:: ch.epfl.leb.sass.utils.images ImageS .. java:import:: ch.epfl.leb.sass.utils.images ImageShapeException DefaultImageS ============= .. java:package:: ch.epfl.leb.sass.utils.images.internal :noindex: .. java:type:: public class DefaultImageS implements ImageS The default implementation of the ImageS interface. The default implementation currently wraps ImageJ1's ImageStack class. See https://imagej.nih.gov/ij/developer/api/ij/ImagePlus.html for more information. :author: Kyle M. Douglass Constructors ------------ DefaultImageS ^^^^^^^^^^^^^ .. java:constructor:: public DefaultImageS(int width, int height) :outertype: DefaultImageS Creates a new and empty DefaultImageS. DefaultImageS ^^^^^^^^^^^^^ .. java:constructor:: public DefaultImageS(int[][] pixels) :outertype: DefaultImageS Creates a new DefaultImageS object from a 2D array of ints. The first index of the input array should correspond to x; the second corresponds to y. :param pixels: The 2D array of pixel values. DefaultImageS ^^^^^^^^^^^^^ .. java:constructor:: public DefaultImageS(float[][] pixels) :outertype: DefaultImageS Creates a new DefaultImageS object from a 2D array of floats. The first index of the input array should correspond to x; the second corresponds to y. :param pixels: The 2D array of pixel values. Methods ------- addImage ^^^^^^^^ .. java:method:: @Override public void addImage(short[][] image) throws ImageShapeException :outertype: DefaultImageS Adds a 2D array of shorts to the dataset. :param image: A 2D array of shorts. addImage ^^^^^^^^ .. java:method:: @Override public void addImage(int[][] image) throws ImageShapeException :outertype: DefaultImageS Converts a 2D array of ints to 16-bit shorts and adds it to the dataset. :param image: A 2D array of ints indexed by xy. :throws ch.epfl.leb.sass.utils.images.ImageShapeException: addImage ^^^^^^^^ .. java:method:: @Override public void addImage(float[][] image) throws ImageShapeException :outertype: DefaultImageS Converts a 2D array of floats to 16-bit shorts and adds it to the dataset. :param image: A 2D array of floats indexed by xy. :throws ch.epfl.leb.sass.utils.images.ImageShapeException: concatenate ^^^^^^^^^^^ .. java:method:: @Override public void concatenate(ImageS dataset) throws ImageShapeException :outertype: DefaultImageS Appends another ImageS dataset to the end of this one. :param dataset: The images to add to the dataset. getBitDepth ^^^^^^^^^^^ .. java:method:: @Override public int getBitDepth() :outertype: DefaultImageS getHeight ^^^^^^^^^ .. java:method:: @Override public int getHeight() :outertype: DefaultImageS Returns the height of the images in the dataset. :return: The height of the images in the dataset. getPixelData ^^^^^^^^^^^^ .. java:method:: @Override public short[] getPixelData(int index) :outertype: DefaultImageS Returns the pixel data at the given index as a 1D array. :param index: The index of the corresponding slice. :return: The pixel data at the provided index. getSize ^^^^^^^ .. java:method:: @Override public int getSize() :outertype: DefaultImageS Returns the number of images in the dataset. :return: The number of images in the dataset. getSlice ^^^^^^^^ .. java:method:: @Override public int getSlice() :outertype: DefaultImageS Gets the active slice of the dataset (0-indexed). This is the image that will be displayed in the viewer. :return: The index of the active slice. getTitle ^^^^^^^^ .. java:method:: @Override public String getTitle() :outertype: DefaultImageS Returns the title of the image stack. :return: The title of the image stack. getWidth ^^^^^^^^ .. java:method:: @Override public int getWidth() :outertype: DefaultImageS Returns the width of the images in the dataset. :return: The width of the images in the dataset. saveAsTiffStack ^^^^^^^^^^^^^^^ .. java:method:: @Override public void saveAsTiffStack(File file) throws IllegalArgumentException :outertype: DefaultImageS Saves the images to a TIFF file. serializeToArray ^^^^^^^^^^^^^^^^ .. java:method:: @Override public byte[] serializeToArray() :outertype: DefaultImageS Serializes the image stack to a TIFF-encoded byte array. :return: A TIFF-encoded byte array. serializeToBuffer ^^^^^^^^^^^^^^^^^ .. java:method:: @Override public ByteBuffer serializeToBuffer() :outertype: DefaultImageS Returns a buffer containing the dataset in a TIFF-encoded byte array. :return: A buffer containing the dataset in a TIFF-encoded byte array. setSlice ^^^^^^^^ .. java:method:: @Override public void setSlice(int index) :outertype: DefaultImageS Sets the active slice of the dataset (0-indexed). This is the image that will be displayed in the viewer. :param index: The index of the slice to activate. setTitle ^^^^^^^^ .. java:method:: @Override public void setTitle(String title) :outertype: DefaultImageS Sets the title of the image stack. :param title: The title of the image stack. updateView ^^^^^^^^^^ .. java:method:: @Override public void updateView() :outertype: DefaultImageS Updates the dataset viewer to show the currently active slice. view ^^^^ .. java:method:: @Override public void view() :outertype: DefaultImageS Displays the images in a ImagePlus window.