Skip to content

Instantly share code, notes, and snippets.

@omsai
omsai / gist:1411673
Created November 30, 2011 23:03
Check Andor iQ image orientation on images between set date range
import imagedisk
from datetime import datetime
id = imagedisk.iQImageDisk()
##print type(id[1091567616].getDateAndTimeObject())
date_min = datetime(2011, 3, 7)
date_max = datetime(2011, 3, 10)
no_flip_rotation = 0
@omsai
omsai / iQ filename fixer.py
Created December 1, 2011 16:40
Workaround for Andor iQ bug# 6028. Run this in the iQ Python IDE
import imagedisk
import logging
REPLACE_DOT_WITH_CHAR = '_' # Replace dot with underscore
LOG_FILENAME = 'iQ_filename_fixer.log'
id = imagedisk.iQImageDisk()
##logging.basicConfig(filename=LOG_FILENAME, level=logging.DEBUG)
logging.basicConfig(level=logging.DEBUG)
@omsai
omsai / zip_iQ_settings.py
Created December 1, 2011 20:39
Creates a zip file containing 'Kinetic Imaging' iQ settings folder and 'kiconfig.ini' configurations file
'''
Zip Andor iQ settings
Creates a zip file on the desktop containing:
- iQ settings folder
C:\Documents and Settings\All Users\Application Data\Kinetic Imaging\
C:\ProgramData\Kinetic Imaging\
- Configurations file
C:\Program Files\Andor Bioimaging\Common Files\kiconfig.ini
C:\Program Files (x86)\Andor Bioimaging\Common Files\kiconfig.ini
@omsai
omsai / generate_test_ROI_for_micropoint.py
Created December 2, 2011 00:03
Test Micropoint calibration with configurable pattern for e.g. 365nm objective
'''
Generate an Andor iQ .rgn file with a scalable and repositionable pattern of
FRAPPA points
'''
# User variables
SENSOR_SIZE = [512, 512]
CENTER = [255,255]
SIDE_LENGTH = 360
POINT_SPACING = 20
@omsai
omsai / lcd.py
Created January 23, 2012 08:00
Sparkfun LCD control
# -*- coding: utf-8 -*-
'''
Serial LCD control
Control Sparkfun LCD-10097 with DEV-09716
'''
from serial import Serial
from time import sleep
@omsai
omsai / image.py
Created January 28, 2012 07:25
Crop and resize using PIL
# Resizes images in current folder for vandanashourie.com
# Saves images into sub-folders:
# ./tabs-square <- 150x150 thumbnauls
# ./full <- 725x525 images
import os, sys
import Image
import math
@omsai
omsai / alc_shutter_toggle_until_open.py
Created February 20, 2012 22:52
Toggle safety shutter until open on Andor Laser Combiner
"""
Toggle safety shutter until open on Andor Laser Combiner
"""
from ctypes import windll, c_ulong, byref
from time import sleep, clock
import sys
class DeVaSys:
"""Microcontroller board in Combiner controlling laser safety interlocks
@omsai
omsai / LineMeasure.txt
Created March 9, 2012 00:55
ImageJ line profile signal length over time
/*
Calculate specimen width in pixels using a line profile
Requires:
- Single channel image stack
- Line profile drawn on image
Algorithm:
- Assumes a single signal level threashold
- Checks each line profile pixel intensity from the left for start
@omsai
omsai / gist:2029530
Created March 13, 2012 15:51
ImageJ macro - Stack Profile Plot
/*
Calculate specimen width in pixels using a line profile
Requires:
- Single channel image stack
- Line profile drawn on image
Output:
- Bitmap image stack of profile plots of original stack (not usable data!)
- Text file on desktop with numeric data with format:
@omsai
omsai / gist:2363047
Created April 11, 2012 22:01
Arduino UNO pulse counter
/*
Arduino UNO reads rising edge trigger pulses on pin 2 and displays counter on
Sparkfun SerLCD LCD-10097
Photo of setup: http://ompldr.org/vZGNlbA/photo.JPG
Pariksheet <p.nanda@andor.com> Mar 2012
*/