The entirety of the AxonTracer tool is implemented as an ImageJ macro, and can be easily manipulated using a simple text editor. Reference for the ImageJ macro language is available online [7]. AxonTracer can batch process RGB microscope images in various formats (e.g., tiff, .jpeg) and dimensions.
Data structure
All images that are to be processed together must be in a single folder (analysis folder). The folder cannot contain any other files than image files. The image filenames must be numeric and cannot start with the number “0” (e.g., 01.tiff is not allowed). Images can be of different formats. The numbers do not have to be in consecutive order. For example, a folder containing files with the following names are valid: “3.tiff, 24.jpeg, 25.jpeg, 87.tiff”.
User interface (UI)
The user initially selects the desired analysis mode. At present, AxonTracer has 4 different analysis modes, but the plugin is easily modifiable to accommodate more modes. All 4 analysis modes use the same algorithm for axon detection, tracing and quantification, and differ only in the degree of automatization regarding the creation of a region of interest (ROI) in which axons are to be detected. These 4 modes are: (1) Entire Image: here, no automated or manual ROI for axon detection is created and hence axons in the entire image are analyzed. (2) Automatic ROI: here, axon detection is limited to an automatically identified (ROI). The ROI is created based on a fluorescent channel other than the axon channel. In this manuscript, we either use fluorescently labeled cell grafts (Figs. 1, 2), or neuronal cell bodies that are immunohistological stained (Figs. 3, 4) to create the ROI for axon detection. (3) Manual ROI-1 Axon Channel: here, axon detection is limited to a user defined ROI. The ROI is actively drawn by the user based on the axon detection channel or a different fluorescent channel if available. (4) Manual ROI-2 Axon Channels: here, similar to option 3, axon detection is limited to a user defined ROI. The ROI is actively drawn by the user based on any of the two axon detection channels or a different fluorescent channel. This option allows for quantification of axons in two separate fluorescent channels within the same user defined ROI.
After selecting an analysis mode, the user then assigns the channels (r, g, b) to either axon detection, ROI detection or neither. The user can further decide if the axon tracing data must be normalized (see below). ROI and axon detection parameters are defined and adjusted in an interactive user interface, where ROI size, axon detection sensitivity, and axon cleanup values are set by the user.
Data normalization
If data normalization is selected, the user will be presented with the image that has the highest fluorescent intensity in the axon channel within the analysis folder. The user is then required to manually draw an ROI around the fluorescent signal that is then used as reference value for all images in the analysis folder. All axon tracing data is saved as raw data (total pixels per image) and as normalized data [raw data/mean intensity of normalization ROI].
Automatic ROI detection
If automatic ROI detection is selected, the user will be presented with the image within the analysis folder that has the median fluorescent intensity in the ROI channel. An interactive user interface allows for adjustment of the automatically detected ROI by increasing or decreasing the detected area by − 255 to 255 pixels.
AxonTracer algorithm workflow
Figure 1 shows a detailed overview of the AxonTracer algorithm. First, RGB-images are split into red, green and blue channels (step 1). The channel for ROI detection (R, Fig. 1) is processed separately from the channel selected for axon detection (G, Fig. 1). The ROI channel is processed first. Auto contrast settings are applied to reduce background and increase ROI intensity (step 2), then the image is binarized resulting in a black and white image (step 3). Differences in fluorescent intensity in the ROI channel (e.g. RFP expression in grafted cells) increase the difficulty to automatically define homogenous, continuous ROIs that span the complete graft area. The purpose of steps 4 to 7 is hence to combine smaller fragmented ROIs into larger continuous ROIs and also to eliminate artifacts. First the particle removal filter is applied to subtract small debris from regions outside the ROI (step 4), then the hole filler function is applied to remove the holes inside the ROI to create a more continuous ROI (step 5). The ROIs are then enlarged by 60 pixels (step 6), which leads to the elimination up to 120 pixels wide gaps between adjacent ROIs. The newly formed ROIs are then again reduced first by 60 pixels to counteract then overall increase in size from step 6 and then further reduced in size by 30 pixels (combined reduction of 90 pixels, step 7). This further reduction removes ROIs below the size of 30 pixels that could not be connected to larger ROIs in step 6. We tested pixel ranges from 1 to 500 with diverse image sizes and resolutions to define the ideal parameters for ROI enlargement and reduction. We selected 60 and 90 pixels respectively because they lead to the most consistent results in terms of ROI to graft area representation. These parameters can be adjusted if necessary within the journal itself. They are defined in the beginning of the journal as variables “enlargeROI” and “reduceROI” respectively.
From the remaining black and white image a mask is automatically created using the built-in ImageJ function: “Create Selection” (step 8). This mask is then applied to the axon channel image (green channel, step 9) and the image is cropped to fit the mask (step 10), which reduces the image size and hence improves processing speed. Steps 12–23 are examples of individual axon detection steps that are used when the detection parameters are defined by the user in an interactive process. The same steps are applied to the whole image, once detection parameters are set. First the user selects an area of the axon channel image that will be used in subsequent steps to adjust the axon detection parameters (step 11). The selected area should contain axons that represent the morphology of the entire image, thus detection parameters can be defined adequately. Holes present in the tissue can easily lead to false axon detection along the edges of the holes, since the signal difference between the black background within the hole and tissue around the hole is high and can hence trick the algorithm in detecting artificial axons. To avoid this issue, we identify the holes and fill them average image signal intensity, which reduces false detection of axons. First holes in the tissue are identified (step 12) and a mask is automatically created using two built-in ImageJ function: “Convert to Mask” and then “Create Selection” (step 13). The selection is then saved in the ROI manager and later applied to the derivative images in step 15 to fill the holes with the mean intensity of the image. The original image is processed separately in x- and y-dimensions for steps 14–18. First, the essential differential-geometric image for the x- and y-dimension is computed (step 14), utilizing multi-dimensional, Gaussian-scaled derivatives (https://imagescience.org/meijering/software/featurej/derivatives/). ROIs reflecting holes from step 12 are applied to the images (step 15) and filled with the mean intensity signal of the image (step 16). This step eliminates holes in the tissue that were detected in step 12. Then, the image is inverted pixel by pixel in x- and y-dimension using nested FOR-loops (step 17).
User interface for detection parameter selection: The Parameters for axon detection defined by the user are During the initialization process when the user is adjusting the axon detection parameters step 18 till 23 are repeated with the axon image selected in step 11 until the user accepts the axon detection parameters. Then all images are analyzed with the accepted parameters. And result images are created (step 24) that are then saved in the “traced images” folder.
User defined axon detection parameters are applied to the individual images (step 18). Then both X and Y images are recombined by overlaying both coordinates within the ROI manager (step 19). A well-defined, one pixel wide representation of the fibrous structure is obtained by the essentially topological skeleton function of ImageJ (step 20). The “Analyze particle” function is applied detecting only particles above the user defined cleanup value, thereby eliminating all particles smaller than a user defined pixel size (step 21) and automatically creating a mask of the remaining detected particles. This mask of the remaining skeletons is added to the ROI manager using the built-in ImageJ function: “Create Selection” (step 22) and superimposed with yellow lines (step 23) onto the original image, creating the resulting image (step 24) that is then saved in the “traced images” folder. Once the axon detection parameters are accepted by the user, the algorithm processes all images in the analysis folder with the same settings.
AxonTracer output
After the analysis is done, the analysis folder contains the original images; the “traced images” folder, depending on the analysis mode selected, contains either all, or some of the following identified by letters “a” to “e” after the filename (e.g., 1a.tiff): (a) the original RGB image with superimposed ROI in white, (b) a cropped grayscale image of axon channel 1 and (c) a cropped grey-scale image of axon channel 1 with superimposed traces in yellow, (d) a cropped grey-scale image of axon channel 2 and (e) a cropped grey-scale image of axon channel 2 with superimposed traces in yellow. The analysis folder will also contain an Excel spreadsheet with quantification results, named “tracing data summary”.
Identification of individual axons
AxonTracer quantifies the sum of all axons within the entire image or within a specific ROI and traces all axons with the same color (yellow). If quantification of individually traced axons is required, we made an alternate version of the journal, named “AxonTracerDetail”, available for download at www.poplawski-lab.com. “AxonTracerDetail” quantifies the length of each individual axon and creates a multicolor tracing image, where every individual axon is labeled in a unique color. For each image, an individual result datasheet, named “Tracing Data Details.xls” and an image containing color coded axon tracings identifying individual axons, named “Tracing Data Details.png” are created in the folder “Traced Images Detailed Results” (Additional file 1: Fig. S1).
Critical issues
The unique architecture of AxonTracer allows for accurate axon detection of images with a wide range of signal to noise ratios. However, for images with a high dynamic range that contain both dense axons with high fluorescent signal intensity as well as sparse axons with low fluorescent signal, detection accuracy is reduced. In such cases, AxonTracer yields accurate detection of axons with high fluorescent signal intensity, but a loss of detection of axons with low fluorescent signal intensity, or vice versa. This issue can be greatly improved if images are taken with cameras in HDR (high dynamic range) mode, in which case high fluorescent structures are imaged at lower intensity and vice versa, creating an image with even fluorescent signal distribution.
Ongoing development
AxonTracer is implemented as an ImageJ macro, and therefore easily modifiable by the user. Updates to the AxonTracer tool will be made available on the AxonTracer website (www.poplawski-lab.com). Due to its open-source implementation, the AxonTracer image analysis software can be adapted to individual analysis needs. Importantly, its usage is not limited to the detection of axons in spinal cord tissue, but can be altered to detect any fibrous structure in uniquely defined ROIs in other tissue sources. We are currently working to expand the capabilities of this plugin. Features in development include automatic segmentation of ROIs, allowing for the quantification of distance of axon regeneration into cell grafts, which is an important measure in the development of functional relays across sites of spinal cord injury [1, 4]. Suggestions to improve the software can be submitted at www.poplawski-lab.com/axontracer.