Skip to content

Instantly share code, notes, and snippets.

@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 <pariksheet.nanda@uconn.edu> July 2014
//
// License: Public Domain
import ij.io.Opener; // To load TIFF stack file from disk.
@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 / 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 <omsai@member.fsf.org> 2014-06-19
@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 <p.nanda@andor.com> 2014-05-06
rem
rem 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 / 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 <p.nanda@andor.com> 2014-03-27
License: Public Domain
@sloria
sloria / bobp-python.md
Last active July 24, 2024 02:53
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@drinks
drinks / gist:6188712
Last active December 20, 2015 20:09
Paste this into your browser's console (view>developer>javascript console in chrome, tools>web developer>web console in firefox) each time you load the page to be walked through the steps of generating a YAML file in the contact-congress format. See comments in the script below for some caveats.
// ==ClosureCompiler==
// @output_file_name default.js
// @compilation_level SIMPLE_OPTIMIZATIONS
// ==/ClosureCompiler==
/*
**Notes**
In some cases, forms will still get submitted when you click the submit button.
@omsai
omsai / gist:5179296
Last active December 15, 2015 01:19
Split Stack ImageJ macro to fix MetaMorph dual camera image files, by splitting them into their separate channel files
/**
* Split Stack macro
*
* Fixes MetaMorph dual camera image files, by splitting them into
* their separate channel files.
*
* Usage: In ImageJ, use Plugins > Macros > Run...
*
* Description:
*
@omsai
omsai / $Drop Off.py
Created October 16, 2012 15:55
Andor iQ Python IDE script to calculate Yokogawa excitation uniformity
#SHELL
"""
Calculate Spinning Disk uniformity and compare with Andor's specification.
Usage:
Start the Python IDE from iQ from under Plugins. Run this Plugin from
the iQ menu and select the "Progress" tab.
Run a protocol with just "Snap" and loop protocol enabled to collect images.
The bar will update to show how close the image drop-off.