well.setColumn(new NonNegativeInteger(col));
well.setExternalDescription(d.well);
plate.addWell(well);
}
while (well.sizeOfWellSampleList() <= d.site) {
final WellSample qSample = new WellSample();
qSample.setIndex(new NonNegativeInteger(well.sizeOfWellSampleList()));
well.addWellSample(qSample);
}
final WellSample sample = well.getWellSample(d.site);
Image image = new Image();
Pixels pixels = new Pixels();
Channel [] channels = new Channel[d.sizeC];
for (int i=0; i<d.sizeC; i++) {
Channel c = new Channel();
c.setName(MockImageDescription.DEFAULT_CHANNEL_NAMES[i]);
pixels.addChannel(c);
channels[i] = c;
}
pixels.setSizeX(new PositiveInteger(d.sizeX));
pixels.setSizeY(new PositiveInteger(d.sizeY));
pixels.setSizeC(new PositiveInteger(d.sizeC));
pixels.setSizeZ(new PositiveInteger(d.sizeZ));
pixels.setSizeT(new PositiveInteger(d.sizeT));
pixels.setDimensionOrder(d.order);
for (int i=0; i<d.sizeC*d.sizeZ*d.sizeT; i++) {
int c=0, z=0, t=0;
switch(d.order) {
case XYCTZ:
c = i % d.sizeC;
t = (i / d.sizeC) % d.sizeT;
z = i / d.sizeC / d.sizeT;
break;
case XYCZT:
c = i % d.sizeC;
z = (i / d.sizeC) % d.sizeZ;
t = i / d.sizeC / d.sizeZ;
break;
case XYTCZ:
t = i % d.sizeT;
c = (i / d.sizeT) % d.sizeC;
z = i / d.sizeC / d.sizeT;
break;
case XYTZC:
t = i % d.sizeT;
z = (i / d.sizeT) % d.sizeZ;
c = i / d.sizeZ / d.sizeT;
break;
case XYZCT:
z = i % d.sizeZ;
c = (i / d.sizeZ) % d.sizeC;
t = i / d.sizeC / d.sizeZ;
break;
case XYZTC:
z = i % d.sizeZ;
t = (i / d.sizeZ) % d.sizeT;
c = i / d.sizeT / d.sizeZ;
break;
}
Plane plane = new Plane();
plane.setTheC(new NonNegativeInteger(c));
plane.setTheZ(new NonNegativeInteger(z));
plane.setTheT(new NonNegativeInteger(t));
pixels.addPlane(plane);
}
image.setPixels(pixels);
sample.linkImage(image);
ome.addImage(image);
}
imageFile.setXMLDocument(ome);
return imageFile;
}