uc

University of Chicago

BSD Microscopy Core Facilities

mpe1

 

 

ImageJ image processing or measurement tasks can be packaged within macro text files to speed and automate analysis tasks. To use macro files, open them in ImageJ. They can be launched via the “Macros.” Run the Macro menu that appears at the top of the macro text window (in ImageJ). Some macros use keyboard keys to launch routines. Some prompt you to input source data. And some require the data to be open already and act on the current (active) window. The comments in the first few macro lines typically describe what you need and what it does.


NIH examples are found at this link:
http://rsb.info.nih.gov/ij/macros/
macro functions are described here:
http://rsb.info.nih.gov/ij/developer/macro/functions.html
general macro language syntax and examples are found:
http://rsb.info.nih.gov/ij/developer/macro/macros.html

For Basics: ImageJ Tutorial pdf file

The following links open the macros developed at the University of Chicago Light Microscopy Core Facility. Use your browser to “save as” from the link or open the link and copy the lines to a plain text file; save it.

3d counts and coloc2.txt Macro to select two files for 3D counts and colocalization. Input is Slidebook multipage tiff files. Requires installation of 3D_object_counter and colocalization plugins.

3D counts and coloc ROI v3.txt Macro to select two files for 3D counts and colocalization. Input is input is Slidebook multipage tiff. Requires installation of 3D_object_counter and colocalization plugins. F5 re-launced the ROI selector, F6 runs the main counting routine, F7 mercilessly closes all open image windows. BE SURE TO SAVE COUNTS RESULTS BEFORE ReRUNNING. Delete old ROI and add new if running many times. July 2006, Univ. of Chicago Light Microscopy Core, Vytas Bindokas.

3D count nuclei.txt Macro to count Dapi nuclei in confocal Z stack (16 bit). It reduces the image to the object centers then counts those by means of the 3D object counter plugin (required), and that takes care of merging overlapped objects. By Vytas Bindokas, Univ. of Chicago, April 2008.

Stack of images showing 3D nuclei count. 3-D nuclei (594).zip (17.9mb)

3D_FOCIcounts4ROIv1.txt Macro to perform 3D counts of nuclear foci. Input is a mutipage tiff. Requires installation of 3D_object_counter (newest version). F5 re-launced the ROI selector, F6 runs the main counting routine,F7 mercilessly closes all open image windows.BE SURE TO SAVE COUNTS RESULTS BEFORE ReRUNNNG. Delete old ROI and add new if running many times. Dec. 2006, Univ. of Chicago Light Microscopy Core, Vytas Bindokas.

4DMovieMakermv2.txt

4D MovieMaker v3rgb.txt

AB Batch measure GFPper nucleus from stk v4.txt Macro to add particle analyzer. Outlines to the ROI Manager and uses those ROI to perform within-object counts on other color channels. This counts green particles per nucleus defined by DAPI outlines. Macro asks for input STK file. ROI are numbered and overlaid on FITC image for documentation. Then save the RESULTS window 'save as' EXCEL works nicely. BE SURE TO CLOSE ALL IMAGE WINDOWS BEFORE reRunning. Modified 'RoiManagerAddParticles.txt' macro; balance by Vytas Bindokas, Univ. Chicago May '05. This is for 2-image stack, FITC then DAPI. Univ. of Chicago, Vytas Bindokas, May 06. Requires "1.35l"

AB measure GFPpernucleus from stk v2.txt This macro adds particle analyzer. Outlines to the ROI Manager and uses those ROI to perform within-object counts on other color channels. This counts green particles per nucleus defined by DAPI outlines macro asks for input STK file. ROI are numbered and overlaid on FITC images for documentation. Then save the RESULTS window data 'save as' EXCEL works nicely. BE SURE TO CLOSE ALL IMAGE WINDOWS BEFORE ReRUNNING modified 'RoiManagerAddParticles.txt' macro; balance by Vytas Bindokas, University of Chicago 2005 .This is for a 2-image stack, FITC then Dapi order. Requires "1.34k"

BATCHconvert16bit to 8bit.txt This macro opens a directory of tiff images and resaves each as 8-bit. Uninv. of Chicago, Vytas Bindokas, Jul'06. Requires ("1.35l").

BATCHconvert8bit to16bit.txt This macro opens a directory of tiff images and reseaves each as 16-bit. Unive. of Chicago, Vytas Bindokas, Jul'06. Requires ("1.35l")

batchConvert16-to-8bitDIR.txt

BATCHcount dapi+green from 2xobjective DSUexports.txt For data from DSU microscope and 2x objective ONLY. This macro splits out DAPI channel, adds particle analyzeer outlines and then counts the number opf green cells. Col,ored ROI are numbered and overlaid on images for documentation . Then save the RESULTS window data 'save as' EXCEL works nicely. Modified 'RoiManagerAddParticles.txt' macro; balance by Vytas Bindokas, Univ. of Chicago, May '05. This is for the RGB input images in a source direcory (selectable within macro run), Univ. Chicago, Vytas Bindokas, May'06.

BATCHcount dapi+green from 2Xobj DSUexportsGRNonly.txt For data from DSU microscope and 2x objective ONLY. This macro splits out DAPI channel, adds particle analyzer outlines and then counts the number of green cells. Colored ROI are numbered and overlaid on images for documentation. Then save the RESULTS window data 'save as' EXCEL works nicely. Modifed 'RoiManagerAddParticles.txt' macro; balance by Vytas Bindokas, Univ. of Chicago, May 2005. This is for RGB input images in a source directory (selectable within macro run), Univ of Chicago, Vytas Bindokas, May'06

BuildRatio_From2stks.txt Macro to make ratio from stk input selection for numerator and demoninator
showMessage("select numerator file").

count FISH Particles from RGB 2.txt This macro adds particle analyzer. Outlines to the ROI Managerand uses those ROi to perform within-object counts on other color channels. This counts green particles per nucleus defined by DAPI outines. First open the RGB image (one can use individual files opened in order R G B, too; comment out RGB line below). ROi are numbered and overlaid on RGB image for documentation. Then copy/all + paste into spreadsheet or save the LOG (or RESULTS) window data. Modifed 'RoiManagerAddParticles.txt' macro; balance by Vytas Bindokas, Univ. of Chicago, April 2005
requires("1.33k").

deHAZE..txt Macro to perform MetaMorph-like haze reduction based on adjacent 3-D data; V. Bindokas; UofChicago june'04.

flat fix v3.txt Macro to pseudo-flat-field correct images, taking grayscale stacks or var bit depths as input. Should be accuratefor intensity correction. By Vyts Bindokas, University of Chicago, April 2008.

flatten illum.txt Performs pseudo shading correction from blur=50.

graybalancetoROI.txt This macro white balances RGB to a selected region (equal R,G,B =gray). Draw a region prior to running the macro. Vytas Bindokas; Oct 2006, Univ. of Chicago.

manual measure in two images.txt Macro "manual measure in two images [F8]" {open the fitc and red stacks, rename them as "fitc" and "red", respectively. Draw an ROI on the fitc zymosan. Then hit F8 key to log both measurement results. Move the ROI and repeat F8 as needed; then copy results table. Vytas Bindokas, Apr 15'05.

measure particle details per nucleus This macro adds particle analyzer outlines to the ROI Managerand uses those ROi to perform within-object counts on other color channels. This counts green particles per nucleus defined by DAPI outines. Macro asks for input STK file. ROI are numbered and overlaid on fitc image for documentation.Then save the RESULTS window data 'save as' EXCEL works nicely. BE SURE TO CLOSE ALL IMAGE WINDOWS BEFORE ReRUNNING .Modifed 'RoiManagerAddParticles.txt' macro; balance by Vytas Bindokas, Univ. of Chicago, May 2005. This is for 2-image stack, FITC then dapi order, 12-bit
requires("1.34k");

paintoutRGB2white.txt This tool whites out a color range based on point selection. RGB only! (obviously). Vytas Bindokas, Univ. of Chicago, Dec. 2006.

pap Macro v1.txt Macro to measure PAP smears. Vytas Bindokas, Univ. of Chicago, Dec.,2006. inut is color image, converts to fluor-like image.

pH_ratioMacro".txt macro to calculate ratio of green/red per ROI from stack where slice1=green, 2=dic, 3=re.d Perform "install macros" under MACROS menu above, then Open stack (import image seq), draw background ROI, hit F12, Then F9 to process each ROI you draw; save log window results when done. ROImanager can show ROI via button; close manager and log before next runs. This uses separate thresholds on green and red extension of background subtraction macro originally by Michael Cammer 20030118. Mods by Vytas Bindokas, Univ. of Chicago, Nov.2006

renumberLEICA OKMacro.txt Macro to fix numbering scheme in Leica tif format/macro extracts "_tSEQ_" number and left-pads so files import right, good directory order. Sample name: voodoo_t97_z19_ch1.tif.
Rename: voodoo_t00097_z19_ch1.tif. Requires this string format; quits, if it's wrong. Default padding to 5 places. July'06 Vytas Bindokas, University of Chicago

Sarayu's Macro5.txt Macro to measure DNA and GFP per cell (SLidebook zseries inputs needed
by Vytas Bindokas, Univ. of Chicago, Aug 2006. must clear results table before rerunning!!!

spineCntMcro5.txt 3-D spine countiing macro for reflected light images of Golgi-stained neurons. Requires ImageJ plugins Gabrial Landini's binaryconnectivity and the 3D object counter(newest).This skeletonizes and finds branch points then counts them in 2D and 3D.Any spines exactly vertical will NOT be counted since the connectivity is only XY. But one would guess this is a rare case; skew spines should get counted with threshold set right.Vytas Bindokas, Dec 2006, Univ. of Chicago

stack2Leica-tifnames2.txt Macro to save every slice using Leica named tiff format.

unWMacro"".txt Macro to unwarp stack of tiffs, to correct for peristalic movement artifacts, etc. You need to press DONE button quickly in unwarp GUI to get it to run right. nS is the number of slices per volume, change before run. Run unwarp as accurate, very coarse, fine,0.1,0,0,3,.01 (set 1st pass).Requires download of B.I.G "unwarpJ" plugin (obviously). http://bigwww.epfl.ch/thevenaz/UnwarpJ/. This version for t-lapse, reset every nS to avoid over-wander.Macro by Vytas Bindokas, Univ. of Chicago, Sept 2006

Vesta's bugMacro v3.txt Macro to count red and green and colocalized objects in a two-slice tiff, assuming red is slice 1. F5 massages and counts red, green, and colocalized. F7 mercilessly closes all open image windows. Uses fixed threshold. Vytas Bindokas, University of Chicago Light Microscopy Core, July 2006

YK count nuclear particles from stk v4.txt This macro adds particle analyzer. Outlines to the ROI Managerand uses those ROi to perform within-object counts on other color channels. This counts green particles per nucleus defined by DAPI outines. First open the RGB image (one can use individual files opened in order R G B, too; comment out RGB line below). ROi are numbered and overlaid on RGB image, and spots in white, for documentation. Then copy/all + paste into spreadsheet or save the LOG (or RESULTS) window data . BE SURE TO CLOSE ALL IMAGE WINDOWS BEFORE ReRUNNING since macro uses image numbers 1-3. Modifed 'RoiManagerAddParticles.txt' macro; balance by Vytas Bindokas, Univ. of Chicago, April 2005
requires("1.34k").

Macro to white balance images:This macro white balances RGB to a selected region (equal R,G,B =gray)
( draw a region prior to running the macro)
// Vytas Bindokas; Oct 2006, Univ. of Chicago

 

 

 

Home | Map | Links | Contact Us | ©2006 University of Chicago BSD Microscopy Core Facilities