Public Member Functions | |
Binary3DImage (String pathname, int x, int y, int z) | |
Binary3DImage (RegionMask regionMask, int x, int y, int z) | |
boolean | readImageFile () |
boolean | readRLCCompressedImageFile () |
void | printImageArray () |
int | compareByteArrays () |
byte | getVoxelValue (int x, int y, int z) |
int | getVoxelValueInt (int x, int y, int z) |
int[] | getCell (int x, int y, int z) |
byte | getByte (int position) |
int | getX () |
int | getY () |
int | getZ () |
Static Public Member Functions | |
static byte[] | getByteList (byte bits) |
static void | printByteContent (byte b) |
Public Attributes | |
byte[] | image |
int[] | image2 |
This class represent a binary 3D image. It stores information about the image, and the image itself.
It can read two different image files: Uncompressed and RLE compressed files. The dimensions of the image has to be specified when creating the Binary3DImage
object.
The image data is stored in the variable image
, which is an array of type byte[].
Definition at line 20 of file Binary3DImage.java.
theba.core.gui.Binary3DImage.Binary3DImage | ( | String | pathname, | |
int | x, | |||
int | y, | |||
int | z | |||
) |
Constructs a new Binary3DImage
object.
pathname | the file path of the image | |
x | the x size | |
y | the y size | |
z | the z size |
Definition at line 49 of file Binary3DImage.java.
References theba.core.gui.Binary3DImage.image, and theba.core.gui.Binary3DImage.image2.
theba.core.gui.Binary3DImage.Binary3DImage | ( | RegionMask | regionMask, | |
int | x, | |||
int | y, | |||
int | z | |||
) |
Constructs a new Binary3DImage
object.
x | the x size | |
y | the y size | |
z | the z size |
Definition at line 73 of file Binary3DImage.java.
References theba.core.gui.Binary3DImage.image, and theba.core.gui.Binary3DImage.image2.
int theba.core.gui.Binary3DImage.compareByteArrays | ( | ) |
Compares two byte arrays which are supposed to be equel. Helpful for debugging.
Definition at line 183 of file Binary3DImage.java.
References theba.core.gui.Binary3DImage.image, and theba.core.gui.Binary3DImage.image2.
byte theba.core.gui.Binary3DImage.getByte | ( | int | position | ) |
Returns a byte (containing 8 voxel values) at a given position in the image
array
position | the position in the array |
Definition at line 281 of file Binary3DImage.java.
References theba.core.gui.Binary3DImage.image.
static byte [] theba.core.gui.Binary3DImage.getByteList | ( | byte | bits | ) | [static] |
Converts a byte value (containing 8 voxels) into a byte array.
bits | the byte value |
Definition at line 296 of file Binary3DImage.java.
int [] theba.core.gui.Binary3DImage.getCell | ( | int | x, | |
int | y, | |||
int | z | |||
) |
Returns a cube consisting of 8 vertices, where each vertex represents a voxel in the image. Used during the marching step of the discrete marching cubes algorithm.
x | the x position | |
y | the y position | |
z | the z position |
Definition at line 249 of file Binary3DImage.java.
References theba.core.gui.Binary3DImage.getVoxelValue(), and theba.core.RegionMask.isSet().
byte theba.core.gui.Binary3DImage.getVoxelValue | ( | int | x, | |
int | y, | |||
int | z | |||
) |
Returns the voxel value at position (x, y, z).
x | x position | |
y | y position | |
z | z position |
Definition at line 205 of file Binary3DImage.java.
References theba.core.gui.Binary3DImage.image.
Referenced by theba.core.gui.Binary3DImage.getCell().
int theba.core.gui.Binary3DImage.getVoxelValueInt | ( | int | x, | |
int | y, | |||
int | z | |||
) |
Returns the voxel value from image2
. Helpful for debugging.
x | x position | |
y | y position | |
z | z position |
Definition at line 228 of file Binary3DImage.java.
References theba.core.gui.Binary3DImage.image2.
int theba.core.gui.Binary3DImage.getX | ( | ) |
Returns the x size of the image
Definition at line 323 of file Binary3DImage.java.
int theba.core.gui.Binary3DImage.getY | ( | ) |
Returns the y size of the image
Definition at line 332 of file Binary3DImage.java.
int theba.core.gui.Binary3DImage.getZ | ( | ) |
Returns the z size of the image
Definition at line 341 of file Binary3DImage.java.
static void theba.core.gui.Binary3DImage.printByteContent | ( | byte | b | ) | [static] |
Prints the contents of a byte as a string with 0 and 1. Helgful for debugging.
b | the byte to be printed |
Definition at line 311 of file Binary3DImage.java.
Referenced by theba.core.gui.Binary3DImage.printImageArray().
void theba.core.gui.Binary3DImage.printImageArray | ( | ) |
Prints the whole image as ASCII text. Helpful while debugging.
Definition at line 171 of file Binary3DImage.java.
References theba.core.gui.Binary3DImage.image, and theba.core.gui.Binary3DImage.printByteContent().
boolean theba.core.gui.Binary3DImage.readImageFile | ( | ) |
Reads an uncompressed image. The file path was specified in the constructor.
Definition at line 93 of file Binary3DImage.java.
References theba.core.gui.Binary3DImage.image.
boolean theba.core.gui.Binary3DImage.readRLCCompressedImageFile | ( | ) |
Reads an run-length encoded image. Assumes first pixel is black.
Definition at line 134 of file Binary3DImage.java.
References theba.core.gui.Binary3DImage.image.
Definition at line 27 of file Binary3DImage.java.
Referenced by theba.core.gui.Binary3DImage.Binary3DImage(), theba.core.gui.Binary3DImage.compareByteArrays(), theba.core.gui.Binary3DImage.getByte(), theba.core.gui.Binary3DImage.getVoxelValue(), theba.core.gui.Binary3DImage.printImageArray(), theba.core.gui.Binary3DImage.readImageFile(), and theba.core.gui.Binary3DImage.readRLCCompressedImageFile().
Definition at line 29 of file Binary3DImage.java.
Referenced by theba.core.gui.Binary3DImage.Binary3DImage(), theba.core.gui.Binary3DImage.compareByteArrays(), and theba.core.gui.Binary3DImage.getVoxelValueInt().