BlueBrain / morph-tool

https://morph-tool.readthedocs.org/
GNU Lesser General Public License v3.0
8 stars 7 forks source link

Feat: Ensure area is same as nrn for point swc soma #126

Closed arnaudon closed 9 months ago

arnaudon commented 9 months ago

Context

For emodel, if we convert swc to asc, neuron does not read the same soma surface area, hence the model behave differently.

Resolution

It is quite hard to find a correction factor from asc loader (swc is just area = 4 pi R^2), hence we do a simple optimisation.

adrien-berchet commented 9 months ago

Isn't it possible to compute it analytically if we know how Neuron compute the surface?

arnaudon commented 9 months ago

I let you try it :P

adrien-berchet commented 9 months ago

I let you try it :P

Don't push me :stuck_out_tongue_winking_eye: (I will have a quick look :innocent: )

arnaudon commented 9 months ago

but I think it is really hard, nrn discretizes a contour then makes it a bunch of cylinder, I'm not even sure where the difference come from, I tried to use fine discretisation, and it does not convert to the same surface area... But anyway, this is a niche usecase for ppl wanting to preserve soma surface area for models (as vignan in this case, or for darshan if I remember well).

adrien-berchet commented 9 months ago

but I think it is really hard, nrn discretizes a contour then makes it a bunch of cylinder, I'm not even sure where the difference come from, I tried to use fine discretisation, and it does not convert to the same surface area... But anyway, this is a niche usecase for ppl wanting to preserve soma surface area for models (as vignan in this case, or for darshan if I remember well).

It's a niche but I feel like we should actually always ensure this in order to be sure that the morphology can be used with all BBP tools.

arnaudon commented 9 months ago

its really niche to preserve emodel optimized before curation, etc... In normal bbp 'way', one converts these morph first, then optimize models, so this hack is not needed. It is needed only because vignan uses emodel from external collabs, which used point soma swc files, and after converting to .asc (or h5 I think), it changes the soma area a little bit (see the test for example), and makes the emodel behave differently ( because he also was unlucky to have an emodel quite sensitive to soma surface area, which is not always the case). I would really not try to do this analytically, given the short remaining lifetime of bbp ;)

adrien-berchet commented 9 months ago

Ah ok, I see.It's a real niche then :)