theba.core.gui.Binary3DImage Class Reference

List of all members.

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

Detailed Description

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.


Constructor & Destructor Documentation

theba.core.gui.Binary3DImage.Binary3DImage ( String  pathname,
int  x,
int  y,
int  z 
)

Constructs a new Binary3DImage object.

Parameters:
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.

Parameters:
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.


Member Function Documentation

int theba.core.gui.Binary3DImage.compareByteArrays (  ) 

Compares two byte arrays which are supposed to be equel. Helpful for debugging.

Returns:
number of unequal bits

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

Parameters:
position the position in the array
Returns:
a byte value representing 8 values

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.

Parameters:
bits the byte value
Returns:
a byte array

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.

Parameters:
x the x position
y the y position
z the z position
Returns:
an int[8] array containing the cube's vertex values

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).

Parameters:
x x position
y y position
z z position
Returns:
the voxel value. Either 0 or 1

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.

Parameters:
x x position
y y position
z z position
Returns:
the voxel value. Either 0 or 1

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

Returns:
the x size

Definition at line 323 of file Binary3DImage.java.

int theba.core.gui.Binary3DImage.getY (  ) 

Returns the y size of the image

Returns:
the y size

Definition at line 332 of file Binary3DImage.java.

int theba.core.gui.Binary3DImage.getZ (  ) 

Returns the z size of the image

Returns:
the z size

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.

Parameters:
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.

Returns:
true if no exceptions, false if it did not work

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.

Returns:
true if no exceptions, else false if it did not work

Definition at line 134 of file Binary3DImage.java.

References theba.core.gui.Binary3DImage.image.


Member Data Documentation


The documentation for this class was generated from the following file:

Generated on Fri Nov 13 08:57:08 2009 for Theba by  doxygen 1.6.1