Package inra.ijpb.data.image
Class ShortStackWrapper
java.lang.Object
inra.ijpb.data.image.ShortStackWrapper
- All Implemented Interfaces:
Image3D
public class ShortStackWrapper extends java.lang.Object implements Image3D
Access the data of a 3D image containing gray16 values stored as short.
Example of use:
ImageStack stack = IJ.getImage().getStack();
Image3D image = new ShortStackWrapper(stack);
int val = image.get(0, 0, 0);
- Author:
- David Legland
- See Also:
ByteStackWrapper,FloatStackWrapper
-
Constructor Summary
Constructors Constructor Description ShortStackWrapper(ij.ImageStack stack)Creates a new wrapper to the ImageStack. -
Method Summary
Modifier and Type Method Description intget(int x, int y, int z)Returns the value at the specified coordinates as an integer.intgetSize(int dim)Returns the number of voxels along the specified dimension.doublegetValue(int x, int y, int z)Returns the value at the specified coordinates as a double.doublegetValue(Cursor3D pos)Returns the value at the specified coordinates as a double.voidset(int x, int y, int z, int value)Changes the value at the specified coordinates, using an integer to specify the new value.voidsetValue(int x, int y, int z, double value)Changes the value at the specified coordinates, using a double to specify the new value.voidsetValue(Cursor3D pos, double value)Changes the value at the specified coordinates, using a double to specify the new value.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ShortStackWrapper
public ShortStackWrapper(ij.ImageStack stack)Creates a new wrapper to the ImageStack.- Parameters:
stack- the stack to wrap (bit depth must equal 16)
-
-
Method Details
-
getSize
public int getSize(int dim)Description copied from interface:Image3DReturns the number of voxels along the specified dimension. -
get
public int get(int x, int y, int z)Description copied from interface:Image3DReturns the value at the specified coordinates as an integer. -
set
public void set(int x, int y, int z, int value)Description copied from interface:Image3DChanges the value at the specified coordinates, using an integer to specify the new value. -
getValue
public double getValue(int x, int y, int z)Description copied from interface:Image3DReturns the value at the specified coordinates as a double. -
getValue
Description copied from interface:Image3DReturns the value at the specified coordinates as a double. -
setValue
public void setValue(int x, int y, int z, double value)Description copied from interface:Image3DChanges the value at the specified coordinates, using a double to specify the new value. -
setValue
Description copied from interface:Image3DChanges the value at the specified coordinates, using a double to specify the new value.
-