Macros Distributed with NIH Image

This is a list of the macros distributed with NIH Image in the Macros folder. Additional macros can be found in the User Macros folder on the NIH Image Web page.


Add Slice [A]
Delete Slice [D]
First Slice [F]
Last Slice [L]
Smooth [a stack]
Invert [a stack]
Make Surface Plot Movie
Make Expression Movie [E]
Animate Stack

Cell Scoring Macros

Reset Cell Counts
Score Unlabeled Cell [1]
Score Labeled Cell [2]


Color Merge Two Images
Enhance Contrast [of RGB stack]
RGB to 8-Bit Color
8-Bit Color to RGB
8-Bit Color to Grayscale
Sort LUT by Hue

Corpus Collosum Macros

Zoom Window [Z]
Draw Perpendicular Lines-Left [S]
Draw Perpendicular Lines-Right [R]
Draw Arbitrary Perpendicular Line [A]
Make Binary [B]
Make Grayscale [G]

Demo Macro

Demo Macro [D]
Make Wallpaper [M]

Editing Macros

Show Tools [T]
Draw Arrow [A]
Clear Outside [C]
Change Colors
Change Values
Fix Pseudocolors
Remove Isolated Black Lines
Make Mosaic
Draw Grid
Make 256x256 Selection [S]
Position fixed size ROI
Flip ROI Horizontally
Make Circle [M]
Make Circle from Line
Define Upper Left [1]
Define Lower Right and Create ROI [2]
Draw File Name in each Image

FFT Macros

Abitrary Selection FFT [A]
Inverse FFT [I]
Inverse FFT with Custom Mask [M]
Inverse FFT with Filter
High Pass Filter [H]
Low Pass Filter [L]
Toggle Filter Plotting [T]
Autocorrelation with Padding
Correlate Two Images
Make Filter
Swap Quadrants
Create 32 x 32 selection [1]
Create 64 x 64 selection [2]
Create 128 x 128 selection [3]
Create 256 x 256 selection [4]
Create 512 x 512 selection [5]
Black Annular Selection - Pass [B]
White Annular Selection - Notch [W]


Unsharp Mask
Make Bas-relief
Normalize to 0 to 255
Subtract Background
Make Variance Image
Find Variance [V]
Impulse Filter
3x3 Sharpen [F]
5x5 Laplace
7x7 Gauss
13x13 Hat - scaled
13x13 Hat - clipped
Unweighted Smoothing
Grayscale Erosion
Grayscale Dilation
Shadow Demo
Fractal Dilation

Smooth [1]
Smooth More [2]
Sharpen [3]
Sharpen More [4]
Sobel [5]
Trace Edges [6]
Median [7]
Dither [8]

5x5 [hat]
7x7 [hat]
9x9 [hat]

Fun and Games

Random Ovals
Draw Ball
Speckle Paint [S]
Random Color Boxes
Random LUT Colors [C]

Gel Plotting Macros

Mark First Lane [1]
Mark Next Lane [2]
Plot Lanes [3]

Image Macros

Measure [1]
Show Results [2]
Reset [3]
Copy Results [4]
Start Capture [G]
Draw Arrow [A]
Print All
Make Step Function

Image Math

Add Constant - 8-bit result
Add Constant - real result
Multiply by Constant - 8-bit result
Multiply by Constant - real result

Add Two Stacks
Subtract Two Stacks
Multiply Two Stacks
Divide Two Stacks
AND Two Stacks
OR Two Stacks
Max of Two Stacks
Min of Two Stacks

Absolute Difference
Real Processing Example

Input/Output Macros

Save using Time as Name
Open with selection
Save All
Import FITS
Display FITS Header
Import Image TIFF File
Import Multiple Images per File
Import 3D PET
Convert Files
Import IPLab File
Import Biorad MRC 600 Z Series
Import from IBAS
Import 64x64x64x16-bit SPECT Image
Import 8-bit 3D Image
Open with scale set to 100 pixels/mm
Load Synergy Image
Import Siemens 3D MRI
Import LUT
Open List of Files
File processing test
Batch Processing Example
Export Non-Rectangular ROI
Import MCID
Import Series of Files
File Paths Demo
Open Files From List

Line Plot->Data

Convert Line Plot to Points [C]
Plot Points [P]
Clear Outside [O]

LUT Macros

Export LUT [E]
Import Text LUT
Invert LUT [I]
Log Tranform
Gamma Tranform [G]
Square Transform
Parabolic Transform
Square Root Tranform
Reset LUT [R]
Plot LUT [P]
Make Four Ramp LUT
Set Pixels Red
Nearly Gray LUT
Color Merge Two Images
Move Slice Up
Move Slice Down
Change One LUT Entry
Sort LUT by Hue
Copy Calibration to LUT

Markup Macros

Setup Image for Markup [S]
Extract Graphics [E]

Measurement Macros

Display Calibration Table
Measure and draw line [L]
Measure and Outline [M]
Measure All
Measure All from Disk
Paste Results
Measure Redirected and Label
Reset Measurement Options
Set Threshold
Measure Accumulated Perimeter[A]
Count Black and White Pixels [B]
Compute Percent Black and White
Compute Area Percentage [P]
Compute Average and Total Area [T]
Measure Circularity
Measure Sum of Pixel Values
Draw XY Center
Compute Spatial Scale
Store Break in Results [S]
Measure both Raw and Calibrated
Mark Centers
Density Slice [D]
Set Scale and Aspect Ratio
Write Results to Text Window
Find Radial Distances
Copy Results to Clipboard with Headers
Export Results with Headers
Feret Dimensions [F]
Bounding Rectangle
Calculate Alternate Mean [C]

More Macros

Fast Invert
Slow Invert
Real Slow Invert'

Show Status [S]
Draw Vertical Calibration Bar
Hex Dump
Scale and Rotate All
Dispose All
Average two Images
Make Montage [M]
Make Sine Wave
Beep if No Selection [B]
Exponention Demo
Convert Number to String Test
Compute N Factorial

Copy Mode[1]
AND Mode[2]
OR Mode [3]
XOR Mode[4]
Terminate Paste [7]

Movie Making

Make Movie to Disk
Capture Averaged to Stack
Make Movie and Plot Intervals [M]
Frame Rate vs. Frame Size
Projection Example

Average of Stack
Running Average of Stack
De-interlace Stack
Add Timestamps to Stack

Markup Macros

Setup Image for Markup [S]
Extract Graphics [E]

MRI Macros

Import GE Signa Files

Sagitals to Axials
Coronals to Sagitals
Coronals to Axials
Axials to Coronals
Axials to Sagitals

Flip Vertical
Flip Horizontal

Particle Analysis

Particle Analysis Test
Count Particles at Random Locations
Analyze Particles and Compute Sum

PidNumber Demo

Create some images
SelectPic [B]
Draw PicNumber and PidNumber in each image [C]
Dispose of the front image [D]
Dispose All [E]
This is my favorite image [F]
Try to find my favorite image by PicNumber [G]
Try to find my favorite image by PidNumber [H]
Try to find my favorite image by window title [I]
Pick an image, any image [P]
Erase all Images [Q]

Plotting Macros

Plot Histogram
Stack Histogram
Plot Histogram Using Bins
Plot XY Coordinates [X]
Plot Profile
Plot Integrated Profile
Plot Profile and Display Values
Plot Radial ProfilesÉ [R]
Radial Intensity Distibution
Circular Profile Plot [C]
Export Profile Plots
Plot Z-Axis Profile [Z]
Plot XYZ
Draw Fitted Ellipse in White
Draw Calibration Bar [B]
Show Polar Coordiates [P]
Record XY [X]
Write Real Test
Make Image Correlation Plot

ROI Macros

Gray level wand tool [W]
Fill Selection, Erase Background

Serial I/O

Open Serial Port [O]
Put Serial [P]
Serial Output Test [T]
Get Serial and Echo [G]
Capture Serial Input [C]
Display Serial Input
Test Newport Motion ControllerÉ[N]


Add Slice [A]
Delete Slice [D]
First Slice [F]
Last Slice [L]
Select Slice [S]

Reduce Noise
Apply LUT
Fix Colors
Subtract Background
Crop and Scale-Fast
Crop and Scale-Smooth
Rotate Left
Rotate Right
Flip Vertical
Flip Horizontal
Delete Even Slices
Replicate Slices
Merge Two Stacks
Average Two Stacks
Concatenate Two Stacks

Save Slices as files
Windows to Stack
Stack to Windows
Make Cone
Reslice Horizontally
Reslice Vertically


Print Video using TV-3
Extract Even Field->New Window
Extract Even Field->Same Window
Camera and Light Source Test
Average Frames [F]
Average Frames on Trigger
Dynamic 1-D Plot
Integrate Inverted
Acquire AV Video [V]
Acquire AV with Calibration
Correct Aspect Ratio
Capture with "Live" Histogram
Set Offset and gain

Integrate Using AG-5 [5]
Integrate On-chip Using Cohu [C]

Paste Live [L]
Paste Averaged [A]
Paste Live OR [O]
Add Duplicate Slice [D]

SetChannel 1 [1]
SetChannel 2 [2]
SetChannel 3 [3]
SetChannel 4 [4]

Generate Pulse Train
Set LG-3 DAC A
Set Set LG-3 Data Out
Read LG-3 Data In

[NIH Image Home Page]