Distance transform


This workflow detects spots in a 2D image by filtering the image by Laplacian of Gaussian (user defined radius), thresholding (user defined threshold) and finding local intensity maxima in mask distance map (Dmap).

need a thumbnail

We have developed a novel approach, named DF-Tracing, to tackle this challenge. This method first extracts the neurite signal (foreground) from a noisy image by using anisotropic filtering and automated thresholding. Then, DF-Tracing executes a coupled distance-field (DF) algorithm on the extracted foreground neurite signal and reconstructs the neuron morphology automatically. Two distance-transform based “force” fields are used: one for “pressure”, which is the distance transform field of foreground pixels (voxels) to the background, and another for “thrust”, which is the distance transform field of the foreground pixels to an automatically determined seed point. The coupling of these two force fields can“push” a “rolling ball” quickly along the skeleton of a neuron, reconstructing the 3D cell morphology.

Simple Tracing - DT-fields

All-path-pruning 2.0 (APP2) is a component of Vaa3D. APP2 prunes an initial reconstruction tree of a neuron’s morphology using a long-segment-first hierarchical procedure instead of the original termini-first-search process in APP. APP2 computes the distance transform of all image voxels directly for a gray-scale image, without the need to binarize the image before invoking the conventional distance transform. APP2 uses a fast-marching algorithm-based method to compute the initial reconstruction trees without pre-computing a large graph. This method allows to trace large images. This method can be used with default parameters or user-defined parameters.


A simple workflow is described in the following for measuring subcellular localizations of organelle by the distance from the nucleus. For example, you can quantify how far some type of vesicles or protein aggregates are apart from the nucleus border. This workflow is for analyzing 3D data.

Data requirements:

  • 3D data, 2 channels
  • Channel 1: nucleus stain = Channel 2: stain for marker you want to quantify the distance to nucleus for


  1. Nucleus detection: Imaris
  • Add a new SURFACE object, name it "nuclei"
  • Follow the object detection wizard to segment nucleus objects
  1. Marker object detection: Imaris
  • Add a new SURFACE object
  • Follow the object detection wizard to segment nucleus objects
  1. Creating of distance map channel: Imaris
  • In the image processing menu, go to SurfacesFunctions>>Distance Transformation
  1. MATLAB:
  • select nucleus objects and "distance outside objects"
  • A new image channel should be created now by the Matlab script
  1. Distance measurement
  • The generated distance map channel represents the distance from the nucleus border in pixel values. Thus, the distance of an organelle from the nucleus is equivalent to its mean gray value of the distance map channel.
    For distance measurement, just export the mean gray value of the distance channel for each object.

** Please note:**
In the described workflow, the distance is always calculated to the closest nucleus border. This could be also the nucleus of a neighboring cell, which generates some error. A more complex approach to avoid this error would incorporate a cell segmentation step to assign certain organelle objects to certain cells. Therefore, a cell region marker is needed.

has function
need a thumbnail