Skip to content

Instantly share code, notes, and snippets.

@omsai
omsai / reset_toolbars.py
Last active August 29, 2015 13:57
Reset all toolbar configuration files since they can cause MetaMorph to crash.
"""
Reset MetaMorph user toolbars to default value.
When migrating from 32-bit to 64-bit MetaMorph, sometimes the
mmproc.cfg files have toolbar information that causes MetaMorph to
crash on startup. Reset these to the state found in a new mmproc.cfg
file.
Pariksheet Nanda <[email protected]> 2014-03-27
License: Public Domain
@omsai
omsai / gist:754065720036acece39a
Last active August 29, 2015 14:00
Micro-Manager beanshell script to get time interval between frames in a time series.
// Prints time intervals from most recently selected MDA data window.
//
// Reads "ElapsedTime-ms" property from image metadata to calculate
// image intervals. Sets first frame to 0 ms.
//
// One current limitation of the MM API (and therefore this script) is
// we to the most recently selected MDA data window (it's possible the
// user most recently selected the snap window or an ImageJ image
// window), so one has to prompt the user to select an MDA data
// window. One could add a "getActiveAcquisitionName()" to the gui
@omsai
omsai / _mm_migrate.bat
Last active August 11, 2021 13:44
Copy MetaMorph settings from 32-bit to 64-bit folder.
@echo off
rem Copy settings from 32-bit MetaMorph to fresh 64-bit MetaMorph.
rem
rem Usage: Change the values of mm_old_folder and mm_new_folder as
rem necessary and run the script.
rem
rem Pariksheet Nanda <[email protected]> 2014-05-06
rem
rem License: Public Domain
@omsai
omsai / stamp-times.ijm
Last active May 30, 2016 13:50
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 <[email protected]> 2014-06-19
@omsai
omsai / gist:5fcc529c284ad10b1a62
Last active August 29, 2015 14:03
Micro-Manager beanshell script to close shutter after specified delay.
// Close shutter after specified delay.
//
// In response to James' question on the mailing list:
// http://micro-manager.3463995.n2.nabble.com/Tethered-Cam-Sutter-Shutter-Closure-Delay-td7583216.html
// Set this variable to however long you need your shutter to be open.
delayBeforeShutterCloseMs = 800;
// Opens shutter and sets timer to close shutter.
Runnable synchronizedShutter = new Runnable() {
@omsai
omsai / mosaicSetupSpeckleAcquisition.bsh
Created December 9, 2014 23:17
Micro-Manager script to uploading image sequence to Andor Mosaic3 using core API.
// Upload image from stack to SLM before each frame in MDA.
//
// We have to use the core API to upload each frame individually,
// since there is no public sequencing API for SLM devices.
//
// Pariksheet Nanda <[email protected]> July 2014
//
// License: Public Domain
import ij.io.Opener; // To load TIFF stack file from disk.