Constructed Tessellated Neuronal Geometries (CTNG) (McDougal et al. 2013)

 Download zip file 
Help downloading and running models
Accession:146950
We present an algorithm to form watertight 3D surfaces consistent with the point-and-diameter based neuronal morphology descriptions widely used with spatial electrophysiology simulators. ... This (point-and-diameter) representation is well-suited for electrophysiology simulations, where the space constants are larger than geometric ambiguities. However, the simple interpretations used for pure electrophysiological simulation produce geometries unsuitable for multi-scale models that also involve three-dimensional reaction–diffusion, as such models have smaller space constants. ... Although one cannot exactly reproduce an original neuron's full shape from point-and-diameter data, our new constructive tessellated neuronal geometry (CTNG) algorithm uses constructive solid geometry to define a plausible reconstruction without gaps or cul-de-sacs. CTNG then uses “constructive cubes” to produce a watertight triangular mesh of the neuron surface, suitable for use in reaction–diffusion simulations. ..."
Reference:
1 . McDougal RA, Hines ML, Lytton WW (2013) Water-tight membranes from neuronal morphology files. J Neurosci Methods 220:167-78 [PubMed]
Model Information (Click on a link to find other models with that property)
Model Type: Neuron or other electrically excitable cell;
Brain Region(s)/Organism:
Cell Type(s):
Channel(s):
Gap Junctions:
Receptor(s):
Gene(s):
Transmitter(s):
Simulation Environment: NEURON; C or C++ program; Python; Cython;
Model Concept(s): Methods;
Implementer(s): McDougal, Robert [robert.mcdougal at yale.edu];
/
ctng
geometry3d
readme.txt
ctng.py
                            
#! /usr/bin/python

import sys

filename_out = None

try:
    filename = sys.argv[1]
except:
    print 'run as: "python %s FILENAME_IN [FILENAME_OUT] [dx] [nouniform]"' % sys.argv[0]
    print 'if the last argument is nouniform, CTNG will not force a unique diameter at each point'
    sys.exit(-1)

lastarg = sys.argv[-1]
if lastarg == 'nouniform':
    nouniform = True
    dx_loc = -2
else:
    nouniform = False
    dx_loc = -1

try:
    dx = float(sys.argv[dx_loc])
    has_dx = True
except:
    # default discretization
    dx = 0.25
    has_dx = False

if len(sys.argv) > 3 or (not has_dx and len(sys.argv) == 3):
    filename_out = sys.argv[2]

from neuron import h
from mayavi import mlab
import geometry3d
import time

h.load_file('stdlib.hoc')
h.load_file('import3d.hoc')

if filename.lower()[-4:] == '.swc':
    cell = h.Import3d_SWC_read()
else:
    cell = h.Import3d_Neurolucida3()
cell.input(filename)

start = time.time()
tri_mesh = geometry3d.surface(cell, dx, n_soma_step=100, nouniform=nouniform)
mlab.triangular_mesh(tri_mesh.x, tri_mesh.y, tri_mesh.z, tri_mesh.faces, color=(1, 0, 0))
print 'time to construct mesh:', time.time() - start

start = time.time()
area = tri_mesh.area
print 'area: ', area
print 'time to compute area:', time.time() - start

start = time.time()
vol = tri_mesh.enclosed_volume
print 'volume: ', vol
print 'time to compute volume:', time.time() - start


if filename_out:
    triangles = tri_mesh.data
    with open(filename_out, 'w') as output:
        output.write('%d, %g\n' % (len(triangles), area))
        for i in xrange(len(triangles) / 9):
            output.write('%g, %g, %g,    %g, %g, %g,    %g, %g, %g\n' % tuple(triangles[i : i + 9]))


mlab.show()     


Loading data, please wait...