nicost/micro-manager

Datastores silently accept images of different dimensions

Closed this issue · 1 comments

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);
}