Quantcast

Naming acquisitions for related datasets

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Naming acquisitions for related datasets

Kyle Douglass

Hi everyone,


I am working on a MM2 script to snap a single image and then take a time series Multi-D acquisition of the exact same field of view. Instead of saving the time series to a RAM Datastore, I am saving the images to the disk because the data rates are too high to stream to RAM.


My problem is that I cannot figure out a satisfactory way to prevent the MD acquisition from automatically appending a number to the end of the filenames. This is partly because the Datastore for the MDA is not created until the MDA is started. For example, in my current script which is included at the end of this e-mail, I use a number in a variable called acq_id to keep track of an integer for uniquely identifying corresponding snapped and MD acquisitions. The snapped image has a "_WF" identifier string and the time series has a "_ST" string in the filename; both of these ID strings are followed by the current value in acq_id which is always incremented at the start of the script. The absolute value of acq_id is not important: it only serves to match snapped images to the corresponding MDA. What I originally expected was that the filenames would go like:


+ prefix_WF1_MMStack_Pos0.ome.tif / prefix_ST1_MMStack_Pos0.ome.tif

+ prefix_WF2_MMStack_Pos0.ome.tif / prefix_ST2_MMStack_Pos0.ome.tif

+ etc...


Unfortunately, a "_1" is appended to the filename of the MD acquisition, whereas the snapped image does not have this "_1" appended automatically. In reality I get


+ prefix_WF1_MMStack_Pos0.ome.tif / prefix_ST1_1_MMStack_Pos0.ome.tif

+ prefix_WF2_MMStack_Pos0.ome.tif / prefix_ST2_1_MMStack_Pos0.ome.tif

+ etc...​


Is there someway to prevent the automatic addition of the number to the filename in a MDA? More generally, is it possible to get more control over the name of a datastore that's streamed to disk? In my script, the datastore isn't created until right before the acquisition is started with acq.acquire(); I don't know how to change the name of the datastore before the acquisition because I do not have access to it until after the acquisition is already running.


Thanks for your feedback!

Kyle


String folder     = "L:\\test\\";       // folder to store the data
String filename   = "test"; // name of the datasets, i.e. the "prefix"


acq = mm.getAcquisitionEngine();

acq_id++; // Increments the acquisition ID counter

/* STORM acquisition setup */
String storm_filename = filename + "_ST" + String.valueOf(acq_id);

/* Widefield datastore setup */
String wf_filename = filename + "_WF" + String.valueOf(acq_id);
unique_name = mm.data().getUniqueSaveDirectory(folder + wf_filename);
ds = mm.data().createMultipageTIFFDatastore(unique_name, true, true);

// Extra stuff performed in the script but not necessary to show here....

// Snap widefield image
mmc.snapImage();
tmp = mmc.getTaggedImage();
image = mm.data().convertTaggedImage(tmp);
oldSummary = ds.getSummaryMetadata();
newSummary = oldSummary.copy().prefix(wf_filename).build();
ds.setSummaryMetadata(newSummary);
ds.putImage(image);
ds.freeze();
ds.close();
print("Widefield image acquired.");

// More stuff not important for this discussion...

// Start the STORM acquisition
print("Starting acquisition...");
acq.setRootName(folder);
acq.setDirName(storm_filename);
acq.setSaveFiles(true);
acq.setFrames(num_frames, interval);
ds2 = acq.acquire(); // Datastore ds2 for MDA is not accessible until after acquisition has started


Dr. Kyle M. Douglass
Post-doctoral Researcher
EPFL - The Laboratory of Experimental Biophysics
http://leb.epfl.ch/
http://kmdouglass.github.io

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Naming acquisitions for related datasets

Kyle Douglass

Hi all,


On 03/19/2017 03:21 PM, Kyle Michael Douglass wrote:


My problem is that I cannot figure out a satisfactory way to prevent the MD acquisition from automatically appending a number to the end of the filenames.

After looking at the source code, I think I have answered my own question: there does not currently seem to be a way to prevent the AcquisitionEngine from appending a "_" followed by an index that identifies the acquisition number. The "_<index>" is appended in a method called by the constructor of MMAcquisition and there is currently no option for the user to disable it.

I have opened an issue for discussion about whether this functionality should be changed and possible options for doing so: https://github.com/micro-manager/micro-manager/issues/545

Cheers,
Kyle
-- 
Kyle M. Douglass, PhD
Post-doctoral researcher
The Laboratory of Experimental Biophysics
EPFL, Lausanne, Switzerland
http://kmdouglass.github.io
http://leb.epfl.ch

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Loading...