rlaramee
Class FromFloatToCube
java.lang.Object
|
+--rlaramee.FromFloatToCube
- public class FromFloatToCube
- extends java.lang.Object
Description: This object will read 1 or more sets of floats, each
of which is a variate, and output the corresponding
cube representation (of the same data set)
start date Mon 5 March '01
- Version:
- 1.0
- Author:
- Robert S Laramee
- See Also:
fromFloatToCube.c
Method Summary |
private int |
addRowOfCubes(float[] frontLayerOfVariate1,
float[] backLayerOfVariate1,
float[] frontLayerOfVariate2,
float[] backLayerOfVariate2,
int offsetIntoLayer,
short currentLayer)
P3_____________P2 This is the cube representation
/| /| for Bob's cube's. |
int |
buildCubes(short xDimension,
short yDimension,
short zDimension)
|
private int |
copyLayer(float[] sourceLayer,
float[] destinationLayer)
|
private BinaryCubeReader |
getBinaryCubeReader()
|
private short |
getDepthOfLayers()
|
private FileHandler |
getFileHandler(byte i)
|
private short |
getFloatResolution()
|
private short |
getHeightOfColumns()
|
private short |
getLengthOfRows()
|
private byte |
getNumVariates()
|
private int |
getSizeOfLayer()
|
private int |
outputLayerOfCubes(float[] frontLayerOfVariate1,
float[] backLayerOfVariate1,
float[] frontLayerOfVariate2,
float[] backLayerOfVariate2,
short currentLayer)
|
private int |
outputVolumeOfCubes()
This function outputs the volume data in cube representation. |
private void |
printLayerOfFloats(float[] layer)
|
private int |
readLayerOfFloats(byte variate,
float[] data)
|
private void |
setBinaryCubeReader(BinaryCubeReader bcr)
|
private void |
setDepthOfLayers(short newDepth)
|
private void |
setFileHandler(byte i,
FileHandler singleHandler)
|
private void |
setFileHandlers(byte numVariates)
|
void |
setFloatResolution(short newResolution)
|
private void |
setHeightOfColumns(short newHeight)
|
private void |
setLengthOfRows(short newLength)
|
private void |
setNumVariates(byte newNum)
|
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait |
binaryCubeReader
private BinaryCubeReader binaryCubeReader
processTimer
private ProcessTimer processTimer
lengthOfRows
private short lengthOfRows
heightOfColumns
private short heightOfColumns
depthOfLayers
private short depthOfLayers
resolution
private short resolution
numOfVariates
private byte numOfVariates
fileHandler
private FileHandler[] fileHandler
FromFloatToCube
public FromFloatToCube(BinaryCubeReader binaryCubeReader,
byte numVariates,
short cubeResolution)
- constructor
- Parameters:
binaryCubeReader
- a reference to the binaryCubeReader object
that created this objectnumVariates
- the number of variates in the data setcubeResolution
- the resolution of the variate data sets
getBinaryCubeReader
private BinaryCubeReader getBinaryCubeReader()
- Returns:
- the binary cube reader collaborating with this object
setBinaryCubeReader
private void setBinaryCubeReader(BinaryCubeReader bcr)
- Parameters:
the
- binary cube reader collaborating with this object
getFloatResolution
private short getFloatResolution()
- Returns:
- the resolution we are reading
setFloatResolution
public void setFloatResolution(short newResolution)
- Parameters:
newResolution
- the resolution being rendered
getLengthOfRows
private short getLengthOfRows()
- Returns:
- the length of one row
(the number of sample points along the x dimension)
setLengthOfRows
private void setLengthOfRows(short newLength)
- Parameters:
the
- length of one row
(the number of sample points along the x dimension)
getHeightOfColumns
private short getHeightOfColumns()
- Returns:
- the height of one column
(the number of sample points along the y dimension)
setHeightOfColumns
private void setHeightOfColumns(short newHeight)
- Parameters:
the
- height of one column
(the number of sample points along the y dimension)
getDepthOfLayers
private short getDepthOfLayers()
- Returns:
- the depth of the layers as a collection
(the number of sample points along the z dimension)
setDepthOfLayers
private void setDepthOfLayers(short newDepth)
- Parameters:
the
- depth of the layers as a collection
(the number of sample points along the z dimension)
getSizeOfLayer
private int getSizeOfLayer()
- Returns:
- the number of sample points in one layer
getNumVariates
private byte getNumVariates()
- Returns:
- the number of variates in the data set
setNumVariates
private void setNumVariates(byte newNum)
- Parameters:
the
- number of variates in the data set
getFileHandler
private FileHandler getFileHandler(byte i)
- Returns:
- FileHandler 1 of this object's fileHandlers
setFileHandlers
private void setFileHandlers(byte numVariates)
- Parameters:
the
- number of file handlers -1 for each variate
setFileHandler
private void setFileHandler(byte i,
FileHandler singleHandler)
- Parameters:
i
- the file handler we are settingsingleHandler
- a single FileHandler
buildCubes
public int buildCubes(short xDimension,
short yDimension,
short zDimension)
- Returns:
- the number of floats that were read
outputVolumeOfCubes
private int outputVolumeOfCubes()
- This function outputs the volume data in cube representation.
- Parameters:
inputFile
- a handle to the input file- Returns:
- the total number of cubes output
outputLayerOfCubes
private int outputLayerOfCubes(float[] frontLayerOfVariate1,
float[] backLayerOfVariate1,
float[] frontLayerOfVariate2,
float[] backLayerOfVariate2,
short currentLayer)
- Parameters:
frontLayerOfVariate1
- the front layer of variate 1 scalar valuesbackLayerOfVariate1
- the back layer of variate 1 scalar valuesfrontLayerOfVariate2
- the front layer of variate 2 scalar valuesbackLayerOfVariate2
- the back layer of variate 2 scalar valuescurrentLayer
- the current layer number of cubes we are
outputting- Returns:
- the total number of cubes output in the layer
addRowOfCubes
private int addRowOfCubes(float[] frontLayerOfVariate1,
float[] backLayerOfVariate1,
float[] frontLayerOfVariate2,
float[] backLayerOfVariate2,
int offsetIntoLayer,
short currentLayer)
P3_____________P2 This is the cube representation
/| /| for Bob's cube's. It is the
/ | / | same as the VTK's.
y P7____________P6/ |
^ | | | |
| | | | |
| | | | |
|---> | P0|_________|___|P1
/ x | / | /
/ | / | /
z |_____________|/
P4 P5
- Parameters:
frontLayerOfVariate1
- the front layer of variate 1 vertex scalarsbackLayerOfVariate1
- the back layer of variate 1 vertex scalarsfrontLayerOfVariate2
- the front layer of variate 2 vertex scalarsbackLayerOfVariate2
- the back layer of variate 2 vertex scalarsoffsetIntoLayer
- the number of rows already processed *
the length of each rowcurrentLayer
- the current layer number of cubes we are
outputting- Returns:
- the total number of cubes output in that row
copyLayer
private int copyLayer(float[] sourceLayer,
float[] destinationLayer)
- Parameters:
sourceLayer
- the layer of floats containing the data to
be copieddestinationLayer
- the layer to store the copied data in- Returns:
- numCopied the number of scalars copied from the
source layer to the destination layer
readLayerOfFloats
private int readLayerOfFloats(byte variate,
float[] data)
- Parameters:
variate
- identifies the variate we are readingdata
- the array to store the data in
printLayerOfFloats
private void printLayerOfFloats(float[] layer)
- Parameters:
layer
- a layer of data to print