BIJ API

VolumeJ
Class VJVoxelLoc

java.lang.Object
  |
  +--VolumeJ.VJVoxelLoc

public class VJVoxelLoc
extends java.lang.Object

This class defines a voxel location for interpolation and rendering. It is useful because it keeps both the integer part of the voxel location (nearest neighbor voxel), and the weights to each of the eight surrounding voxels that can be used for higher order interpolation. Voxel locations are always in object space. Copyright (c) 1999-2002, Michael Abramoff. All rights reserved.


Field Summary
 float blb
           
 float blf
           
 float brb
           
 float brf
           
 float dx
          Difference between ix/iy/iz and x/y/z [0-1].
 float dy
           
 float dz
           
 boolean hasWeights
           
 int ix
          integer floor of voxel location.
 int iy
           
 int iz
           
 float tlb
           
 float tlf
          trilinear interpolation weights.
 float trb
           
 float trf
           
 float x
           
 float y
           
 float z
           
 
Constructor Summary
VJVoxelLoc()
          Empty VJVoxelLoc creator.
VJVoxelLoc(float[] v)
          Create a new VJVoxelLoc from a vector.
VJVoxelLoc(float[] vs, VJMatrix m)
          Create a new VJVoxelLoc from a transformed vector location.
VJVoxelLoc(float x, float y, float z)
          Create a new VJVoxelLoc for an objectspace location x,y,z.
VJVoxelLoc(float x, float y, float z, VJMatrix m)
          Create a new VJVoxelLoc from a transformed vector location.
 
Method Summary
 int getnnx()
          Get the x-position rounded to the nearest int for nearest neighborhood interpolation.
 int getnny()
          Get the y-position rounded to the nearest int for nearest neighborhood interpolation.
 int getnnz()
          Get the z-position rounded to the nearest int for nearest neighborhood interpolation.
 void getWeights()
           
 float getx()
          Get the x-position.
 float gety()
          Get the y-position.
 float getz()
          Get the z-position.
 void move(float[] dos)
          Move the location of this voxel with delta's in dos.
 void setx(int x)
          Set the value for x.
 void sety(int y)
          Set the value for x.
 void setz(float z)
          Set the value for z.
 void setz(int z)
          Set the value for z.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ix

public int ix
integer floor of voxel location.

iy

public int iy

iz

public int iz

x

public float x

y

public float y

z

public float z

dx

public float dx
Difference between ix/iy/iz and x/y/z [0-1].

dy

public float dy

dz

public float dz

tlf

public float tlf
trilinear interpolation weights.

blf

public float blf

trf

public float trf

brf

public float brf

tlb

public float tlb

blb

public float blb

trb

public float trb

brb

public float brb

hasWeights

public boolean hasWeights
Constructor Detail

VJVoxelLoc

public VJVoxelLoc()
Empty VJVoxelLoc creator.

VJVoxelLoc

public VJVoxelLoc(float x,
                  float y,
                  float z)
Create a new VJVoxelLoc for an objectspace location x,y,z. Voxel coordinates are always in object space.
Parameters:
x,y,z - float the object space location.

VJVoxelLoc

public VJVoxelLoc(float[] vs,
                  VJMatrix m)
Create a new VJVoxelLoc from a transformed vector location. Voxel coordinates are always in object space.
Parameters:
vs - float[4] the location vector (homogenous).
m - the the transformation matrix.

VJVoxelLoc

public VJVoxelLoc(float x,
                  float y,
                  float z,
                  VJMatrix m)
Create a new VJVoxelLoc from a transformed vector location.
Parameters:
x, - y, z the location vector in un-transformed coordinates.
m - the transformation matrix.

VJVoxelLoc

public VJVoxelLoc(float[] v)
Create a new VJVoxelLoc from a vector.
Parameters:
v - the location vector (homogenous).
Method Detail

getx

public float getx()
Get the x-position.
Returns:
a float with the x position.

gety

public float gety()
Get the y-position.
Returns:
a float with the x position.

getz

public float getz()
Get the z-position.
Returns:
a float with the x position.

getnnx

public int getnnx()
Get the x-position rounded to the nearest int for nearest neighborhood interpolation.
Returns:
an int with the closest integer x position.

getnny

public int getnny()
Get the y-position rounded to the nearest int for nearest neighborhood interpolation.
Returns:
an int with the closest integer y position.

getnnz

public int getnnz()
Get the z-position rounded to the nearest int for nearest neighborhood interpolation.
Returns:
an int with the closest integer z position.

setz

public void setz(float z)
Set the value for z.
Parameters:
z - the value to set.

setx

public void setx(int x)
Set the value for x.
Parameters:
x - an int with the x value.

sety

public void sety(int y)
Set the value for x.
Parameters:
y - an int with the y value.

setz

public void setz(int z)
Set the value for z.
Parameters:
z - an int with the z value.

getWeights

public void getWeights()

move

public void move(float[] dos)
Move the location of this voxel with delta's in dos. Useful for stepping through a number of voxels on a straight line.
Parameters:
dos - float[>=3] a vector containing the motion.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

BIJ API

Submit a bug or feature

Copyright (c) 1997-2003 Michael Abramoff
Licensing available. All Rights Reserved.