final Plane destPlane = new Plane();
pixels.addPlane(destPlane);
int series = 0;
int channel = ImagePlane.ALWAYS_MONOCHROME;
final TiffData location = new TiffData();
final UUID uuid = new UUID();
location.setPlaneCount(new NonNegativeInteger(1));
if (ipd != null) {
final ImagePlane imagePlane = ipd.getImagePlane();
series = imagePlane.getSeries().getSeries();
channel = imagePlane.getChannel();
location.setIFD(new NonNegativeInteger(imagePlane.getIndex()));
uuid.setFileName(imagePlane.getImageFile().getURI().toString());
final Plane omePlane = imagePlane.getOMEPlane();
if (omePlane != null) {
location.setFirstC(omePlane.getTheC());
location.setFirstT(omePlane.getTheT());
location.setFirstZ(omePlane.getTheZ());
} else {
location.setFirstC(NNI_ZERO);
location.setFirstT(NNI_ZERO);
location.setFirstZ(NNI_ZERO);
}
} else {
// A missing plane.
// This retrieves a URI placeholder for it.
uuid.setFileName(new ImageFile(xSize.getValue(), ySize.getValue()).getURI().toString());
location.setIFD(NNI_ZERO);
location.setFirstC(NNI_ZERO);
location.setFirstT(NNI_ZERO);
location.setFirstZ(NNI_ZERO);
}