int nZ = 31;
String[] title = new String[] {"created by SimpleJvxlWriter "
+ new SimpleDateFormat("yyyy-MM-dd', 'HH:mm").format(new Date()) };
VolumeData volumeData;
VoxelDataCreator vdc;
volumeData = new VolumeData();
volumeData.setVolumetricOrigin(0, 0, 0);
volumeData.setVolumetricVector(0, 1f, 0f, 0f);
volumeData.setVolumetricVector(1, 0f, 1f, 0f);
volumeData.setVolumetricVector(2, 0f, 0f, 1f);
volumeData.setVoxelCounts(nX, nY, nZ);
vdc = new VoxelDataCreator(volumeData);
vdc.createVoxelData();
// areaVolumeReturn and surfacePointsReturn are optional
// -- set to null for faster calculation of JVXL data
float[] areaVolumeReturn = new float[2]; // or null;
List surfacePointsReturn = new ArrayList(); // or null;
params.isXLowToHigh = false;
writeFile(outputFile + "A", jvxlGetData(null, params,
volumeData, title, surfacePointsReturn, areaVolumeReturn));
if (areaVolumeReturn != null)
System.out.println("calculated area = " + areaVolumeReturn[0]
+ " volume = " + areaVolumeReturn[1]
+ " for " + surfacePointsReturn.size()
+ " surface points");
// streaming option: null voxelData
volumeData.setVoxelData(null);
params.isXLowToHigh = true;
writeFile(outputFile + "B", jvxlGetData(vdc, params,
volumeData, title, surfacePointsReturn, areaVolumeReturn));
System.out.flush();