Populate Nerves/Fascicles with Axon Trajectories
-
The Python interface can be used to automatize the creations of axonal trajectories within nerves/fascicles to execute EM-Neuronal simulations.
For example, let's assume that the user wants to populate a cylindrical fascicle with R=1mm and L=100mm with N=100 axonal trajectories randomly distributed. In order to maintain the 'Model' panel clean, a 'Axonal Trajectories' folder is created as well.
The following code does the job:import s4l_v1 as s4l import numpy as np from s4l_v1 import Vec3 # Parameters definition R=1 # Radius (mm) L=100 # Length of the cylinder (mm) N=100 # Number of axons ## Creates a folder in the Model Panel folder=s4l.model.CreateGroup('Axon Trajectories') # Initialization points=[]; cnt=0 while cnt<N: # Creates Randomly Distributed Points in the cross section x=2*R*(-0.5+np.random.rand()); y=2*R*(-0.5+np.random.rand()) # only the axons within the cylinders are taken if (x*x+y*y<R*R): pin=Vec3(x,y,-0.5*L); pend=Vec3(x,y,-0.5*L) axon=s4l.model.CreatePolyLine([pin,pend]) axon.Name='Axon_'+str(cnt) folder.Add(axon) cnt+=1The code can be modified to permit arbitrary distributions of fibers within the fascicle entity.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login