# Sholl Analysis

TODO component: {"content"=>"ca.mcgill:Sholl\\_Analysis"}

Automated and multithreaded Sholl for direct analysis of fluorescent images and traced morphologies. Features powerful quantifications based on curve fitting. Analysis of data obtained outside of ImageJ is also possible.

## Introduction

The Sholl technique[2] is used to describe neuronal arbors. This plugin can perform Sholl directly on 2D and 3D grayscale images of isolated neurons. Its internal algorithm to collect data is based upon how Sholl analysis is done by hand — it creates a series of concentric shells (circles or spheres) around the focus of a neuronal arbor, and counts how many times connected voxels defining the arbor intersect the sampling shells. The major advantages of this plugin over other implementations are:

## Installation

The plugin is distributed with Fiji. It installs several commands under Analysis ▷ Sholl ▷

. As part of an active effort to modernize ImageJ you need to subscribe to the Java 8 update site to access the latest plugin version (this will also allow you to access the newest ImageJ capabilities). To do so, you can either:

## Direct Analysis of Images

In this mode (bitmap analysis), the plugin requires a binary image or a segmented grayscale image (2D or 3D) containing a single neuron.

1. Segment the neuronal arbor using Image ▷ Adjust ▷ Threshold…

(shortcut: press\|Shift\|T ).

:N.B.: When using multichannel images, you will have to set the its display mode to Grayscale using Image ▷ Color ▷ Channels Tool…

(press\|Shift\|Z ), because images displayed as Composites cannot be thresholded.

1. Define the center of analysis using a valid startup ROI.
2. Run Analysis ▷ Sholl ▷ Sholl Analysis…

, adjusting the default Parameters in the dialog prompt.

1. Press More » Cf. Segmentation to visually inspect the two thresholded phases: arbor and background.
 Tip: This program is described in Nature methods . The manuscript uses ““Sholl Analysis”” to describe and classify morphologically challenging cells and is accompanied by a Supplementary Note that presents the software in greater detail. Please cite it when acknowledging the plugin in your published research.

### Startup ROI

The center of analysis can be specified using one of three possibilities:

Straight line: A Straight line from the focus of the arbor to its most distal point using the Straight Line Tool. The advantages of using line selections are twofold: 1) Center of analysis and Ending radius are automatically set, and 2) Horizontal/vertical lines (created by holding press\|Shift while using the Straight Line Selection Tool) can be used to restrict analysis to sub-regions of the image.
Single point: A single point marking the focus of the arbor using the Point Selection Tool. With single point selections, only the center of analysis is defined. Thus, this option is suitable for batch processing of images with different dimensions with undefined Ending radius.
Multi-point selection:A Multi-point selection (multi-point counter) in which the first point marks the center of analysis while the remaining points mark (count) the number of primary branches required for the calculation of ramification indices). Suitable for cases in which inference from starting radius is not effective.

### Cf. Segmentation

Press More» Cf. Segmentation to visually confirm which phase of the segmented image will be sampled. This command highlights foreground from background pixels and is particularly useful when analyzing black and white (binary) images or when using the B&W lookup table in the Threshold Widget (Image▷ Adjust▷ Threshold… press\|Shift\|T ). Cf. Segmentation allows you to ensure that you are measuring neuronal processes and not the interstitial spaces between them. Here is an example using an axonal arbor of a Drosophila olfactory neuron from the DIADEM dataset[3]:

 Segmented image Cf. Segmentation output Intersections mask Top row: Image properly segmented: Arbor is sampled. Bottom row: Aberrant segmentation (inverted image): Background is sampled.Note the reversal of Cf. Segmentation output and how the intersections mask no longer decorates the axonal processes but the interstitial spaces between them. The consequences of the phase inversion are twofold: 1) the program oversamples (cf. hue ramps on upper left of Intersections mask) and 2) the program detects artifacts induced by the edges of the image (cf. top-right and bottom-right corners of mask where intersections are sampled in the absence of real axons at those locations). Also, note that the initial black and white image would look the same under an inverted lookup table ( Image ▷ Lookup Tables ▷ Invert LUT ).
 Tip: With binary images, ““Sholl Analysis”” treats zero intensities as the background, independently of the image lookup table or the state of the ““Black background option”” in Process▷ Binary▷ Options… As with any other ImageJ routine , confusing background with foreground pixels will lead to aberrant results, including: 1) overestimation of branches and 2) artifacts at distances intersecting the boundaries of the image canvas.

## Analysis of Traced Cells

[400px|right |Main prompt (version 3.6.8), when input is traced data ( Analysis ▷ Sholl ▷ Sholl Analysis (Tracings)…

)In](File_ShollTracingsPrompt.png) this mode, the plugin analyzes reconstructed arbors. This is particularly relevant for stainings that do not allow single-cell resolution. The plugin is macro recordable and batch processing is also possible.

1. Run Analysis ▷ Sholl ▷ Sholl Analysis (Tracings)…

and specify a tracing file (a .swc, a .eswc or a Simple Neurite Tracer .traces file). If you want, you can also specify the image associated with the reconstruction. This will allow the plugin to use the image’s metadata to determine spatial units and x,y,z spacing.

1. Choose the center of analysis using the drop down menu in the main prompt listing SWC tags (axon, dendrite, soma, etc.). Note that if your tracings are not tagged you can do so in Simple Neurite Tracer
 Tip: You can use Sholl Analysis (Tracings)… to analyze reconstructed data from any software capable of SWC export such as Py3DN , Neuromantic , NeuronStudio , neuTube , or Vaa3D ), not just Simple Neurite Tracer. In addition, L-Measure , NLMorphologyConverter or Neuron can also be used to convert several file formats (including proprietary formats from closed-source commercial software such as Neurolucida®, MicroBrightField, Inc.) into SWC.

## Analysis of Existing Profiles

This feature is processed by Analysis ▷ Sholl ▷ Sholl Analysis (Existing Profile)…

. This command can be used to re-analyze data (replot, modify fitting options, etc.) without having to access the initial image or tracing data. Batch processing is also possible. Noteworthy:

• Input data: Any tab or comma delimited text file (.csv, .txt, .xls, .ods) can be used. You can drag & drop these files into the main ImageJ window, import data from the clipboard, or use data from any other table already opened by ImageJ.
• Restricting input data: To restrict measurements to a range of distances (see related example), select the range of distances you want analyze. You can click the first row in the range, and then drag the mouse to the last row, or by holding down press\|Shift while selecting the last row in the range. Then, in the prompt, activate the Restrict analysis to selected rows only checkbox.
• Calculation of Radius step size: Radius step size is calculated from the difference between the first two rows in Distance column. This is mainly relevant when choosing Annulus/Spherical shell as normalizer.

## Parameters

The majority of parameters is shared by all the Analysis commands in the Analysis ▷ Sholl ▷

submenu. However, some settings are specific to the type of data used as input: A segmented image, a tracing, or a previously obtained profile. When analyzing images, input values take into account the scale information of the image (which can be set using the Analyze ▷ Set Scale…

or Image ▷ Properties…

(press\|Shift\|P ), the type of image (2D or 3D), and its active ROI.

#### Definition of Shells

• Starting radius  The radius of the smallest sampling circle/sphere, i.e., the first distance to be sampled.
• Ending radius  The radius of the largest (last) sampling circle/sphere. It is automatically calculated if a line ROI is used. Note that the specified distance may not be actually sampled, if Radius step size is not a divisor of Ending radius-Starting radius. In this case, the program will choose the largest possible distance smaller than the specified value.

N.B. You can clear Ending radius or set it to NaN (“Not a Number”) to sample the entire image. This is particularly useful when batch processing images with different dimensions.

• Radius step size  The sampling interval between radii of consecutive sampling circles/spheres. This value may be set to zero for continuous (1-voxel increment) measurements.

N.B. For stacks with anisotropic voxel size, setting Radius step size to zero, sets the step length to the dimension of the matching isotropic voxel, i.e., the cube root of the product of the voxel dimensions (3D images) or the square root of the product of the pixel dimensions (2D images).

• Restrict analysis to hemicircle/hemisphere  This option is only available when an orthogonal radius has been created (by holding Shift while using the Straight Line Selection Tool). It can be used to limit the analysis to sub-compartments of the arbor.

N.B. For horizontal lines, this option instructs the algorithm to measure intersections at sites equidistant from the center that have y-coordinates above/below the drawn line. For vertical lines, it instructs the plugin to measure intersections at sites equidistant from the center that have x-coordinates to the left/right of the drawn line. [320px|right |Main prompt (version 3.4.1), when input is a segmented image ( Analysis ▷ Sholl ▷ Sholl Analysis…

)](File_BitmapSholl-Prompt_v3.png)

#### Multiple Samples/Noise Reduction

• Samples per radius (2D images only)  Defines the number of measurements to be performed at each sampling circumference. These measurements are then combined into a single value according to the chosen integration method. This strategy, a break from previous approaches, increases the accuracy of non-continuos profiles by diluting out the effect of processes extending tangent to the sampling circumference.

Visually, this option can be imagined as the “thickness” of the sampling circumference: e.g., for a radius of 100 pixels and a value of 3 Samples per radius, the final number of intersections would integrate the measurements sampled at distances 99, 100 and 101.

[320px|right |Main prompt (version 3.4.3), when input is tabular data ( Analysis ▷ Sholl ▷ Sholl Analysis (Existing Profile)…

)](File_BitmapSholl-TabularPrompt.png)

Note that it would not make sense to increase the number of samples beyond the length (in pixels) of Radius step size. For this reason, this option is limited to a draconian (and arbitrary) maximum of 10 samples.

• Samples integration (2D images only)  The measure of central tendency used to combine intersection counts when multiple Samples per radius are used. Options are Mean (the default), Median or Mode.
• Ignore isolated (6-connected) voxels (3D images only)  If checked, single isolated voxels intersecting the surface of sampling spheres are not taken into account, which may allow for smoother profiles on noisy image stacks. However, it should be noted that connectivity in the stack volume may not reflect connectivity on the surface of a digitized sphere. Indeed, in certain contexts, it is possible (though unlikely) to obtain higher intersection counts when this filtering option is active.

Please keep in mind that this is just a refinement feature, and you should not expect it to mitigate the effects derived from poorly-segmented arbors.

#### Descriptors and Curve Fitting

• Enclosing radius cutoff The number of intersections to be used in the definition of Enclosing radius.
• Number of primary branches The number of primary branches (i.e., those originating directly from cell soma when the center of analysis is the perikaryon) to be used in the calculation of Schoenen ramification indices. It is automatically populated using multi-point counts if a multi-point ROI is detected at startup. Set it to zero (or NaN) to disable calculations of ramification indices.
• Infer from starting radius If checked, the Number of Primary branches is inferred from the count of intersections at Starting radius.
• Fit profile and compute descriptors  If checked, data is fitted according to the chosen method and appropriate metrics calculated automatically. If unchecked, only sampled data is plotted.
• Show fitting details  Choose this option to have all of the parameters of the simplex fitting printed to the Log window. The coefficient of determination (R2, a measure of goodness of fit) is always stored in the Sholl Results table even when this option is not selected.
 Tip: Complementary Tools describes how to extend curve fitting beyond default options.

#### Choice of Methods

The type of profile(s) to be obtained. Linear (profile without normalization), or normalized profiles: Linear-norm, Semi-log, or Log-log.

• Polynomial   Specifies the degree of the polynomial to be fitted to the Linear profile[4]. While the polynomial of best approximation, or “best fit”, should be empirically determined for each analyzed cell type, it is possible to ask the plugin to predict the order of the fitting polynomial (or at least try) using the choice Best fitting degree. In this case, the plugin will loop through all the available choices of polynomials, perform each fit in the background and choose the one with the highest coefficient of determination.
• Most informative   Select this option when you cannot predict which type of normalized profile best describes the dataset. If chosen, the plugin will use the Determination ratio to determine which of Semi-log or Log-log methods is more appropriate. Linear-norm is not performed.
The Best fitting degree and Most informative choices are obviously more computer-intensive and can be monitored by activating the Show fitting details checkbox.
• Normalizer The property of the sampling shell to be used in the normalization of Linear-norm, Semi-log, and Log-log profiles. It is described below.

#### Output Options

• Create intersections mask  If checked, a 16/32–bit maximum intensity projection of the analyzed image is generated in which the measured arbor is painted according to its Sholl profile. The type of data (Raw, i.e., sampled or Fitted) is displayed in the image subtitle and can be specified in Analysis ▷ Sholl ▷ Metrics & Options…

or using the Options… command in the More» drop-down menu.
NB: The default Lookup Table (LUT) used by the mask can be changed using Image ▷ Lookup Tables ▷

. The background color [gray level: 0 (black) to 255 (white)] can also be set in Metrics & Options…

, or at any later point using Image ▷ Color ▷ Edit Lut…

WYSIWYG versions (RGB images) of these masks can be otained using by pressing press\|Shift\|F ( Image ▷ Overlay ▷ Flatten

) or by running Analyze ▷ Tools ▷ Calibration Bar…

• Overlay sampling shells and intersection points’’ (2D images only)’’  If checked, two sets of ROIS are added to the image overlay: 1) concentric shells matching sampled distances (circular ROIs or composite ROIs when using hemicircles); and 2) Multipoint ROIs at intersection sites between shells and clusters of foreground pixels.
• Save results to   If checked, all the results (with the exception of the Sholl Table) are saved to the specified directory. These include: 1) Sholl plots (saved as PNG images), 2) A table containing detailed data and 3) The Sholl mask. Files are named after the image filename and analysis method. Saving options can be specified in Analysis ▷ Sholl ▷ Metrics & Options…

(Options… command in the More» drop-down menu). - Do not display saved files If checked, saved files are directly saved to disk and are not displayed. Activate this option when batch processing files.

 Tip: In the dialog prompts of ““Sholl Analysis””, bold headings are clickable URLs pointing to the respective sections of this manual. In addition, relevant tooltips are displayed in the ImageJ status bar when specifying key options.

## Sholl Plots

![](/media/ShollPlots.png "fig:")

**Linear, Linear-norm, Semi-log and Log-log profiles for the ddaC cell ( File ▷ Open Samples ▷ ddaC Neuron

), version 3.0*. Most of the retrieved metrics are automatically highlighted by the plugin. *Linear profile: Mean value (horizontal grid line) and Centroid (colored mark). Logarithmic profiles: The Sholl regression coefficient (also known as Sholl decay) can be retrieved by linear regression using either the full range of data (blue line) or data within percentiles 10–90 (red line). For this particular cell type, the Semi-log method is more informative when compared to the Log-log method.

Method

Fit

Description

(1)

Linear

N = a + br + cr2 + dr3 + er4 + fr5 + ... + xrn

Outputs a N vs Distance profile. Data is fitted to a polynomial function1. Critical radius, Critical value and Mean value of function are calculated

(2)

Linear-norm

N/S = a rb

Outputs a N/S vs Distance profile. Points are fitted to a power function. It is an intermediate representation of the data that can be used to gauge the choice of normalizer. Once plotted under a logarithmic scale the Linear-norm curve is similar to the Semi-log profile

(3)

Semi-log

log(N/S) = -k r + m

Outputs a log(N/S) vs Distance profile. A linear regression is fitted to the sampled data. The Sholl regression coefficient (k) is calculated

(4)

Log-log

log(N/S) = -k × log(r) + m

Outputs a log(N/S) vs log(Distance) profile. Data is also fitted to a straight line. This is an alternative approach2 of obtaining a relevant regression coefficient, when the Semi-log method returns a poor fit

N For 2D images, the Number of clusters of pixels (8–connected) intersecting the circumference of radius r
For 3D images, the Number of clusters of voxels (26-connected) intersecting the surface of the sphere of radius r

r Distance from center of analysis (radius of Sholl circle/sphere)

log Natural logarithm, the logarithm to the base e

SThe chosen property of the sampling shell to be used in the normalization of Linear-norm, Semi-log, and Log-log profiles.
For 2D images, the Perimeter of the sampling circumference (2πr) or the Area of the corresponding circle (πr2)
For 3D images, the Surface of the sampling sphere (4πr2) or its respective Volume (4/3πr3)
N.B. A third normalization option is also available when performing non-continuous sampling: Annulus/Spherical shell. In this case, the normalization is performed against the area of the annulus formed between the circumferences at r ± Radius step size/2 (2D images), or against the volume between the two spheres at r ± Radius step size/2 (3D images).

## Metrics

Morphometric descriptors and other properties of the arbor are printed to a dedicated table named Sholl Results. Output is fully customizable using Analysis ▷ Sholl ▷ Metrics & Options…

or using the Options… command in the More» drop-down menu. The first columns log analysis parameters: Image Directory, filename and voxel unit, Channel, Lower and Upper Threshold levels, X,Y (in pixels) and Z (slice number) coordinates of center of analysis, Starting and Ending radius, Radius step, Number of Samples per Radius, etc. Other parameters are described below.

 ![100%|center|Descriptors and metrics are listed in the Sholl Table (v2.4)](/media/BitmapSholl-Table.png “100% center Descriptors and metrics are listed in the Sholl Table (v2.4)”)

### Metrics based on sampled data

350px|right |Metrics & Options prompt (version 3.6.4)

The number of sampling radii intersecting the arbor at least once.

Sum of intersections (Sum inters.)
The sum of all intersections.

Mean of intersections (Mean inters.)
Sum inters. divided by Intersecting radii.

Median of intersections (Median Inters.)
The median value of sampled intersections.

Skewness
The skewness of the sampled data, an indication of how symmetrical the distribution is around its mean. Positive values indicate an asymmetrical distribution with a longer tail to the right. Negative values indicate data with a longer tail to the left. A popular rule of thumb considers that if the skewness is greater than 1.0 (or less than -1.0), the distribution may be considered far from symmetrical.

Kurtosis
The kurtosis of the sampled data, which quantifies whether the shape of the distribution matches that of a Gaussian distribution, assuming that a Gaussian distribution has a kurtosis of 0. A distribution more peaked than a Gaussian has a positive kurtosis while a negative value indicates a flatter distribution.

Highest count of intersections (Max inters.)
The maximum value of sampled intersections, i.e., the maximum in a linear [N vs Distance] profile, reflecting the highest number of processes/branches in the arbor.

 Tip: ”””"”Max inters.”””””: By default only the absolute maximum is noted. However, it is possible to apply peak detection techniques to the profile to retrieve other sites of high density branching. See Complementary Tools for more details.

The distance at which the Highest count of intersections occurred, reflecting sites of highest branch density. Note that if the same maximum occurs multiple times, only the first distance is considered.

Schoenen Ramification index (Ramification index (sampled))
A measure of ramification[5]: the ratio between Max inters. and the number of primary branches. It is only calculated when primary branches is valid and not zero.

The abcissa of the centroid (i.e., the geometric center or barycenter) of the linear profile. It is highlighted on the N vs Distance plot.

Centroid value
The ordinate of the centroid (i.e., the geometric center or barycenter) of the linear profile. It is highlighted on the N vs Distance plot.

The last (thus, the widest) of Intersecting radii to be associated with the number of intersections specified by Enclosing radius cutoff. For a cutoff of 1 (the default) Enclosing radius is the widest of Intersecting radii. It reflects the Feret length of the arbor.

### Metrics based on fitted data

Determination ratio
The ratio of the coefficient of determination for the semi-log method and that for the log–log method[6]. If the semi-log method is better relatively to the log–log method, the Determination ratio becomes larger than 1. It is the parameter used by the plugin to silently predict the normalization method that is the most informative. The prediction can be monitored by activating the Show fitting details checkbox.

Sholl regression coefficient (Regression coefficient)
The slope (multiplied by -1) of the linear regression described in (3) and (4), i.e., k, a measure of the rate of decay of the number of branches with distance from the center of analysis. Higher k values reflect larger changes in the function log(N/S). To optimize the fit, the plugin retrieves a second linear regression centered around the median distance, excluding distances at the edges of the profile. Details of this second fit are also registered on the Sholl table under dedicated columns, e.g., Sholl regression coefficient [P10-P90], when data within the 10th–90th percentile is used.

Regression intercept
The y-coordinate m described in (3) and (4).

Regression R2 (Regression R^2)
The coefficient of determination of the linear regression described in (3) and (4).

Critical value
The local maximum of the polynomial fit, i.e, N at Critical radius in (1). Abbreviation: Nm.

The distance at which Critical value occurs. By default (see Advanced Usage), it is calculated with a precision of 1/1000 of Radius step size. Abbreviation: rc.

 Tip: ”"”Nomenclature”””: Previous authors have used different terms to describe the largest value taken by the Sholl profile, including ““Dendrite maximum””. Since the Sholl technique is not restricted to dendritic arbors and can be applied to any tree-like structure such as axonal arbors, mammary ducts or blood vessels (cf. List of citations), ““Sholl Analysis”” introduces the term Critical radius, renaming ““Dendrite maximum”” (““Nm””) to Critical value.

Mean value
The mean value[7] of the fitted polynomial function (1), representing the average of intersections over the whole area occupied by the arbor. Abbreviation Nav.

On the Sholl plot, it is highlighted as the height of the rectangle that has the width of Enclosing radiusFirst intersecting radius and the same area of the area under the fitted curve on that discrete interval. It is analogous to Mean inters., the arithmetic mean of sampled intersections throughout the arbor (cf. Metrics based on sampled data). By default (see Advanced Usage), it is calculated with a precision of 1/1000 of Radius step size.

Schoenen Ramification index (Ramification index (fit))
Schoenen Ramification index retrieved from fitted profile: The ration between Critical value and Number of primary branches.

Skewness (Skewness (fit))
The skewness of the fitted polynomial distribution between Starting radius and Ending radius.

Kurtosis (Kurtosis (fit))
The kurtosis of the fitted polynomial distribution between Starting radius and Ending radius.

Polynomial R2 (Polyn. R^2)
The coefficient of determination of the polynomial fit described in (1).

## Complementary Tools

Sholl Analysis tries to be as flexible as possible by providing several options for normalization and curve fitting. However, it cannot offer exhaustive curve fitting options as determining best fit models requires reasonable choices that are not amenable to full automation. For this reason, complementary tools for curve fitting can be installed as needed using BAR by subscribing to its update site. Several BAR commands complement Sholl Analysis. These include:

Segmentation tools:
Thresholding, shape-based masking and edge-detection routines (see full BAR list)

Data analysis tools:
Find Peaks: Retrieves local maxima under several filtering options such as peak amplitude, peak height and peak width. Can be used to retrieve secondary sites of branch density

Fit Polynomial : Fits a polynomial of any degree to sampled data. Features an heuristic algorithm for guessing a polynomial “best fit”. Expands the built-in repertoire of polynomial fits up to 50th order functions.

Create Boxplot : Allows direct comparison of metrics between groups or sets of data (specially useful when tagging images with the Comment field in Analysis ▷ Sholl ▷ Metrics & Options…

)

Interactive Plotting : Whole-purpose routine that plots data from imported spreadsheets.

## Pre-processing

This section discusses some aspects that should be taken into account when segmenting neuronal arbors to be processed by Sholl Analysis. Since image segmentation (i.e., the partitioning of images into analyzable parts) is vulnerable to noise and background fluorescence, it is not possible to generalize universal routines that efficiently binarize grayscale images. This means that any procedure that tries to appropriately describe the original fluorescence image with a binary mask must be tailored to the characteristics of individual datasets. As mentioned in Complementary Tools, several routines listed here as distributed through the BAR update site .

Noise
Noise can be mitigated through the usage of processing filters, specially edge-preserving ones. Examples:

• Rolling Ball or “Top hat” filters, e.g., Process▷ Subtract Background…
• Median Filtering (2D/3D), e.g., Process▷ Filters▷, Plugins▷ 3D▷
• Anisotropic Diffusion, Plugins▷ Process▷ Anisotropic Diffusion 2D
• Sobel Edge Detection, e.g., Process▷ Find Edges
• Shen-Castan Edge Detector (BAR update site ), BAR▷ Segmentation▷
• Frequency filters, e.g., Process▷ FFT▷ Bandpass Filter…

Uneven Illumination
Uneven illumination problems, typically associated with wide field microscopy, do occur in confocal microscopy when signal from deep layers of the tissue is not captured as bright as with superficial layers. This signal attenuation along the Z-axis will generate a shaded gradient across the stack that histogram-based segmentation will need to take into account. While these problems are better tackled during acquisition (e.g., using laser ramping), it is possible to mitigate this effect using histogram-normalization techniques. Examples:

Automated Segmentation
It is possible to adopt more sophisticated segmentation algorithms when global thresholding methods do not yield satisfactory results. Examples:

Semi-Automated Segmentation
Object detection and image segmentation in images with poor signal-to-noise will likely require decisions taken by a human operator. This is frequently done using hand-crafted workflows using either ImageJ’s built-in tools or external add ons. Examples:

 Tip: For additional image processing tools have a look at the growing list of update sites . For more information on image processing have a look at ___SHADOW2___, ___SHADOW3___ and the ImageJ User Guide .

## Batch Processing

It is fairly simple to automate the analysis of multiple images using any of the scripting languages supported by ImageJ and Fiji (ImageJ Macro Language, Beanshell, Javascript, JRuby, Jython, Clojure, …). This section provides some examples.

### Batch Analysis of Images

Any macro or script must allow the Sholl Analysis plugin to access the ROI marking the center of analysis. One could instruct ImageJ to read the coordinates of pre-existing ROIs from a text file, store a list of line selections in the ROI Manager, or write a morphology-based routine that detects the center of the arbor. However, marking the center of analysis is probably something that you will want to do manually. Here is a workflow:

1. Place all the .tif images to be processed in a single folder.
2. Select the Point Selection Tool in the main ImageJ window. With 3D images, make sure Set stack positions is active in the Image▷ Overlay▷ Overlay Options… prompt.
3. Open the first image and press press\|Shift\|T to activate the Threshold widget (Image▷ Adjust▷ Threshold…).
4. Adjust threshold levels. Press the Apply button of the Threshold widget to create a binary image.
5. Select the z-slice containing the center of analysis. Click over the center with the Point Selection Tool and press press\|B (shortcut for Image▷ Overlay▷ Add Selection…). This will add the point ROI to the image overlay. Save the image as .TIFF by pressing press\|S (File▷ Save As…▷ Tiff…).
6. Repeat the last 2 steps until all images are marked, using press\|Shift\|O (shortcut for File▷ Open Next) to iterate through all the images.
 Tip: When working with ROIs, it is critical that you work with .tif files because only this format keeps track of image overlays. The Process▷ Batch▷ Convert… command allows bulk conversion between image formats.

Now that all the images are marked, we just need to ask ImageJ to generate some lines of code. We will open the Macro Recorder (Plugins▷ Macros▷ Record…) and run Sholl Analysis on one of the images to find out how to call the plugin with suitable parameters. In this example, we will use the ImageJ macro language. The single line of code that appears in the recorder window will look something like this:

// Recording Sholl Analysis version 3.4.3
// Visit https://imagej.net/Sholl_Analysis#Batch_Processing for scripting examples
run("Sholl Analysis...", "starting=10 ending=400 radius_step=0 infer fit linear polynomial=[8th degree] semi-log normalizer=Volume create save do");


Now, we just need to assemble a working macro to be pasted in the Process▷ Batch▷ Macro… prompt:

// Get the number of ROIs of the image overlay
nROIs = Overlay.size;

// We cannot proceed if no ROI is available (safety check)
if (nROIs==0)
exit("No ROI was found. Cannot proceed.");

// Select the last ROI of the overlay. Because we have activated the "Set stack positions" option,
// this will automatically activate the Z-slice in which the ROI was created (3D images)
Overlay.activateSelection(nROIs-1);

// We now call the plugin as detailed by the Macro Recorder. We'll set 'Ending radius' to a non-numeric
// value (NaN, "Not a Value") to make sure the maximum length for each individual image is used
run("Sholl Analysis...", "starting=10 ending=NaN radius_step=0 infer fit linear polynomial=[8th degree] semi-log normalizer=Volume create save do");


Of course you can also automate any preceding steps. However, do not forget to ensure that the center of analysis will be available when the plugin is called:

// Impose spatial calibration
run("Properties...", "unit=um pixel_width=1.5 pixel_height=1.5 voxel_depth=3.0");
// Subtract background
run("Subtract Background...", "rolling=50 sliding stack");
// Apply a favorite threshold
setAutoThreshold("Huang dark stack");
// >>>> Make sure the initial point selection remains available <<<<
Overlay.activateSelection( Overlay.size - 1 );
// Run the plugin
run("Sholl Analysis...", "starting=10 ending=NaN radius_step=0 infer fit linear polynomial=[8th degree] semi-log normalizer=Volume create save do");


That’s it. Use the Macro Recorder to generate the customizations you will need before parsing the entire folder of images with Process▷ Batch▷ Macro…

 Tip: As you may have noticed, ImageJ plugins are controlled by a single lowercase sentence in which arguments are separated by a space. Input fields and choice lists appear as ““keyword=value”” pairs, active checkboxes by a single keyword. Options that are not needed can be omitted. This makes it easier to generate customizable macros: start = 10; // variable that controls starting radius end = 200; // variable that controls ending radius step = 2; // variable that controls step size // Run the plugin run("Sholl Analysis...", "starting="+ start +" ending="+ end +" radius_step="+ step +" infer linear save do");

### Batch Analysis of Tabular Data

If you already have obtained profiles (either from previous runs or from traced cells) and would like to extract new metrics from such data, you can use the Analysis ▷ Sholl ▷ Sholl Analysis (Existing Profile)…

. Here is an example macro that runs the plugin over a folder of .csv files containing Sholl profiles produced by Simple Neurite Tracer:

distanceCol = "Radius";     // Column in .csv file listing distances
intersecCol = "Inters.";    // Column in .csv file listing intersections

dir = getDirectory("Choose the directory containing the profiles");
list = getFileList(dir);

for (i=0; i<list.length; i++) {
if (endsWith(list[i], ".csv")) {
path = dir+list[i];
run("Sholl Analysis (Existing Profile)...",
"use=[External file...] open=["+ path +"]"
+ " name=["+ list[i] +"]"
+ " distance="+ distanceCol
+ " intersections="+ intersecCol
+ " 3d enclosing=1 infer linear polynomial=[Best fitting degree]"
+ " semi-log log-log normalizer=Area/Volume show save do");
}
}


Advanced options can be set through API calls. Here are some examples:

3D analysis of an ImageStack (Python)

Reduce the number of discretization steps involved in the calculation of Nav, and Cv, Cr (IJ macro (IJM) language):

call("sholl.Sholl_Analysis.setPrecision", "100"); // Default is 1000, ie, 1/1000 of radius step size


Note that the IJM built-in call(“class.method”) function can only pass strings to Java methods. For this reason, you have to quote the passed argument. Sholl_Analysis will then parse the string argument and interpreter its value. Note that calls made by the IJM language need to be set before running the plugin and remain in effect while ImageJ is running.

## Auxiliary Commands

Analyze ▷ Sholl ▷ Combine Sholl Profiles…

<img src=”/media/CombineShollProfiles.png” title=”fig:Screenshot of 15 files being processed by Analyze ▷ Sholl ▷ Combine Sholl Profiles…

(v3.6.12)” width=”400” alt=”Screenshot of 15 files being processed by Analyze ▷ Sholl ▷ Combine Sholl Profiles…

(v3.6.12)” />

Analysis tool that 1) Merges individual Sholl profiles into a single table and 2) Obtains the average profile (with standard deviation) of a group of cells.

File ▷ Open Samples ▷ ddaC Neuron

Opens a sample image of a Drosophila class IV ddaC sensory neuron in which dendrites have been previously segmented (2D arbor). Use it to get acquainted with the plugin. Run Image ▷ Show Info…

(shortcut: press\|I ) to know more about this cell type.

Retrieves information about the plugin version and provides links to several resources including its source code repository and its API documentation. It is also accessible through the More » dropdown menu.

## FAQ

General

1. How do I cite Sholl Analysis?
The authoritative reference for *Sholl Analysis* is: - Ferreira T, Blackman A, Oyrer J, Jayabal A, Chung A, Watt A, Sjöström J, van Meyel D. (**2014**), [Neuronal morphometry directly from bitmap images](http://www.nature.com/nmeth/journal/v11/n10/full/nmeth.3125.html), *Nature Methods* 11(10): 982–984. The [authoritative reference](Citing) for Fiji: - Schindelin J, Arganda-Carreras I, Frise E, Kaynig V, Longair M, Pietzsch T, Preibisch S, Rueden C, Saalfeld S, Schmid B, Tinevez JY, White DJ, Hartenstein V, Eliceiri K, Tomancak P, Cardona A. (**2012**) [Fiji: an open-source platform for biological-image analysis](http://www.nature.com/nmeth/journal/v9/n7/full/nmeth.2019.html), *Nature Methods* 9(7): 676-682.
1. **What is the difference between *Sholl Analysis* and an homonymous plugin released by the Ghosh laboratory in 2005**?
2. The [original Sholl Analysis plugin](http://labs.biology.ucsd.edu/ghosh/software/) by Tom Maddock (version 1.0) was released for ImageJ 1.35 and is now deprecated, unmaintained software that behaves erratically in newer versions of ImageJ. The current implementation of *Sholl Analysis* inherits Tom's initial 2D algorithm, but has numerous [added features](#Release_Notes "wikilink") to enhance its utility. Note that throughout 2012 the plugin was temporarily called *Advanced Sholl Analysis*. You can follow the entire history of the plugin on GitHub .
3. **Why do I need to threshold the cell?**
4. Counting intersections is really a binary procedure: a shell either intercepts a branch or it doesn't. For this reason the image must be split in two phases: *arbor* and *background*.
5. **In version 1.0, it was not mandatory to adjust threshold values prior to analysis. Why is it now?**
6. Image segmentation has always been [required](#faq:threshold "wikilink"). In its early implementations, the program dealt solely with binary images and used the intensity at the center of the analysis to decide how to segregate objects from background. This approach was very restringent: It assumed that the pixels representing the neuron would have the same (constant!) intensity that was not to be found in the remaining background. As the program became aware of grayscale images, this "feature" had to be removed because a single intensity can no longer be used to infer which parts of the image should be analyzed.
7. **My images do not look that *great*. How can I treat them prior to analysis?**
8. Have a look at [ Pre-processing](#Pre-processing "wikilink").
9. **My bitmap profiles are different from the ones obtained from tracings of the same cells. Why?**
10. As mentioned several times, the quality of the analysis relies on how the arbor was segmented. If you are working with grayscale images you probably need to optimize your [segmentation routines](#Pre-processing "wikilink"). On the other hand, if you already obtained binary images make sure you are [interpreting them properly](#Cf._Segmentation "wikilink"). You should also confirm that [Ending radius](#EndRadius "wikilink") does not intersect objects in the image canvas that extend beyond the analyzed arbor. As a rule of thumb, always refer to the [Sholl mask](#faq:sholl-mask "wikilink") to visually inspect which regions of the image have been measured.
11. **My version is not the latest after running Help▷ Update Fiji... Why?**
12. Please note that from version 3.4.6 onwards, updates are available through the [Java-8 update site](##Fiji_Users "wikilink"). If you have manually installed/modified *Sholl\_Analysis.jar* ([Development build](#Release_Notes_and_Pre-releases "wikilink")?). Run the [Updater](Updater), choose *Advanced Mode* then *View locally modified files* under *View Options*. Type "Sholl" in the *Search* field, selecting *Sholl\_Analysis.jar* from the list of files. If the *Details pane* indicates an available update, click on *Locally modified* under *Status/Action* and choose *Install/Update*. The latest release version will be available once you press *Apply changes*. See [Installation FAQs](Frequently_Asked_Questions#Installing.2FUpdating) for more details.
13. **This documentation is not that useful. How long do I have to wait until it gets improved?**
14. Around 20 seconds. This is the time it will take you to [create an account](Help_Contents#New_accounts) on this wiki. Once you have created one, you will be able to improve this page yourself.

</ol>

Analysis

1. The plugin complains about a wrong image type. Why?
The plugin does not parse RGB images, but will process any grayscale image (8/16-bit), including multi-channel (composite) images. This is intentional: RGB images are inflexible and images of fluorescence-labeled cells are typically non-RGB images. As explained in the [ImageJ User Guide](https://imagej.net/docs/guide/), RGB images can be converted using Image ▷ Color ▷ Channels Tool... or Image ▷ Type ▷ commands.
15. **I cannot see the hemicircle/hemisphere option. Why?**
16. This option is only available if an orthogonal line has been created by holding press\|Shift when using the Straight Line Selection Tool. See the [ImageJ User Guide](https://imagej.net/docs/guide/) for the full list of key modifiers that can be used while creating straight line ROIs.
17. **With 3D and 4D images, how do I set the Z-position and of the center?**
18. The Z-position (depth) of the center of analysis is the active Z-slice of the stack. With multichannel (composite) images, the active channel also defines the C-position. Both are reported in the *Sholl Results* table.
19. **I cannot see the option to save the results. Why?**
20. The image you are trying to analyze is not saved locally. Saving it to a local directory (e.g., your Desktop or Home folder) should re-enable it.
21. **Why so many parameters?**
22. The plugin is designed for the analysis of a wide diversity of arbors and it is not biased to any particular cell type. The only way to ensure this broad applicability is to give users full control over the mathematical techniques used by the plugin to analyze sampled data.

</ol>

Results

1. How can I save/edit the Sholl Results table?
Select the table, then choose File▷ Save As…The filename extension can be specified using the *More » Options...* command (see the [ImageJ User Guide](https://imagej.net/docs/guide/) for details). Single cells cannot be modified from within ImageJ, but custom extensions (e.g., .csv, .xls or .ods) will allow the table to be imported by other spreadsheet applications.
23. **Can I modify the way data is displayed?**
24. Mostly, using Analysis ▷ Sholl ▷ Metrics & Options (also listed in the *More » Options...* shortcut), including the number of decimal places reported by the *Sholl Results* table or the usage of scientific notation. To resize plots, use the *More »* dropdown menu in the *Options* dialog.
25. **What is the *Sholl mask*?**
26. The Sholl mask ([see example of CA1 cell](#CA1CellMask "wikilink")) is simply an illustration: a maximum intensity projection of the analyzed cell in which [intersection counts](##Output_Options "wikilink") are used as pixel intensities. As explained in [Output Options](#Output_Options "wikilink"), its LUT can be modified, and intensities calibrated using ImageJ default commands. As mentioned, it can also be used to visually inspect for [segmentation artifacts](#Cf._Segmentation "wikilink").
27. **The 3D profile looks *worse* than the 2D profile of the Maximum Intensity Projection of the same cell. Why?**
28. An anisotropic voxel size will have a strong impact on [step size](#StepSize "wikilink"). On the other hand, 2D and 3D images can be sampled differently depending on the [options chosen](#Parameters "wikilink"). If Image▷ Properties… (press\|Shift\|P ) reports the appropriate spatial calibration, make sure to read [Multiple Samples and Noise Reduction](#Multiple_Samples_and_Noise_Reduction "wikilink") before deciding which type of images to use.
29. **The program terminates without warnings. What am I doing wrong?**
30. The program will not terminate without throwing an error message. However, do note that some exiting messages are displayed in the often overlooked status bar of the main ImageJ window. This is intentional, as it minimizes the frequency of modal windows popping up for each failed operation.

</ol>

Metrics and Curve Fitting

1. Would it be possible to retrieve the Area Under the Curve (linear Sholl plot)?
31. **The shape of the polynomial changes at the edges of the profile. Why?**
32. Inflection points at [starting/ending radius](#StartRadius "wikilink") are usually associated with a poor fit and/or the fact that all the radii in which no intersections were counted are ignored. The latter is required to calculate the [Sholl regression coefficient](#ShollDecay "wikilink"), as *log(0)* is undefined.
33. **None of the fitting options is suitable for my datasets. What should I do?**
34. Have a look at [Complementary Tools](#Complementary_Tools "wikilink").

</ol>

Batch Processing

1. The code that the Macro Recorder produced does not seem to work. What am I doing wrong?
It is likely that frequent interactions with the dialog prompt(s) (from which the Recorder retrieves user-specified parameters) have "confused" ImageJ. While this process is usually flawless, it may happen that repeated triggering of GUI-specific commands that are not recordable (e.g., *[Cf. Segmentation](#Cf._Segmentation "wikilink")* or *[Import Other Data](#Importing "wikilink")* buttons) may lead to an incomplete recording. The solution is to repeat the recording, while minimizing such interactions.

</ol>

Development

1. I found a bug. How do I report it?
Report it in the [ImageJ Forum](http://forum.imagej.net) or file an [issue](https://github.com/tferr/ASA/issues) on GitHub. Don't forget to include the [steps needed to reproduce the problem](Bug_reporting_best_practices). You may also want to check the release notes for the latest [development version](http://jenkins.imagej.net/job/Sholl-Analysis/lastBuild/) to see if the issue has meanwhile been addressed.

</ol>

## Release Notes and Pre-releases

Releases notes are available on Github . If you do not mind unstable software, development builds may be found here. Once new features mature and no major issues are found these development versions will be made available, as usual, through the Updater.

• Simple Neurite Tracer (SNT) The remarkable ImageJ framework for semi-automated of two- and three-dimensional tracing. SNT performs Sholl using the Sholl Analysis plugin. On the other hand, Sholl Analysis uses SNT to analyze tracings
• NeuronJ Another option for 2D reconstructions. NeuronJ features a friendly interface but is restricted to 2D images, is not capable of SWC export and is no longer under active development
• BAR, Broadly Applicable Routines that complement Sholl Analysis

## Citations

While in development (2005-2014), and prior to its publication, Sholl Analysis has been cited by several manuscripts. The manuscripts citing its 2014 publication can be retrieved using Scholar or PubMed. Below is a list of publications from authors that have made the developer aware how the program contributed to their research.

• Stanko JP, Easterling MR, Fenton SE. Application of Sholl analysis to quantify changes in growth and development in rat mammary gland whole mounts. Reprod Toxicol. 2015 Jul;54:129-35 PMID 25463529
• Kroner A, Greenhalgh AD, Zarruk JG, Passos Dos Santos R, Gaestel M, David S. TNF and increased intracellular iron alter macrophage polarization to a detrimental M1 phenotype in the injured spinal cord. Neuron. 2014 Sep 3;83(5):1098-116 PMID 25132469

TODO ambox: {"text"=>"Please append your work here, if the plugin has been useful to your work."}

## References

[8] [9] [10] [11] [12] [13]

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

[1]

[2]

[3]

[4]

[5]

[6]

[7]

[8] Ferreira TA, Iacono LL, Gross CT. Serotonin receptor 1A modulates actin dynamics and restricts dendritic growth in hippocampal neurons. Eur J Neurosci. 2010 Jul;32(1):18-26. PMID: 20561047

[9] Sholl DA. Dendritic organization in the neurons of the visual and motor cortices of the cat. J Anat. 1953 Oct;87(4):387-406. PMID: 13117757

[10] Ristanović D, Milosević NT, Stulić V. Application of modified Sholl analysis to neuronal dendritic arborization of the cat spinal cord. J Neurosci Methods. 2006 Dec 15;158(2):212-8. PMID: 16814868

[11] Schoenen J. The dendritic organization of the human spinal cord: the dorsal horn. Neuroscience. 1982;7(9):2057-87.PMID: 7145088

[12] Milosević NT, Ristanović D. The Sholl analysis of neuronal cell images: semi-log or log-log method? J Theor Biol. 2007 Mar 7;245(1):130-40 PMID: 17084415

[13] Brown KM, Barrionuevo G, Canty AJ, De Paola V, Hirsch JA, Jefferis GS, Lu J, Snippe M, Sugihara I, Ascoli GA. The DIADEM data sets: representative light microscopy images of neuronal morphology to advance automation of digital reconstructions. Neuroinformatics. 2011 Sep;9(2-3):143-57, PMID: 21249531