Spine Analyzer - MontpellierRessourcesImagerie/imagej_macros_and_scripts GitHub Wiki

The tools allow to semi-automatically segment dendritic spines in 3D+t images and to measure their volumes and the intensities of the signal within in different channels over time.

dendritic-spines

You can find the source code in git-hub here.

Getting started

You must have MorphoLibJ installed.

To install the tool download the file spine_analyzer.ijm and put it into the folder macros/toolsets of your FIJI installation. In FIJI, select the spine_analyzer-toolset from the more tools button >>. On the toolset, click on the Install or Update Tool (the rightmost tool of the toolset).

Note: In case you do not have jython installed the first time you run the installation, only jython will be installed. You then have to retsart FIJI and click on the Install or Update Tool again.

After the installation finished, restart FIJI. Select the spine_analyzer-toolset from the >>-button of the ImageJ launcher.

image

  • the first button opens this help page
  • the s-button runs segmentation of a spine within a region of interest (ROI)
  • the pipette-tool allows to select the label of a spine for the usage with the bucket-tool
  • the bucket-tool replaces the label of a spine in a frame with the selected label (select the background to remove a spine in a frame)
  • the next button adds a dendrite, on a frame, defined by a polyline-roi
  • the first tacking-button tracks the dendrites
  • the second tracking-button tracks the spines and gives the same label to a spine in different frames
  • the paper-clip button attaches spines to the closest dendrite
  • the next button allows to measure the spines in the image
  • the last button allows to install or update the spine-analyzer

Usage

The first step is to add dendrites and to track them in the different frames. Once that is done, you can segment spines, track them over time and attach them to the closest dendrite. The last step is to measure the volume and intensity of the spines in different channels over time.

Adding and tracking dendrites

Make a polyline selection on the center of a dendrite, then press the Add Dendrite`- button [F6]``. The first time you do this, the operation will take longer than usual, because the image will be initialized for the tool. Subsequent operations will be faster.

Go to the next frame and repeat the procedure. Then repeat for the next dendrite. Once you added all incarnations of all dendrites you're interested in, press the Track Dendrites-button. The same dendrite on different frames should be displayed in the same color after the tracking.

Hint: If you want to copy a dendrite from one frame to another, choose the rectangle roi tool and click on the roi of the dendrite in the source frame. Change to the target frame. Press ctrl+a followed ctrl+e. You now have a new selection corresponding to the original one on the new frame. You can move it around as a whole using the arrow-keysof your keyboard and you can modify the individual points using the handles. Once done modifying, press the Add Dendrite-button.

Options

image

  • the maximum distance a dendrite can move between two frames in physical units

Segmentation of Spines

Use the freehand selection tool to make a selection around a spine. Make sure the spine is completely inside of the selection on all slices. Then press the s-button to segment the spine in 3D on the current frame.

image image

Repeat the procedure for the next frame. Do the same for all other spines on the selected dendrites. Then press the Track Spines-button and finally the Attach Spines-button to attach each spine to its closest dendrite.

If necessary you can restrict the segmentation of a spine to a sub-stack between a first and last slice. You can set the first slice to the current slice using the keyboard-shortcut 1. To set the last slice to the current slice, use the keyboard-shortcut 2. The sub-stack remains active, until you reset it using the keyboard-short 0.

Options

image

Spine Segmentation Channel (0 for active)
the channel used for the segmentation of the spines
Threshold
the threshold value used for the segmentation of the spine, if the value is 0 an auto-thresholding method is used
Auto-Thresholding Method
the auto-thresholding method used to segment the spines within the roi given by the user
Lookup Table
the lookup table used to display the labels of the segmented spines
Start Slice (0 for first)
If different from zero, the segmentation of the spines is restricted to the slices between start-slice and end-slice. The keyboard shortcut for this is 1. 2 sets the end-slice and 0 resets both options to 0.
End Slice (0 for last)
If different from zero, the segmentation of the spines is restricted to the slices between start-slice and end-slice. The keyboard shortcut for this is 1. 2 sets the end-slice and 0 resets both options to 0.
Label for next spine segmentation
The label that will be used for the next spine segmentation.

image

  • the maximal distance between the centers of a spine in two different frames

Editing the segmentation of the spines

You can manually change the label of a spine in a frame. To do so, first select the new label for spine. To select the new label use the pipette-tool. You can either set the new label in the options of the tool or with the pipette-tool activated click on an existing label. Then activate the bucket tool and click on the label you want to replace.

By selecting the background, i.e. the label zero, as the new label, you can delete a label in a frame.

Options

image

  • the selected label, it will be used as the new value by the bucket-tool

image

  • in "selected label"-mode the bucket-tool will replace a label by the currently selected label while in "next label"-mode it will replace a label by the next unused label, i.e. the maximum of the existing labels plus one.

Results

Before pressing the Measure button, make sure that you attached the spines to the dendrites by pressing the Attach Spines button. Two results tables will be shown. One containing the length of each dendrite in each frame, its number of spines and the spine density. The other one showing the measurements (volume and intensity in each channel) for each spine per frame.

image

image

Options

image

Show Dendrite Measurements
If selected the features of the dendrites, like length and spine density are measured. The dendrites must have been tracked and the spines must have been attached to the dendrites.
Show Spine Measurements
If selected the spines attached to a dendrite a measured. The dendrites must have been tracked and the spines must have been attached to the dendrites.
Show All Spine Measurements
If selected all spines are measured, independent of their attachment to a dendrite. It is enough to have the spines tracked or created with consistent labels across the frames for this to work.
⚠️ **GitHub.com Fallback** ⚠️