Package inra.ijpb.data.image
Class ByteStackWrapper
java.lang.Object
inra.ijpb.data.image.ByteStackWrapper
- All Implemented Interfaces:
Image3D
public class ByteStackWrapper extends java.lang.Object implements Image3D
Access the data of a 3D image containing gray8 values stored as bytes.
Example of use:
ImageStack stack = IJ.getImage().getStack();
Image3D image = new ByteStackWrapper(stack);
int val = image.get(0, 0, 0);
- Author:
- David Legland
- See Also:
ShortStackWrapper
,FloatStackWrapper
-
Constructor Summary
Constructors Constructor Description ByteStackWrapper(ij.ImageStack stack)
Creates a new wrapper to the ImageStack. -
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.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ByteStackWrapper
public ByteStackWrapper(ij.ImageStack stack)Creates a new wrapper to the ImageStack.- Parameters:
stack
- the stack to wrap (bit depth must equal 8)
-
-
Method Details
-
getSize
public int getSize(int dim)Description copied from interface:Image3D
Returns the number of voxels along the specified dimension. -
get
public int get(int x, int y, int z)Description copied from interface:Image3D
Returns 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:Image3D
Changes 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:Image3D
Returns the value at the specified coordinates as a double. -
getValue
Description copied from interface:Image3D
Returns 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:Image3D
Changes the value at the specified coordinates, using a double to specify the new value. -
setValue
Description copied from interface:Image3D
Changes the value at the specified coordinates, using a double to specify the new value.
-