|
IsoSurface Rendering of an AR Representation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--rlaramee.FromMRtoARcube
Description: The idea behind FromMRtoAR.java is to read a set of uniform resolution volume data stored as binary cubes and output in adaptive resolution represented cubes. Note that it is required that the input cubes must be sorted by octant in order for this program to succeed. Run the script FromASCIItoBinarySortCubeScript before running this program. The program fromMRtoAR.c does the same thing as this program but for ASCII files. Since we've increased I/O speed in java by reading binary data and not using serialization, we save time in the long run by skipping past the ASCII files altogether.
start date Mon 19 Mar '01
Field Summary | |
private FileHandler |
fileHandler
|
private short |
resolution
|
private float |
threshold
|
private int |
totalNumCubes
|
Constructor Summary | |
FromMRtoARcube()
constructor |
Method Summary | |
private boolean |
areAboveThreshold(Cube[] siblingCubes)
For now, the threshold is set simply by the different between the maximum and minimum scalar values. |
private FileHandler |
getFileHandler()
|
private short |
getResolution()
|
private float |
getThreshold()
|
private int |
getTotalNumCubes()
|
static void |
main(java.lang.String[] args)
Compile the program using: |
private int |
outputARcubes(java.lang.String inputFileName,
java.lang.String outputFileName)
This function writes the volume data in AR reprepresentation. |
private boolean |
parseCoordinates(Cube cube)
This method parses the block number in the X,Y,Z directions It also tells the cube to set its vertices coordinate values |
private boolean |
parseDataVTK(Cube cube)
This method parses the 8 data values. |
private boolean |
parseError(Cube cube)
This method parses the error measure number |
private int |
read8Cubes(Cube[] cubes)
A parent cube has 8 child cubes |
private int |
readBinaryCube(Cube cube)
|
private void |
setFileHandler(FileHandler newFileHandler)
|
private void |
setResolution(short newRes)
|
private void |
setThreshold(float newVal)
|
private void |
setTotalNumCubes(int newTotal)
|
private boolean |
validRange(double value,
double min,
double max)
|
private boolean |
validRange(double value,
int min,
int max)
|
private int |
write8Cubes(Cube[] cubes)
|
Methods inherited from class java.lang.Object |
|
Field Detail |
private FileHandler fileHandler
private float threshold
private int totalNumCubes
private short resolution
Constructor Detail |
public FromMRtoARcube()
Method Detail |
private float getThreshold()
private void setThreshold(float newVal)
the
- new threshold valueprivate int getTotalNumCubes()
private void setTotalNumCubes(int newTotal)
the
- total number of cubes in the volumeprivate FileHandler getFileHandler()
private void setFileHandler(FileHandler newFileHandler)
newFileHandler
- this object's FileHandlerprivate short getResolution()
private void setResolution(short newRes)
newRes
- the resolution of this cubeprivate int outputARcubes(java.lang.String inputFileName, java.lang.String outputFileName)
inputFileName
- the name of the input fileoutputFileName
- the name of the output fileprivate boolean areAboveThreshold(Cube[] siblingCubes)
cubes
- an array of 8 sibling cubesprivate int read8Cubes(Cube[] cubes)
cubes[8]
- an array to store a cube structuresprivate int readBinaryCube(Cube cube)
cube
- the cube object we are populating values forprivate boolean parseDataVTK(Cube cube) throws java.io.IOException
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
cube
- a pointer to the current cube being readjava.io.IOException
- private boolean parseError(Cube cube) throws java.io.IOException
cube
- a pointer to the current cube being readjava.io.IOException
- private boolean parseCoordinates(Cube cube) throws java.io.IOException
cube
- a pointer to the current cube being readjava.io.IOException
- private int write8Cubes(Cube[] cubes)
cubes
- an array of 8 cubesprivate boolean validRange(double value, int min, int max)
value
- the value to validatemin
- the minimum allowable valuemax
- the maximum allowable valueprivate boolean validRange(double value, double min, double max)
value
- the value to validatemin
- the minimum allowable valuemax
- the maximum allowable valuepublic static void main(java.lang.String[] args)
% javac -deprecation FromMRtoARcube.java
Start the program using:
% java FromMRtoARcube [input file] [xDim] [yDim] [zDim] [threshold] \ [output file] e.g. % java FromMRtoARcube ../data/level6/headRes2cube.bin 2 2 2 0.01 > \ ../data/level6/headRes2AR010.ascii
args[0]
- -the input data file nameargs[1]
- -the number of cubes along the x dimensionargs[2]
- -the number of cubes along the y dimensionargs[3]
- -the number of cubes along the z dimensionargs[4]
- -the threshold value that determines which cubes are
"trimmed" from the representationargs[5]
- -the output file name
|
IsoSurface Rendering of an AR Representation | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |