use of cbit.image.ImagePlaneManager in project vcell by virtualcell.
the class RasterExporter method appendSlice.
private void appendSlice(String varName, double[] unslicedData, NrrdInfo sliceNrrdInfo, CartesianMesh mesh, GeometrySpecs geometrySpecs, FileDataContainerManager fileDataContainerManager) throws IOException, DataAccessException {
// Setup manager to extract plane
double[] sliceData = new double[sliceNrrdInfo.getAxisSize(NRRDAxisNames.X) * sliceNrrdInfo.getAxisSize(NRRDAxisNames.Y)];
ImagePlaneManager imagePlaneManager = createSlicer(mesh, unslicedData, geometrySpecs);
// copy plane to double[]
int index = 0;
for (int y = 0; y < sliceNrrdInfo.getAxisSize(NRRDAxisNames.Y); y++) {
for (int x = 0; x < sliceNrrdInfo.getAxisSize(NRRDAxisNames.X); x++) {
sliceData[index] = imagePlaneManager.getImagePlaneData().getDataAsTypeRaw(x, y, 0);
index++;
}
}
NRRDHelper.appendDoubleData(sliceNrrdInfo, fileDataContainerManager, sliceData, varName);
}
Aggregations