ImageJ Macros


Array Tools icon

The ImageJ macro language lacks many (or rather any) tools for handling arrays effectively; this is a collection of functions which aim to help fix this. Functions are provided for finding the minimum and maximum value of an array, appending and adding a value at an arbirary location, information about occurences of a value and printing of an array in a human-readable form.

Circle Finder icon

Circles are a notable class of feature in many images. This ImageJ macro provides a filter which assists in finding circles of a particular size (either hollow or filled) in an image. After filtering the centres of circles are bright spots.

Extended Depth of Field icon

Microscopes have an extremely narrow depth of field, with a 100x objective it may be as shallow as 1 micron. Unfortunately this makes capturing a 2D image of a 3D object at high magnification tricky! This macro is a basic example of an image stack focuser, it takes a stack of images from a range of focal depths and builds a 2D image from it using only in focus regions of the images, i.e. it generates an extended depth of field.

General K-Means Clustering icon

K-Means clustering is a simple, fast and relatively reliable method of clustering data into a predefined number of groups. An example would be the clustering of cells into classes according to signal in multiple fluorescent channels. This is an implimentation of k-means clustering to n clusters in n dimensions (ie. an arbitary number of data series) and returns an estimate of the reliability of assignment for each data point. The first 45 lines of code contain a demonstration of the k-means algorithm, the remainder of the document contains the k-means clustering function itself and the various array functions it uses.

Intelligent Resize icon

Normal resizing of an image to anything but the original aspect ratio introduces distortion. This is an implementation of a classic method of "intelligent" resizing which takes into account the structures in the image and tries to conserve them when scaling up or down.

Paper Camera icon

A faux-sketch style of image, popularised by smartphone apps such as "Paper Camera", are actually a very simple set of image processing steps. By adding dark edges based on an edge detection, posterising the image brightness and subtly desaturating the colours the hand-sketched image style can be made.

Point Selection Tools icon

ImageJ has the capacity to make multi point selections, but has limited abilities when it comes to managing those selections. This set of macros provides three simple tools for altering the current point selection by reversing the order or shifting the order of the point selection.

RGB GammaLUT icon

Gamma correction is a powerful tool for altering the display of images to emphasise light and dark details in a quantitative and controllable way. This ImageJ macro provides a tool for generating a gamma corrected look up table for displaying greyscale data with an altered gamma.

SEM Colouriser icon

Scanning electron microscope images look amazing but the simple greyscale look can get dull. This macro provides a method for automatically recolouring an SEM image, based on the image structure, to give it some colour.

I am very happy for my code to be used in open source projects, just contact me to get permission. I believe all my scripts and macros are safe to use, but I can accept no liability for loss or damage of hardware or data due to their use.