MCM 2019
14th Multinational Congress on Microscopy

September 15-20, 2019 in Belgrade, Serbia

Days
Hours
Minutes
Seconds

ImageJ and Fiji for Microscopy: Install, Set Scale, Measure and Count

· 8 min read

ImageJ is the free, open-source standard for analyzing microscope images, and Fiji is the ready-to-use ImageJ package most labs install today. This guide shows how to install Fiji, set the scale from a scale bar, measure length and area, count cells or particles with thresholding and keep your raw data intact.

What ImageJ is and why microscopists still use it

ImageJ is a free, open-source image processing program written in Java. It was created by Wayne Rasband at the US National Institutes of Health as the successor to NIH Image, and the original program is in the public domain. Because it runs on Windows, macOS and Linux and costs nothing, it has become the common language of image analysis in biology, materials science and electron microscopy labs.

The strength of ImageJ is not a polished interface but its extensibility. Thousands of plugins and macros add functions such as cell counting, colocalization, particle sizing and 3D rendering. A measurement made in ImageJ can be repeated by anyone, anywhere, which matters when results have to be reproduced or reviewed.

ImageJ vs Fiji vs ImageJ2: which one to download

Beginners often search for ImageJ Fiji as if it were one product. They are closely related, but not identical.

OptionWhat it isBest for
ImageJ (ImageJ 1.x)The original lightweight program with core menus and macro languageOld computers, quick measurements, teaching basic concepts
ImageJ2A rewrite of the core with a new data model, backward compatible with ImageJ 1.x pluginsDevelopers and large, multidimensional datasets
FijiA distribution of ImageJ2 bundled with Java, many preinstalled plugins and an updaterMost microscopy users, especially with proprietary file formats

For microscopy, Fiji is the sensible default. It includes Bio-Formats, which opens many proprietary formats from confocal, widefield and electron microscopes (for example .czi, .lif, .nd2 and many TIFF variants) and reads the pixel size stored in the file metadata. That one feature saves you from many calibration mistakes.

ImageJ Fiji download and installation, step by step

Fiji is a portable application, so there is no classic installer. You download an archive, unpack it and run it.

  1. Open the official Fiji downloads page and choose Fiji Latest for your system (Windows, macOS or Linux, including ARM builds). Choose Fiji Stable only if you need Java 8, an older operating system or old plugins.
  2. Unpack the archive into a folder in your user space, for example C:\Users\yourname\Fiji. On Windows, avoid Program Files: the system may deny write access and the updater will fail.
  3. Start Fiji with the launcher in the unpacked folder. On macOS you may need to confirm that you want to open an app downloaded from the internet.
  4. Run Help > Update... once. The updater fetches fixes and lets you enable additional update sites with extra plugins.
  5. Restart Fiji after updating, then open a test image from File > Open Samples to check that everything works.

Current Fiji Latest builds require Windows 10 or later, macOS 11 or later or a recent Ubuntu release. There are also browser-based ways to run ImageJ, which people find by searching ImageJ online, but for real data the desktop version is faster and keeps your files on your own machine.

Setting the scale: how to calibrate ImageJ from a scale bar

Every length or area you measure is only as good as your calibration. First check Image > Properties: if the file came straight from the microscope and was opened with Bio-Formats, the pixel width and height are often already correct. If the image is a screenshot, a JPEG export or an image with a burned-in scale bar, calibrate it manually.

  1. Select the Straight line tool and draw a line exactly along the scale bar. Zoom in so the line starts and ends at the bar edges; hold Shift to keep it horizontal.
  2. Open Analyze > Set Scale.... The field Distance in pixels is filled from your line.
  3. Enter the bar value in Known distance and the unit in Unit of length. Typing um is displayed as µm.
  4. Leave Pixel aspect ratio at 1.0 unless your pixels are not square.
  5. Tick Global only if every image in the session has the same magnification; otherwise calibrate each image separately.

The scale is now shown in the image window title bar. To put a clean bar back on an exported figure, use Analyze > Tools > Scale Bar..., which is what people mean by "ImageJ how to add scale bar".

Calibrate from metadata whenever you can. A scale bar measured by hand usually spans only a few hundred pixels, so an error of two or three pixels in where you click becomes a systematic error in every length and area that follows.

How to measure length and area in ImageJ

Choose what gets measured

Before measuring, open Analyze > Set Measurements... and tick what you need: Area, Mean gray value, Perimeter, Feret's diameter, Shape descriptors or Integrated density. Tick Display label so each row in the results table shows which image it came from.

Lengths

Draw a straight, segmented or freehand line and press Ctrl+M (Cmd+M on macOS) or choose Analyze > Measure. The Length column appears in calibrated units. For many lines on one image, add each one to the ROI Manager with the T key and measure them all at once.

Areas

Use the rectangle, oval, polygon or freehand selection tool, outline the object and measure. For irregular objects with clear contrast, the wand tool selects a connected region with one click. Selections stored in the ROI Manager can be saved and reopened, which documents exactly what you measured.

Thresholding and particle analysis: count cells and particles

Counting nuclei, pores or nanoparticles by hand is slow and subjective. ImageJ can do it with a threshold and Analyze Particles.

  1. Duplicate the image (Image > Duplicate...) and work on the copy. For a color image, split the channels or convert to 8-bit.
  2. If the background is uneven, use Process > Subtract Background... on the copy.
  3. Open Image > Adjust > Threshold... (Ctrl+Shift+T), try the automatic methods such as Default, Otsu or Triangle, and pick the one that matches your objects. Click Apply to create a binary mask.
  4. Separate touching objects with Process > Binary > Watershed if they are roughly round.
  5. Run Analyze > Analyze Particles.... Set a Size range to ignore noise, a Circularity range (0 is a line, 1 is a perfect circle), tick Exclude on edges, Summarize and choose Show: Outlines to check the result visually.

The Summary table gives the count, total area, average size and area fraction. Always compare the outlines with the original image: a threshold that looks fine on one field of view may split or merge objects on another.

Quick reference for common tasks

TaskMenu pathShortcut or tip
Set scaleAnalyze > Set Scale...Draw a line on the scale bar first
Measure selectionAnalyze > MeasureCtrl+M
Choose parametersAnalyze > Set Measurements...Tick Display label
ThresholdImage > Adjust > Threshold...Ctrl+Shift+T
Count particlesAnalyze > Analyze Particles...Use Exclude on edges
Add scale barAnalyze > Tools > Scale Bar...Use on a copy for figures
Record a macroPlugins > Macros > Record...Repeat the same steps on every image

Measuring fluorescence intensity without fooling yourself

Intensity measurements are where most ImageJ mistakes happen. Gray values only mean something if the images were acquired with the same settings and have not been altered. Keep these rules:

  • Measure raw data. Open the original microscope file or an uncompressed TIFF, never a JPEG or a figure exported from presentation software.
  • Brightness/Contrast is for viewing. Adjusting the display does not change pixel values, but clicking Apply does. Do not apply it before measuring.
  • Use Integrated density with background. Measure the cell and a nearby background area; a common approach subtracts the background mean multiplied by the cell area from the integrated density.
  • Watch for saturation. Pixels at the maximum value (255 in 8-bit, 4095 in 12-bit, 65535 in 16-bit) cannot be quantified.
  • Save processed results separately. Keep originals read-only and save masks and ROIs next to them.

Many intensity problems start at acquisition, not in software. Our guide to fluorescence microscopy filters and common pitfalls covers bleed-through and photobleaching, and for electron images see how SEM images are made and read.

Making your analysis reproducible

A single macro is worth more than a long description in a methods section. Turn on Plugins > Macros > Record..., perform the analysis once, copy the recorded commands into a new macro and run it on every image with Process > Batch > Macro.... Note the Fiji version and the plugins you used, and cite ImageJ and Fiji in publications using the references recommended on their official websites.

Conclusion

ImageJ, and Fiji in particular, gives you a complete free toolkit for microscopy image analysis: install it in your user folder, calibrate from metadata or a carefully measured scale bar, threshold on a duplicate, check every particle outline and keep raw data untouched. Once those habits are in place, recording a macro turns a one-off measurement into a method anyone in your lab can repeat.

Frequently asked questions

Is ImageJ free?

Yes. ImageJ is free and open source, and the original ImageJ 1.x program is in the public domain. Fiji, the most popular distribution, is also free and open source.

What is the difference between ImageJ and Fiji?

Fiji is ImageJ bundled with Java, an updater and many preinstalled plugins such as Bio-Formats. Plain ImageJ is smaller but you have to add plugins yourself.

How do I measure length in ImageJ?

Set the scale with Analyze > Set Scale, draw a line with the straight line tool and press Ctrl+M. The length appears in the Results table in calibrated units.

How do I add a scale bar in ImageJ?

Calibrate the image first, then choose Analyze > Tools > Scale Bar and set the width, unit, position and color. Add it to a copy so the original stays unchanged.

How do I count cells in ImageJ?

Convert a duplicate to 8-bit, apply a threshold, separate touching nuclei with Watershed and run Analyze Particles with Summarize ticked. Check the outlines against the original image.

Can I use ImageJ online without installing it?

Browser-based versions exist and are fine for quick tests, but the desktop Fiji is faster, supports more plugins and keeps your data on your computer.