Page 1 of 1

### how to calculate section area

Posted: Mon Aug 27, 2018 5:29 am
Hello,
I'd like to calculate areas of different sections. I've read the documentation and searched through the forum but it remains unclear to me.

How do I use the the area () command ?

I loaded a hoc file with full morphology then

I tried this :

Code: Select all

``````soma {
surface= area(0.5)
print surface }

axon  {
surface2= area(0.5)
print surface2 }
``````
It doesn't work

Thanks a lot

### Re: how to calculate section area

Posted: Mon Aug 27, 2018 10:54 am
Works for me. After starting NEURON I entered two lines of text and got the expected result.

Code: Select all

``````oc>create soma
oc>soma { surface = area(0.5)
>	oc>print surface }
157079.63
oc>``````
Try it.

What might be happening in your case? Try this:
1. start NEURON
2. load your "hoc file with full morphology"
3. at the oc> prompt execute the command
forall print secname()
just to make sure that the sections exist.

### Re: how to calculate section area

Posted: Mon Aug 27, 2018 11:25 am
Hello Ted,

Actually you're right; it works as it should. I mixed up with section names. Sorry for bothering....

Acting fast is sometimes the enemy of thinking !!!!

Thanks a lot

### Re: how to calculate section area

Posted: Tue Aug 28, 2018 10:51 am
Hello again,

I have a soma : L= 31 diam = 10
So according to I learned at school, the surface of a cylinder S= PI*diam*L (if we neglect the disk surfaces).

With neuron I got :

Code: Select all

``````oc>soma {print L}
31
oc>soma {print diam}
10
oc>soma {print area(0.5)}
324.63124
``````
By hand I got 3.14*10*31 = 31.4*31= 973.4

What's the problem ?

I have three nseg for the soma, so I guess that the problem since 973.4/324.63 = 3 . How do I get the full area ? I tought I could mutilply by nseg :

Code: Select all

``````oc>soma {sur= area(0.5)*nseg}
oc>print sur
973.89372 ``````
It works but what about dendrites with tapering , it would overestimate the area ?

Thanks a lot

### Re: how to calculate section area

Posted: Tue Aug 28, 2018 11:35 am
totalarea = 0
soma for (x,0) totalarea += area(x)

### Re: how to calculate section area [SOLVED]

Posted: Tue Aug 28, 2018 11:44 am
Thanks a lot