Generation of granule cell dendritic morphology (Schneider et al. 2014)

 Download zip file 
Help downloading and running models
The following code was used to generate a complete population of 1.2 million granule cell dendritic morphologies within a realistic three-dimensional context. These generated dendritic morphologies match the known biological variability and context-dependence of morphological features.
1 . Schneider CJ, Cuntz H, Soltesz I (2014) Linking macroscopic with microscopic neuroanatomy using synthetic neuronal populations. PLoS Comput Biol 10:e1003921 [PubMed]
Citations  Citation Browser
Model Information (Click on a link to find other models with that property)
Model Type: Dendrite;
Brain Region(s)/Organism:
Cell Type(s): Dentate gyrus granule GLU cell;
Gap Junctions:
Simulation Environment: MATLAB;
Model Concept(s): Detailed Neuronal Models;
Search NeuronDB for information about:  Dentate gyrus granule GLU cell;
%% Create Grid of Packed Somata and Select Those That Lie Within GCL

function dentate_1_s_fillsomata()

% Define parameters
SomaSize    =   15.79;
Kepler      =   pi / (3 * sqrt (2));

% Create granule cell layer surface
[x_g1,y_g1,z_g1]    = layer_eq_GCL(-1.95);
[x_g2,y_g2,z_g2]    = layer_eq_GCL(-1.0);
[x_g3,y_g3,z_g3]    = layer_eq_GCL(0);
X_g                 = [x_g1;x_g2;x_g3];
Y_g                 = [y_g1;y_g2;y_g3];
Z_g                 = [z_g1;z_g2;z_g3];
[~,S_g]             = alphavol([X_g(:),Y_g(:),Z_g(:)],120);

% Define limits for granule cell somata grid
xmin    =   -3200;
xmax    =   3200;
ymin    =   -500;
ymax    =   4200;
zmin    =   -600;
zmax    =   1300;

% Round limits to nearest multiple of soma size
xmax2    = round((xmax-xmin)/SomaSize)*SomaSize + xmin;
ymax2    = round((ymax-ymin)/SomaSize)*SomaSize + ymin;
zmax2    = round((zmax-zmin)/(Kepler*SomaSize))*(Kepler*SomaSize) + zmin;
zlayers  = ((zmax2-zmin)/(Kepler*SomaSize));

% Create square packed somata within limits
xlin        = linspace(xmin,xmax2,(xmax2-xmin)/SomaSize);
ylin        = linspace(ymin,ymax2,(ymax2-ymin)/SomaSize);
zlin        = linspace(zmin,zmax2,zlayers);
[xx,yy,zz]  = meshgrid(xlin,ylin,zlin);
M           = [reshape(xx,[],1),reshape(yy,[],1),reshape(zz,[],1)];

% Shift every other z-layer to create hexagonal packing
xycells     = length(xlin)*length(ylin);
SomataGrid  = M(:,:);
for counter = 2:2:zlayers
    startpt                     = xycells*(counter-1) + 1;
    endpt                       = xycells*counter;
    SomataGrid(startpt:endpt,:) = [M(startpt:endpt,1)+(SomaSize/2),M(startpt:endpt,2),M(startpt:endpt,3)];

% Test whether somata lie within GCL and choose only those with centers inside GCL volume
IN_somata  = inpolyhedron(S_g.bnd,[X_g,Y_g,Z_g],SomataGrid,'FLIPNORMALS','True');
Somata     = SomataGrid(IN_somata,:);

% Save somata to file