Skip to content

Instantly share code, notes, and snippets.

@omsai
Last active May 30, 2016 13:50
Show Gist options
  • Save omsai/1d4a141e3f738f7e8ba6 to your computer and use it in GitHub Desktop.
Save omsai/1d4a141e3f738f7e8ba6 to your computer and use it in GitHub Desktop.
FIJI label timestamps using Bioformats.
// Map time stamps to image labels.
//
// Running this script adds a timestamp label to each image slice.
// Thus the timestamp shows up in paranthesis in the info bar on top
// of the image.
//
// Adapted from planeTimings.txt in bioformats repository:
// https://github.com/openmicroscopy/bioformats/blob/v5.0.2/components/bio-formats-plugins/utils/macros/planeTimings.txt
//
// Pariksheet Nanda <omsai@member.fsf.org> 2014-06-19
// License: Public Domain
run("Bio-Formats Macro Extensions");
id = getInfo("image.directory") + getInfo("image.filename");
Ext.setId(id);
Ext.getImageCount(imageCount);
deltaT = newArray(imageCount);
for (no = 0; no < imageCount; no++) {
Ext.getPlaneTimingDeltaT(deltaT[no], no);
if (deltaT[no] == deltaT[no]) { // not NaN
s = toString(deltaT[no]) + " s";
}
setSlice(no+1);
run("Set Label...", "label=&s");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment