Extracting acquisition Time Stamps

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

Extracting acquisition Time Stamps

Eric Griffis (Staff)
Hi Chris and Mark,

I was wondering if there is a simple way to extract a text or .csv file that would have the exact time stamps for every image (each channel and Z-plane) in a multi-color time series. We are tracking some rapidly moving particles and would like to know how much time exists between acquiring channel 1 and channel 2 for each time point in our series. It is simple to determine the time between image 1 and image 2, but I’m struggling to dig out all of the data across the multiple channels.

Best regards,

Eric




Centre for Gene Regulation and Expression
College of Life Sciences
University of Dundee
MSI/WTB/JBC Complex
Dow Street
Dundee DD1 5EH
United KIngdom

+44 (0)1382 385118
[hidden email]
http://www.lifesci.dundee.ac.uk/groups/eric_griffis/GriffisLab/index.html




The University of Dundee is a registered Scottish Charity, No: SC015096
------------------------------------------------------------------------------
_______________________________________________
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: Extracting acquisition Time Stamps

Chris Weisiger
Hi Eric,

On Fri, Sep 18, 2015 at 4:18 AM, Eric Griffis (Staff) <[hidden email]> wrote:
Hi Chris and Mark,

I was wondering if there is a simple way to extract a text or .csv file that would have the exact time stamps for every image (each channel and Z-plane) in a multi-color time series. We are tracking some rapidly moving particles and would like to know how much time exists between acquiring channel 1 and channel 2 for each time point in our series. It is simple to determine the time between image 1 and image 2, but I’m struggling to dig out all of the data across the multiple channels.

There's an option (Tools menu -> Options) to save a separate "metadata.txt" file alongside your TIFFs. Unfortunately you'd still need to parse it.

Alternatively, this script will iterate over the images in the topmost window and print out their "ElapsedTime-ms" metadata tag, along with their image coordinates. I hope it helps.

import org.micromanager.api.MMWindow;

window = new MMWindow(ij.WindowManager.getCurrentWindow().getImagePlus());
cache = gui.getCacheForWindow(ij.WindowManager.getCurrentWindow());

for (int f = 0; f < window.getNumberOfFrames(); ++f) {
    for (int c = 0; c < window.getNumberOfChannels(); ++c) {
        for (int s = 0; s < window.getNumberOfSlices(); ++s) {
            for (int p = 0; p < window.getNumberOfPositions(); ++p) {
                image = cache.getImage(c, f, s, p);
                text = "image not found";
                if (image != null) {
                      text = image.tags.get("ElapsedTime-ms");
                }
                 print(f + ", " + c + ", " + s + ", " + p + ", " + text);
            }
        }
    }
}


-Chris


------------------------------------------------------------------------------

_______________________________________________
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: Extracting acquisition Time Stamps

Benjamin Rappaz
Hi,
We have made some modifications to this code to extract the frame, data, time and elapsed time from the MM 1.4 metadata (code attached).GetElaspedTime-timeStamp.bsh
However, do you know if an equivalent code exists for MM2?
Thank you in advance, kind regards,
  Benjamin

Chris Weisiger wrote
Hi Eric,

On Fri, Sep 18, 2015 at 4:18 AM, Eric Griffis (Staff) <
[hidden email]> wrote:

> Hi Chris and Mark,
>
> I was wondering if there is a simple way to extract a text or .csv file
> that would have the exact time stamps for every image (each channel and
> Z-plane) in a multi-color time series. We are tracking some rapidly moving
> particles and would like to know how much time exists between acquiring
> channel 1 and channel 2 for each time point in our series. It is simple to
> determine the time between image 1 and image 2, but I’m struggling to dig
> out all of the data across the multiple channels.
>

There's an option (Tools menu -> Options) to save a separate "metadata.txt"
file alongside your TIFFs. Unfortunately you'd still need to parse it.

Alternatively, this script will iterate over the images in the topmost
window and print out their "ElapsedTime-ms" metadata tag, along with their
image coordinates. I hope it helps.

import org.micromanager.api.MMWindow;

window = new MMWindow(ij.WindowManager.getCurrentWindow().getImagePlus());
cache = gui.getCacheForWindow(ij.WindowManager.getCurrentWindow());

for (int f = 0; f < window.getNumberOfFrames(); ++f) {
    for (int c = 0; c < window.getNumberOfChannels(); ++c) {
        for (int s = 0; s < window.getNumberOfSlices(); ++s) {
            for (int p = 0; p < window.getNumberOfPositions(); ++p) {
                image = cache.getImage(c, f, s, p);
                text = "image not found";
                if (image != null) {
                      text = image.tags.get("ElapsedTime-ms");
                }
                 print(f + ", " + c + ", " + s + ", " + p + ", " + text);
            }
        }
    }
}


-Chris

------------------------------------------------------------------------------

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Loading...