Common Tracing Output Format

From FarsightWiki
Jump to: navigation, search



In this page we describe a common output format for tracing algorithms in FARSIGHT. This applies to images with tubular-shaped structures such as micro blood vessels, neuronal arbor (with or without soma(s)) or spiny neuronal dendrites. In an effort to promote standardization, this format complies with SWC [1]. For the output of any tracing program to be readable by FARSIGHT, compliance with this specification is necessary. The final output has to be in XML.

SWC Format

This format is described in detail in Ascioli et al.'s work.[1] The image topology has to be preserved regardless of the tracing method. Moreover, because each tracing algorithm may produce different ordering of center-points, identifying soma and/or branch points remains the only anchors that preserve the global topology. Therefore, any available soma or branch points are assumed to be segmented as part of the algorithm output. The topology is maintained by using directional connections between the anchor points and the traced structures.

Every SWC line (representing a dendrite, blood vessel, or a part thereof) is a potential parent and has
  1. a unique ID (1st column or field) within its type
  2. a type descriptor (2nd column T: 1=Soma, 3=dendrite)
  3. the x,y,z coordinates of the starting point
  4. a Connectivity index (to which this segment is connected in a direction leading to the tree top
    • The tree top is either the soma (if available) or the starting line.
    • The tree top has type= 1 and connectivity index= -1
    • A tracing segment may connect back to the top (ID=1) or to another segment via its ID.


The tracing algorithm is assumed to segment / detect the following structures (whenever applicable) and include them in the output:

  • soma and its branches
  • dendritic branch points accurate to the tracing segment resolution
  • dendritic spines

Tracing Output in Compliance with SWC

  1. The soma (if present) is considered the highest in the structural hierarchy. It is listed with type=1, and connectivity=-1, its centroid coordinates and radius.
  2. Next comes the traceline (also blood vessel or dendrite) listed with its ID, connectivity to its parent ID (the top parent=-1 if no soma is available), and type=3. The coordinates are given by its children listed right after it.
  3. The traceline children are the tracebits (trace points or center-line points). They are listed with their parent type and ID, x,y,z coordinates. The tracing algorithms in FARSIGHT may list more tracebit details than the minimal SWC requirements such as radii, orientation, foreground intensity ...
  4. Dendritic spines: FARSIGHT's spine segmentation algorithms associate a tracebit with every spine and provide the spine center-lines as part of the output. We decided to utilize this conveniently and treat spines as regular branches from tracelines whereas the branching point is the tracebit associated with each spine.

Hence, a spine is represented as a traceline of type=5 and whose tracebits are its center points.

  1. Because of the above spine representation, the dendrite will be chopped into many tracelines each one possibly terminating at a spine protrusion. This does not deform the topology because all the structures are directionally linked to their parents and on to the tree top.



Sample XML

File header
<?xml version="1.0" encoding="ISO-8859-1"?>
<Trace Filename="sp1test.xml">
First traceline (no soma here)
<TraceLine ID="1" Type="1" Parent="-1">
<TraceBit ID="1" X="0.84"  Y="267.63" Z="20.90"/>
<TraceBit ID="2" X="3.38"  Y="266.64" Z="21.00"/>
</TraceLine> <!--Dendrite ID=1-->
A spine happens to protrude from the last tracebit
<TraceLine ID="2" Type="5" Parent="1">
<TraceBit ID="1" X="3.68"  Y="266.16" Z="21.00"/>
<TraceBit ID="2" X="6.13"  Y="268.62" Z="21.00"/>
<TraceBit ID="3" X="8.59"  Y="271.07" Z="22.00"/>
<TraceBit ID="4" X="9.81"  Y="273.52" Z="22.00"/>
<TraceBit ID="5" X="11.04"  Y="275.98" Z="22.00"/>
<TraceBit ID="6" X="12.27"  Y="278.43" Z="21.00"/>
<TraceBit ID="7" X="13.49"  Y="280.88" Z="21.00"/>
<TraceBit ID="8" X="13.49"  Y="283.34" Z="21.00"/>
<TraceBit ID="9" X="14.72"  Y="285.79" Z="21.00"/>
<TraceBit ID="10" X="14.72"  Y="288.24" Z="21.00"/>
</TraceLine> <!--Ending Spine ID=2-->
<TraceLine ID="3" Type="1" Parent="1">
<TraceBit ID="1" X="6.17"  Y="265.45" Z="21.19"/>
</TraceLine> <!--Dendrite ID=3--> 


  1. 1.0 1.1 Giorgio A. Ascoli, Jeffrey L. Krichmar, Slawomir J. Nasuto, Stephen L. Senft. "Generation, Description and Storage of Dendritic Morphology Data", Philosophical Transactions: Biological Sciences, Vol. 356, No. 1412, Neuroscience Databases: Tools for Exploring Brain Structure-Function Relationships (Aug. 29, 2001), pp. 1131-1145
Personal tools