Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with Multipage TIFF Datastore #82

Open
nicost opened this issue Dec 22, 2019 · 2 comments
Open

Issues with Multipage TIFF Datastore #82

nicost opened this issue Dec 22, 2019 · 2 comments

Comments

@nicost
Copy link
Owner

nicost commented Dec 22, 2019

The script below - that should acquire 3 images, and put them in different positions in the datastore - results in the images being saved on disk, but not being retrievable: Only the last image (position) can be found. This is most dramatically illustrated in the viewer: it displays each new image as it is snapped, but at the end, only the last image is present. Setting the intended dimensions in the SUmmary Metadat does not make a difference. I do not understand why/how normal MDA acquisitions work. This problem does not exist in the RAMDatastore (did not test single page TIFF yet). A similar issue exists for channels, time pints and z-positions seem to be handled correctly.

//targetStore = mm.data().createRAMDatastore();

nrPos = 3;

cb = Coordinates.builder().t(0).c(0).p(nrPos + 1).z(0);
c = cb.build();
targetStore.setSummaryMetadata(targetStore.getSummaryMetadata().
									copyBuilder().intendedDimensions(c).build());
            
mm.displays().createDisplay(targetStore);

for (int i = 0; i < nrPos; i++) {
	imgs = mm.live().snap(true);
	cb.c(0).t(0).z(0).p(i);
	img = imgs.get(0).copyAtCoords(cb.build());
	targetStore.putImage(img);
	Thread.sleep(1000);
}

targetStore.freeze();

mm.scripter().message("Done");
@nicost
Copy link
Owner Author

nicost commented Dec 23, 2019

Changing the first line to:

targetStore = mm.data().createMultipageTIFFDatastore("C:\tmp\test", false, false);

makes it work correctly.

Setting the last parameter (split by position) to true, results in only a single position being saved. Setting only the first parameter to true, works correctly.

This is a problem, but regretfully not the problem I was trying to address;)

@nicost
Copy link
Owner Author

nicost commented Dec 23, 2019

More elaborate version of the test script:


dirName = "C:\\tmp\\test5";
targetStore = mm.data().createMultipageTIFFDatastore(dirName, false, false);
//targetStore = mm.data().createRAMDatastore();

nrPos = 2;
nrC = 4;
nrT = 2;
nrZ = 1;
cb = Coordinates.builder();

for (int p = 0; p < nrPos; p++) {
	for (int c = 0; c < nrC; c++) {
		for (int t = 0; t < nrT; t++) {	
			for (int z = 0; z < nrZ; z++) {
				imgs = mm.live().snap(true);
				cb.c(c).t(t).z(z).p(p);
				img = imgs.get(0).copyAtCoords(cb.build());
				targetStore.putImage(img);
			}
		}
	}
	Thread.sleep(1000);
}

targetStore.close();

mm.scripter().message("Done");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant