ImageJ Macros - Scripted Image Processing

Introduction

These notes are intended as an introduction to effective use of ImageJ, a mature image-processing platform created by the National Institute of Health (NIH).

There are many excellent ImageJ tutorials and resources available online. Notable examples include:

  1. The official ImageJ site tutorials and examples: http://rsbweb.nih.gov/ij/docs/index.html
  2. EMBL/CMCI ImageJ resources (inc. textbook): http://cmci.embl.de/documents/ijcourses
  3. CNRS MRI ImageJ workshop: http://dev.mri.cnrs.fr/wiki/imagej-workshop
  4. Goettingen Astrophysics ImageJ tutorial/book: http://www.astro.physik.uni-goettingen.de/~hessman/ImageJ/Book/

Whilst having been initiated for the medical and biological sciences, ImageJ, because of it’s extensible nature and large variety of plugins is now used in many disciplines requiring image processing.

Prerequisites

Required

You should already be familiar with the ImageJ User Interface, including

  • How to open an image file
  • How to manipulate the image using the toolbar

Desired

In addition, you should ideally

  • Have some knowledge of how to record a macro using the ImageJ toolbar
  • Understand basic programming concepts, such as
    • what a variable is
    • the difference between a variable, and eg a string (aka string literal), an integer

Advanced

If you also know about

  • what a function is
  • control flow contructs such as
    • if … else
    • for loop
  • a scripting language such as Javascript or Python

then this course should be a breeze, and simply a case of learning and practicing how to use the ImageJ specific functions to create useful image processing pipelines.

Projected Progress

The attendees of this course will losely fall into three categories outlined in the previous section, namely those with the

  1. minimal required background knowledge
  2. minimal and desired background knowlege
  3. minimal, desired, and advanced background knowledge

Accordingly, at the end of these sessions you can expect to

    • Know how to record a macro to create a reproducible workflow
    • Be able to make small changes to the recorded macro
    • Also be able to make moderate changes to the recorded macro
    • Write your own simple macros from scratch
    • Write rich and complex macros from scratch

Working on your own data

A core component of this workshop is the idea that you would be able to practice what you’ve learned with help at hand.

During each session, after you have completed the exercises scheduled for that session you are invited to work on your own data on tasks relevant to your research. We will be at hand to help you out when you get stuck!

Printing the notes

For both environmental reasons and to ensure that you have the most up-to-date version, we recommend that you work from the online version of these notes.

A printable, single page version of these notes is available here.

Errata

Please email any typos, mistakes, broken links or other suggestions to j.metz@exeter.ac.uk.

Installing

If you want to use imagej on your own computer I would recomend using Fiji which can be downloaded from

http://fiji.sc/Fiji

Fiji is ImageJ with additional functionality and bundled plugins.

Alternatively standard ImageJ can be downloaded from

http://imagej.nih.gov/ij/download.html