Bug(?) in naming snapped images

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

Bug(?) in naming snapped images

Kyle Douglass

Hi all,


I've noticed a strange behavior in the naming of single images saved as image stacks in the very latest Micro-Manager 2.0. I can trace this behavior back to at least early January nightly builds.


For example, the script at the bottom of this e-mail creates a folder named /home/kmdouglass/test_snap, snaps an image, and then saves the image in this folder. Based on 1.4.2x versions, I was expecting the image file inside it to be named test_snap_MMStack_Pos0.ome.tif. However, the resulting name of the file is MMStack_Pos0.ome.tif without the prefix "test_snap" appended.


This behavior is also apparent when I save the current image in the Snap/Live View as an image stack with the GUI.


Is this a bug, or was the naming convention changed in MM 2.0? If someone else can indeed confirm it's a bug, please let me know and I will open a new issue on GitHub.


As a final, minor note: if the string assigned to filePath in the script below ends in "/", then the result of getUniqueSaveDirectory will append an underscore and an integer *after* the /, which ultimately places the new image *inside* the folder /home/kmdouglass/test_snap/. Perhaps there should be some checking for trailing "/" and "\"'s in the arguments to getUniqueSaveDirectory().


Thanks!

Kyle




filePath = "/home/kmdouglass/test_snap/";
uniqueName = mm.data().getUniqueSaveDirectory(filePath);
ds = mm.data().createMultipageTIFFDatastore(uniqueName, true, true);
        
mmc.snapImage();
tmp = mmc.getTaggedImage();
image = mm.data().convertTaggedImage(tmp);
ds.putImage(image);
ds.freeze();
ds.close();


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: Bug(?) in naming snapped images

julou
Hi Kyle,

I dont know whether there is a bug but as far as I understood this is set using the 'prefix' property of summaryMetadata
http://micro-manager.3463995.n2.nabble.com/Reslicing-a-dataset-to-a-given-time-range-tp7585701p7586580.html

This property also set the window title…
Hope this helps!

Thomas
Thomas Julou  |  Computational & Systems Biology  |  Biozentrum – University of Basel  |  Klingelbergstrasse 50/70 CH-4056 Basel  |  +41 (0)61 267 16 21
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Bug(?) in naming snapped images

Kyle Douglass
Hi Thomas,


On 03/07/2017 11:08 AM, julou wrote:
> I dont know whether there is a bug but as far as I understood this is set
> using the 'prefix' property of summaryMetadata
> http://micro-manager.3463995.n2.nabble.com/Reslicing-a-dataset-to-a-given-time-range-tp7585701p7586580.html
>

Thanks! This solves my problem. I hadn't realized that the name of the
file is determined by the "prefix" in the summary metadata.

For future reference, a modification to my previous example script where
the filename may be set looks like the following:

filename = "test_prefix_name";
filePath = "/home/douglass/" + prefix;
uniqueName = mm.data().getUniqueSaveDirectory(filePath);
ds = mm.data().createMultipageTIFFDatastore(uniqueName, true, true);

mmc.snapImage();
tmp = mmc.getTaggedImage();
image = mm.data().convertTaggedImage(tmp);

// Copy summary metadata and adjust the filename prefix
oldSummary = ds.getSummaryMetadata();
newSummary = oldSummary.copy().prefix(filename).build();
ds.setSummaryMetadata(newSummary);

ds.putImage(image);
ds.freeze();
ds.close();



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


------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Loading...