Skip to content

Instantly share code, notes, and snippets.

View ackman678's full-sized avatar

James Ackman ackman678

View GitHub Profile
@ackman678
ackman678 / SingleCitationMatcher.scpt
Last active December 18, 2015 17:18
A simple applescript to fetch a bibliographic citation (using author, journal title, year) from pubmed.
display dialog "PubMed single citation matcher" & return & return & ¬
"Authors last name:" default answer "Kaas"
set author to the text returned of the result
display dialog "Journal Title: (Type a \" + \" in place of any spaces)" default answer "trends+neurosci"
set journal to the text returned of the result
display dialog "Publication date:" default answer "1995"
set yeartext to the text returned of the result
@ackman678
ackman678 / Scale bar maker.scpt
Last active December 18, 2015 17:18
This applescript can be used to automatically draw on microscopic images in Adobe Photoshop as a new layer. This hasn't been tested in several years, but it depended on tiffutil to read the voxel-width from the tiff header in Leica confocal microscope files. TODO: Update and combine with the loci_tools.jar from OME project to make this more flex…
--Wednesday, May 4, 2005 6:27 PM
--Select and open the image in the frontmost Finder window in Photoshop from which the Voxel-Width data can be obtained before proceeding performing the scale bar calculation. Must use Photoshop CS or Photoshop 7.0. Must change instances of "Photoshop CS" to "Photoshop 7.0" in this script and vice versa depending on which version you are using.
tell application "Finder"
set this_file to ((the selection) as alias)
set newPath to quoted form of POSIX path of this_file
end tell
tell application "Adobe Photoshop CS6"
try
open this_file showing dialogs never
@ackman678
ackman678 / pyMakeMarkdownTable.py
Last active November 8, 2018 19:23
Convert a space delimited table on the system clipboard into markdown table, such as when copying tabular results from matlab or a spreadsheet or R command line. Written to use macos shell cmd pbpaste. But should be reworked to use xclip or similar as an option for linux. This script is most enjoyable when combined with a os wide shortcut, such …
#! /usr/bin/env python
#pyMakeMarkdownTable.py
#Created by James B. Ackman 4/9/2013
'''
A script to format a space or tab delimited table on the clipboard into a markdown formatted table onto the clipboard
'''
#import os, sys, re
#import urllib2
import os, subprocess, re
@ackman678
ackman678 / pyMencoder.py
Last active December 18, 2015 16:49
A python script to utilizing imagemagick and mencoder to convert subfolders of tiff sequences into avi movies. Requires that Imagemagick and mencoder are installed, and in the Windows system search path
#! /usr/bin/env python
#pyMencoder
#a script to utilizing imagemagick and mencoder to convert subfolders of tiff sequences into avi movies. Requires that Imagemagick and mencoder are installed, and in the Windows system search path
#James Ackman March 3, 2010
import os, sys, glob, re, subprocess
#edit the following line for the location of the ImageMagick convert program. This is mainly for Windows where a identically named system tool for converting FAT32 to NTFS is located at c:\Windows\system32\convert.exe and can cause issues, even if ImageMagick directory is located first in your system path.
IMconvert = 'C:\Program Files\ImageMagick-6.6.0-Q16\convert.exe'
#use following several lines with a loop through dirlist for recursive renaming of files
@ackman678
ackman678 / BatchStackreg.txt
Last active December 18, 2015 16:49
An ImageJ macro that performs image registration using the [StackReg](http://bigwww.epfl.ch/thevenaz/stackreg/) plugin on all the TIFF movies in a folder.
// "BatchStackreg" by James Ackman June 7, 2007
//
// This macro batch processes all the files in a folder and any
// subfolders in that folder. In this example, it runs the Stackreg plugin for automatic
// image registration of multipageTIFF files. Stackreg plugin must be installed.
// For other kinds of processing, edit the processFile() function at the end of this macro.
// Based on the BatchProcessFolders.txt macro on the ImageJ website.
requires("1.33s");
dir = getDirectory("Choose a Directory ");
@ackman678
ackman678 / pyPrairieTiffXMLparams.py
Created May 13, 2013 16:25
A script to obtain acquisition parameters from [OME XML](http://www.openmicroscopy.org/site/support/ome-model/) files created by Prairie View. Prairie View is a microscope acquisition software for multiphoton microscopes by [Prairie Technologies](http://www.prairie-technologies.com/products/photon/Ultima.html).
#! /usr/bin/env python
#pyPrairieTiffXMLparams.py
#Created by James B. Ackman 4/1/2011
'''
A tool to obtain relevant experimental parameters from a Prairie View (microscope acquisition program from Prairie Technologies)
formatted XML file contained with folders of Prairie View acquired TIFFs. Output is to stdout as well as a log file in the users python home directory.
'''
import os, sys, wx
from xml.dom import minidom