This site contains the complete version of the Fiji Training Manual that is written and maintained by Cameron Nowell of the Monash Institue of Pharmaceutical Science.
This manual is provided under the CC BY 4.0 licence. You are free to use and adapt it as required providing approriate credit is given to the original authors.
To facilitate this each chapter is avaible as a Google Doc, PDF or online web format to make sharing and editing easier for end users. Links to the required demonstration images are provided in each chapter. Alternatively the complete set can be access here.
The complete manual (in PDF format) and additonal resources can be accessed here - manual - resources.
Fiji is a distribution of the free, open source image analysis package ImageJ, Fiji stands for Fiji Is Just ImageJ. Fiji comes with a large collection of plugins already installed. It also has a built-in auto update system to make sure you always have the current versions of the plugins. Fiji has a biology slant to most of the plugins provided but they can be used for analysis of a range of samples.
It is sometimes essential to alter the brightness and contrast of an image to make it better for publishing or highlighting an area of interest. Adjusting the balance of an image needs to be done carefully so as not to remove or add data that was not in the original image. To this end it is usually safe to adjust linear parameters such as brightness and contrast (histogram levels) as long as under and over saturation is avoided. Adjusting non-linear parameters such as gamma and curves is generally discouraged as it will change the relationship of the data in a given image. For example, adjusting gamma can result in the dark values of an image not changing very much but the bright values being greatly increased.
For proper presentation of images (either in a presentation or a publication) it is vitally important that they contain a scale bar. This allows the reader/viewer to see the scale of the image being presented and make their own conclusions about the data. Calibrating an image is also important if you want to get meaningful area/distance etc. measurements out of the image in any later analysis.
Fluorescence experiments are almost always captured on highly sensitive monochrome cameras in 12, 14 or 16bit. This means that each fluorophore is captured as a different image with no associated colour and usually cannot be opened in the standard images viewers built into Windows, OS X or Linux. Some default viewers will display 16bit images if they are using the full range of intensities but will not assign any wavelength specific or custom look up tables (LUTs).
To make the data more presentable it is usually a good idea to add colour to each channel (usually in the colour of the fluorophores emission) and to create composite images of 2 or more of the channels combined.
When merging fluorescent images, you need to be aware that they could appear very strange to someone with colour blindness. Fiji can simulate what your image will look like to someone with colour blindness.
Fiji, through use of the LOCI (Laboratory for Optical and Computational Instrumentation) tools plugin Bio-Formats can open a large range of image formats. Over recent years this ability has been steadily improved to a point where pretty much any microscope format can be easily opened using this plugin.
Data that is captured on a confocal microscope or live imaging system can be represented in several ways that can best address the question being asked. For confocal data there are several ways of showing the 3D data that is captured and for live data the easiest way to represent it is to create a montage or a movie of the time series.
Other options are movies to play in presentations or kymograms to visualise movement of objects in a 2D image,
Counting fluorescently (or clearly defined brightfield) stained cells is a relatively easy process in Fiji. Information such as shape, area, intensity etc. can also be extracted on top of just a raw count number.
This example uses just a nuclear stain (like DAPI) to count the number of cells. A later chapter will show how to segment out individual whole cells and measure them.
This chapter will show how to carry out both 2D and 3D analysis. Note that 3D analysis is not super user friendly in Fiji and will require a reasonable amount of computer resources to carry out.
Segmentation of cells is creating masks the represent their shapes based on whole cell dyes, and sometimes nuclear dyes. These masks can be used to analyse morphology parameters such as area, shape etc. The masks can also be overlayed onto other channels of the image to measure intensities or other parameters.
By combining several parameters you can generate outputs that can provide insight into what is happening to your sample beyond what the base measurements will show. In this example we will use the ratio of the perimeter of a cell to its convex hull to represent the complexity or “spikiness” of the cell. If the convex hull and perimeter are the same value, the ratio will be 1 and would represent a smooth cell. As the cell becomes more complex or spiky the ratio between the two deviates more and more. Additionally several intensities measures (Standard deviation, Skewness and Kurtosis) will be measured to look at changes in actin staining. In the advanced module of this manual there is a section on automating this process to batch analyse multiple cells.
Live imaging can provide a wealth of information that cannot be achieved form fixed samples alone. In this technical note you will be shown how to measure intensity spikes in a calcium flux experiment and to measure the contractility of some live tissue but the principals demonstrated can be applied to any time series analysis.
Time-lapse capture and analysis of wound assays can provide much more information than a simple end point readout. It can provide information about the dynamics of the wound closure over time. Due to the compromises that have to be made when capturing live cells (low light intensities, short exposures etc.) the quality of the images for analysis are usually never as good as a fixed sample. Because of this several extra filtering steps need to be incorporated in the analysis to extract the area of interest for analysis.
This technical note is a useful demonstration in the use of image filters (background subtraction, binary open etc.) in making an image amiable to analysis
This technical note will show you how to measure the average distance between objects, in this case nuclei. Euclidean distance is a simple measurement that uses intensity as a measure of distance. Individual objects are created as binary objects. A single intensity unit is added for each pixel away from the original object.
This technique can be used to measure the distance between two separate stains. For example, the distance vessels are in a tissue from hypoxic regions.
A further method of measuring and showing distance distributions it to use nearest neighbour distances. This shows the distance to the closest object from each object in the image.
This technical note will show you how to create a binary skeleton of a binary mask. This technique is useful for measuring the length of rod shaped, or long skinny, objects such as bacteria, mitochondria or nanoparticles. It can also be used to measure the number of branches in a networked structure.
There are some situations where you need to capture a large field of view but do not want to sacrifice resolution by using a low powered objective. Some microscopes have the ability to automatically create montage images by controlling the stage but if you only have a manual stage there is are two plugins in Fiji to either manually or automatically create a montage from pictures you capture.
When taking large confocal stacks of unstable specimens it is possible for the sample to move and result in slices that do not align. This can be corrected with a plugin found in Fiji.
It is also possible to apply these methods to serial sections from either histology or transmission electron microscopy. Additionally is can be used to correct drift in a live imaging data set as well.
Fiji contains a very powerful trainable segmentation tool called Trainable Weka Segmentation. This tools works by training the module to recognise the difference in a given image by looking at a range of parameters (colour, texture, edges etc.)
This can be a very powerful tool in analysing images, such as H and E stains or TEM images, to detect differences in tissue/cell/organelle type distributions.
Alternative, and more user friendly, options existing within fiji via additional plugins such ans LabKit. Alternatively other standalone software such as Ilastik (www.ilastik.org) can be more flexible and the resulting trained models can be fed into Fiji.
This section of the manual will show various examples of macro programing or scripting for Fiji. This examples only use the macro programing language of ImageJ which is essentially a derivative of Java. The Fiji scripting tool can be used to write code in other languages for use in Fiji such as Ruby, Clojure and Python.
The examples in this section start very simply by just recording steps in the macro recorder and progress to more advanced concepts such as batch processing, custom variables, data logging and looping.
The examples in this section are not an exhaustive list but should give a grounding in the basic concepts required to be able to write simple code. When developing your own code it is always best to have a solid understanding of what you are trying to automate before leaping in to coding it up. With that in mind the examples in this section are based around the manual tasks performed in the earlier part of the manual.
The end of each chapter contains the complete code of each script.
The macro language in ImageJ/Fiji has many commands and functions. Th evast majority can be found using this link.
http://rsbweb.nih.gov/ij/developer/macro/functions.html
NOTE: Functions are added and removed as Fiji and ImageJ are updated. Also note that there are some functions that are not documented and are only discovered by asking in the image.sc forums or searching the web.
The simplest way to setup a macro in Fiji is to record the steps using the macro recorder. This can work for a simple macro but will not give a macro that is functional for multiple images. The macro recorder can be used for developing advanced macros and plug-ins to find which commands to use as they are not always intuitive or follow the same syntax.
This technical note will show you how to record simple macros to measure the area of a thresholded stain and count the cells in an image.
In the previous technical note two macros were created by recording the steps of the functions applied to them. These macros could then be applied to any image as all the modifications and measurements were performed on the originally opened image.
If you need to perform functions on multiple images, or create copies/variations of the originals the only way this can be achieved is to write actual macro code (that can be copied and modified from the macro recorder if required) and assign custom variables.
In this technical note we will write a macro to merge fluorescent and DIC images together. This will require the use of some user prompts and variables as Fiji will need to be told which images to work with.
We will also make a macro to split a merged image and measure the percentage area of two different stains in it. This will involve chaining variables together to achieve what we need.
Batch processing is where the true power of image analysis can shine. Processing a large directory full of images without any user intervention can generate large amounts of data in very little
For this tech note we will modify the previously made cell counting journal to be able to batch process a folder of images. We will then modify this to process only image files in the directory.
Secondly we will modify the fluorescent threshold journal to batch process and save the output images into a directory of the users choosing
As analysis becomes more complex you may generate results that are not part of the normal results and summary tables. For example a ratio or percentage based on two results may be calculated in the macro and needs to be logged out. This can be achieved by creating a custom log table for the data to go into which can be saved later.
For this tech note we will write a macro to count the number of positive cells in two stain channels, calculate their percentage of the total population and then log the results to a custom made table.
After that we will refine to code to be sure it is only counting true cells.
We will finally add code to save out overviews of the results into a directory within the original source directory. This is instead of asking the user to provide the output directory as in the previous macro.
There are situations where you need to measure information in a large group of regions individually and log out the measurements. In this example we will write code to batch analyse the shapes and textures of many cells. To be able to do this we need to create regions around all the cells, measure each of those regions individually and then log out the information to a custom table to be used for further image analysis.
This script will also use the LOCI tools to import confocal data captured on a Zeiss confocal.
With some script user input is required at the start to fill in information for missing parameters or those that cannot be easily interpreted automatically. To gather this information a custom dialog window can be created for the user to fill out, the data from this window can then be stored in variables for later use in the code.
Dialog windows can contain boxes for text and numbers, check boxes, sliders, drop down boxes and radio buttons. The values contained in these entries can be forwarded to variables.
These notes make use of the images found in the Demo Images\Widefield\Montage folder. The following examples will use custom dialogs to ask the user how an image was separated into tiles to be able to stich it back together again. Another example will allow the user to enter any number of rows and columns and have the script chop the image up into tiles and save them.
Entering data into arrays has already been used previously in this manual but it has been handled automatically by commands like the getDirectory command. There are times though when you need to generate a custom array to be able to generate the data required.
This example will let a user chop an image up into smaller tiles in any number of rows and columns taken from a custom dialog and then processed through several arrays to calculate the required coordinates for cropping each tile. The chopping is done by creating regions on the image and duplicating them to generate the smaller tile images.
This example uses the Original.tif file found in the Demo Images\Widefield\Montage folder. It needs to be manually opened before running or testing the code.
NOTE: A lot of the array commands do not change colour in the script editor so be careful when entering them to make sure they are correct.
With longer and more complex macro code it can become unwieldy to easily edit it or port it across to other uses. This can be made easier by adding functions to the code.
Functions are stubs of code that carry out a set bunch of code, for example split channels and rename them. This stub is referenced by a variable and can be called and ran anytime within the code by calling just the single variable.
For this technical note we will modify two of the previous macros we created (Vessel and Hypoxia Measurement (with Result Output).ijm and Ki67 and PH3 Count (Refined with Output).ijm) to use functions.