ZEISS Knowledge Base
Help
ZEISS Knowledge Base

Detecting dendritic spines (Segments)

Introduction

The guide explains you how to trace dendritic spines using the Spine Tracer operation included in the Tracing module. The operation provides 3 methods (AI-assisted, Use Segments and Use Probability Map) to detect and connect dendritic spines to an already existing trace. This guide focuses on the segments method.

Demo dataset

The data set is a multi-dimensional, discrete representation of your real sample volume. It can be structured as a z-series of planes (optical slices) of multiple channels (dyes) in a temporal sequence of time points located at multiple spatial positions. Usually, the dataset shows a single experimental situation. A complete experiment can be composed by several datasets. The datasets are available as graphic files saved in plenty of file formats (standard formats as well as proprietary formats).

The link for the specific demo dataset for this guide is displayed below. All datasets are listed here: https://demodata.arivis.com

Downloading demo dataset

  1. To download the demo dataset, click https://demodata.arivis.com/data/arivisPro-DemoData-SamplePipelines-SpineTracer.zip (1).
  2. The download is starting automatically.
  3. Create a new folder on your local disk. Move the *.zip file from the download folder inside it.
  4. Unzip the folder.

(1) Fernholz, Martin H. P. and Guggiana Nilo, Drago A. and Bonhoeffer, Tobias and Kist, Andreas M. "DeepD3, an open framework for automated quantification of dendritic spines", PLOS Computational Biology, 2024

Pipeline operations layout

The following operations are part of the pipeline.

Input ROI

This operation allows to select the region of interest (ROI). ROI defines the dataset subarea that will be processed and analyzed by the pipeline.

Input ROI parameters

Parameter

Description

ROI

Sets the processing and analysis target space.

Current View

The selected Z plane and the viewer area are processed.

Current Plane

The selected Z plane is processed (XY).

Current Time Point

The selected time point is processed (XYZ).

Current Image Set

The complete dataset (XYZ and time) is processed.

Custom

Allows to mix the previous methods.
Note: Use the Custom option during the pipeline setting and testing. Set a sub volume (XY, Planes, Time Points, channels) of your dataset on which perform the trial. This will speed up the setting process.

Channels

Sets the processing and analysis target channels. Selecting a single channel, all the operations in the pipeline will be forced to use it.

Scaling

Sets the scaling of the dataset, which reduces it size. The measurements will not be modified by the scaling factor

Crop input data

Sets the limitation of the data used for the calculation to only the cropped selection defined above. If this option is not selected, the entire image set is used for the calculation.

Additional Parameters

Additional settings for Input ROI expand, when you click in the operation.

Parameter

Description

Bounds

Sets the analysis area edges. The whole XY bounds, the viewing area or a custom space can be applied.

Planes

Sets the analysis planes range. A single plane, a range of planes or the whole stack can be selected.

Time Points

Sets the analysis time points range. A single time pint, a range of time points or the whole movie can be selected.

Neurite Tracer

Automatic tubular-like structures detection based on the threshold-based reconstruction algorithm.

Deep Learning Segmenter

The Deep Learning Segmenter Operation allows you to run a segmentation operation using a trained DL model (Semantic or Instance) on any dataset.

Deep Learning Segmenter parameters

Parameter

Description

Model source

Sets the type of model to be used. Each has a set of settings which need to be properly adjusted to get the best result.

ONNX or CZANN model

Option to use locally saved 2D ONNX-based Deep Learning models (semantic):

ONNX: any compatible ONNX model including ONNX zoo models which use ONNX opset version 12 and lower (opset 7).

Zeiss DL models: including CZMODEL and CZANN

arivis Cloud AI model store

Option to use a DL instance segmentation model from the list of downloaded models from arivis Cloud AI model store.

Model

Sets a DL model to be used. The operation will extract all necessary info from the loaded model and update the UI accordingly.

Note: To select an ONNX or CZANN model, click or paste the path in the text field

Note: To access the arivis Cloud AI model store, click . Download the models and click to refresh the list of models available.

Channels

Select the channels that will be used for analysis. Channels are available based on the selected model and its input shape

Outputs

Sets the output of the Operation.

Note: click on to select the desired output(s).

Additional Parameters

Additional settings for the Deep Learning Segmenter expand when you click in the operation. The following parameters are only available for ONNX or CZANN model sources.

Parameter

Description

Normalization

Sets a normalization range to be applied on the data before inference.

Full range

Full range uses the intensity range of the input data pixel type, e.g. for 8bit it is [0,255].

Data range

Data range uses the minimum and maximum values of in-put data over all timepoints.

Data range per timepoint

Data range per timepoint, uses the minimum and maximum values of input data per timepoint.

Manual

Manual allows users to select any desired range using the picker to be used for all channels and timepoints.

Customize model settings

Select this checkbox to be able to modify specific model parameters. Otherwise, default values are used.

Min overlap

Sets a minimum voxel count for overlapping tiles used in the model. The default values are extracted from the loaded model and are zero if no value has been defined in the metadata.

Input range

Sets the intensity range. The default range is between 0 and 1. Change this range to match the trained model.

Prediction range

Sets the range to match the output of the trained model. The de-fault range is considered to be between 0 and 1.

Apply tile blending

Applies smoother transition between the results of two tiles and reduces the tiling artifacts.

Spine Tracer

The Spine Tracer operation is used to detect dendritic spines on a neuron trace. The operation is based on the trace model and requires a trace object as input.

Spine Tracer parameters

Parameter

Description

Method

Sets the method for tracing spines. Each has a set of settings which need to be properly adjusted to get the best result.

AI-assisted

This method uses a pre-trained Deep Learning Model (DeepD3) to detect spine heads and then trace them to the neurite.

In details, the deep learning model processes the intensity channel to create a probability map of the spines on which the spine heads will be detected. The intensity data is then used to connect the found spine heads to the trace by going along the neck.

Use Segments

This method uses segments created by a previous operation as spines (e.g. Blob Finder, Deep Learning Segmenter or imported in the pipeline via Import Document Object Operation).

The provided objects are not modified by this operation or connected to the trace. Instead, they are used as starting points for the spine tracing to create new approximations of the spines. The intensity data is then used to connect the provided spine heads to the trace by going along the neck..

Use Probability Map

The method is very similar to the AI-assisted method, but instead of using the built-in deep learning model to create the probability map, you must provide a pre-calculated probability map. A probability map can be created with an Image Processing operation, for example Machine Learning Probability or Deep Learning Reconstruction.

Input

 

Traces

Select an already existing neuron or neurite traces of a preceding Operation, e.g. Neuron Tracer or Import Document Objects to which the spines will be connected.

Channel/ Trace channel

Sets Intensity data where neurons and spines (necks) are visible.

Note: Trace channel is only available if Use Segments and Use Probability Map is selected.

Spine Segments

Sets segments representing the spine heads to be connected to the traces. The segments can be created with any of preceding operations or imported.

Note: Spine Segments is only available if the Use Segments method is selected.

Probability map

Sets pre-calculated image data of the spine heads (probability Map). The image should have high intensity values where the spine heads are. A probability map can be created with an Image Processing operation, for example Machine Learning Probability or Deep Learning Reconstruction.

Note: Probability map is only available if the Use Probability Map method is selected.

Parameters

 

Max. spine length

Sets the maximum distance from the spine head center to the trace along the neck. Spines that are longer are discarded.

Note: Increasing this parameter will increase the runtime since a larger area is scanned for spines.

Note: You can use the Measurements tool to determine the value.

Additional Parameters

Additional settings for the Spine Trace Segmenter expand when you click in the operation.

Parameter

Description

Head threshold

Sets Threshold to detect the spine heads on the probability map found by the deep learning model used.

Note: Higher values will result in fewer voxels being classified as spines and vice versa. This does not necessarily mean that lower values result in more spines, since two small spine heads can be merged into one by reducing the threshold, if they are close enough.

Note: Head threshold is only available if AI-assisted and Use Probability Map is selected.

Max. overlap

Sets max limit of overlap for the segments with the trace. Segments that have more overlap with the trace are discarded.

Note: Max. overlap is only available if the Use Segments method is selected.

Head size range

Sets the range by size of spine heads to be connected to the trace. Heads that do not fit into the range are discarded.

Note: Head size range is only available if AI-assisted and Use Probability Map is selected. For Use segments it is possible to use before Operations like Object Feature Filter.

Note: You can use the Measurements tool to determine the value.

Executing the pipeline

You can execute the pipeline step by step or in a single run. To do this, use the executing buttons in the Pipeline toolbar.

Executing Buttons in the Pipeline toolbar
Executing Buttons in the Pipeline toolbar

Executing step by step

You can execute the pipeline step by step (back and forth). This method allows to run and undo a single operation. You can either use the executing buttons in the Pipeline toolbar or in the Operation toolbar to go through the operation list.

  1. To run the single operation, click .
  2. To undo the single operation, click .
    Note: Undo the last operation executed if you need to change the operation settings.

Operation status

Executing buttons in the Operation toolbar after executing
Executing buttons in the Operation toolbar after executing

When the operation is running, this icon is shown.

When the operation is completed, this icon is shown.

Viewing the results

  1. If not already visible, open the Objects dialog. In Shortcut Toolbar, click Objects table .
  2. Measurements are now visible in the objects table.
  3. To color the results more meaningfully, click Set Object Style.
  4. Click Apply to: Traces.
  5. To select the trace color options, select one item from the Color by list.

  6. To set further style settings, set the parameters in the Visualization section.

Refer to the Help (F1) for more Information.

Modifying the current pipeline

You can modify the pipeline to adapt to another datasets. Therefore, all the pipeline parameters should be set according to the new dataset features.

Previewing the results

For all operations the preview is available in 2D, for some also in 3D.

  1. Switch from 2D Viewer to 4D Viewer in the Viewer Type Switch.
  2. To preview the operation results, click Preview in the Operation toolbar.

Use the Navigator panel in the Panel Sidebar to select the preview z plane and/or time points.

Adjusting the operations

The parameters of each operation are described here: Pipeline operations layout

  1. You have opened the pipeline.
  1. Go to the operation you want to change.
  2. Set the appropriate parameters as desired.
  3. Execute the pipeline (see Executing the pipeline).

Adding or removing operations

You can add or remove operations from the sample pipeline.

  1. Click + Add operation...
  2. The operation list is grouped in four groups by their typology.
  3. To add the operation to the current pipeline, double-click it. Alternatively, drag & drop the operation to the current Pipeline.
    Note:
    The operation cannot be added during the Pipeline execution.
  4. The operation will be inserted at the end of the group of operations to which it belongs.
    Voxel operations are positioned before the segment generation. Store operations are always put at the end of the Pipeline.
  5. To remove an operation, click Close at the Operation toolbar.
Impressum
Carl-Zeiss-Strasse 22
73447 Oberkochen
Germany
Legal