nicost / micro-manager

Microscope control and image acquisition integrated with ImageJ.
http://www.micro-manager.org
16 stars 11 forks source link

Datastores silently accept images of different dimensions #83

Closed nicost closed 4 years ago

nicost commented 4 years ago

Using the putImage function on a datastore and sending images of different sizes does not cause any error whatsoever. This can lead to difficult to trace failures. I think that it would be best for the putImage function to throw an exception.

Illustrated with the following script:


targetStore = mm.data().createRAMDatastore();
mm.displays().createDisplay(targetStore);

nrT = 3;
cb = Coordinates.builder();
cb.c(0).t(0).p(0).z(0);

for (int t =0; t < nrT; t++) {
    cb.t(t);
    imgs = mm.live().snap(true);
    img = imgs.get(0).copyAtCoords(cb.build());
    targetStore.putImage(img);
    xSize = Integer.parseInt(mmc.getProperty("Camera", "OnCameraCCDXSize"));
    xSize--;
    mmc.setProperty("Camera", "OnCameraCCDXSize", xSize);
}
nicost commented 4 years ago

Moved to https://github.com/micro-manager/micro-manager/issues/685