Save folder and metadata via script

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Save folder and metadata via script

Hi all,
I wonder if anybody can help with saving multiple files to the same

I'm trying to take multiple movies in 6 different wells, and it would be
cool to save all the multipage Tiffs from each well in a single folder with
incremented names.  The plan is to visit each well, take a movie, and then
repeat.  A timelapse of timelapses essentially.  When using the create
createMultipageTIFFDatastore (or createRewritableRAMDatastore and saving
afterwards) it tells me that the folder exists.  Is it possible to create a
datastore folder and then reuse it?

I was hoping to use the function below in my script and pass the different
datastores, stage positions etc and repeat.

boolean takeMovie(
                Datastore store,
                String filename,
                int nrFrames,
                int stagePos) {

        summaryMeta =;
        exposureMs = mmc.getExposure();
        // Create a display to show images as they are acquired.
        // Set up a Coords.CoordsBuilder for applying coordinates to each image.
        builder =;
        int curFrame = 0;
        mmc.startSequenceAcquisition(nrFrames, 0, true);
        while (mmc.getRemainingImageCount() > 0 ||
mmc.isSequenceRunning(mmc.getCameraDevice())) {
           if (mmc.getRemainingImageCount() > 0) {
              tagged = mmc.popNextTaggedImage();
              // Convert to an Image at the desired timepoint.
              image =,
                 builder.time(curFrame).build(), null);
           else {
              // Wait for another image to arrive.
              mmc.sleep(Math.min(.5 * exposureMs, 20));
        return true;

With the above function I'm also having issue with the timestamp metadata.
I see "ElapsedTime-ms": 5.7369207527281E11 in one frame, 5.7369207532781E11
in the next, etc.  There is a difference between the values that corresponds
to the frame to frame time, but the units don't make sense.

Thanks in advance for your time.


Sent from:

Check out the vibrant tech community on one of the world's most
engaging tech sites,!
micro-manager-general mailing list
[hidden email]