axon_packer

nrv.nmod.utils.axon_packer(diameters: ndarray, y_gc: float32 = 0, z_gc: float32 = 0, delta: float32 = 0.5, n_iter: int32 = 20000, v_att: float32 = 0.01, v_rep: float32 = 0.1, monitor=False, monitoring_Folder='', n_monitor=200)[source]

Axon Packing algorithm: this operation takes a vector of diameter (random population) and places it at best. The used algorithm is largely based on [1]

Parameters:
  • diameters (np.ndarray) – Array containing all the diameters of the axon population to pack

  • delta (float) – minimal inter-axon distance to respect before considering collision, in um

  • n_iter (int) – Number of iterations

  • v_att (float) – vector norm for attraction velocity, in um per iteration

  • v_rep (float) – vector norm for repulsion velocity, in um per iteration

  • y_gc (float) – y coordinate of the gravity center for the packing, in um

  • z_gc (float) – z coordinate of the gravity center for the packing, in um

  • monitor (bool) – monitor the packing algorithm by saving regularly plot of the population

  • monitoring_Folder (str) – where to save the monitoring plots

  • n_monitor (int) – number of iterration between two successive plots when monitoring the algorithm

Returns:

  • y_axons (np.ndarray) – Array containing the y coordinates of axons, in um

  • z_axons (np.ndarray) – Array containing the z coordinates of axons, in um

Note

  • scientific reference

    [1] Mingasson, T., Duval, T., Stikov, N., and Cohen-Adad, J. (2017). AxonPacking: an open-source software to simulate arrangements of axons in white matter. Frontiers in neuroinformatics, 11, 5.

  • This algorithm cannot be parallelized for the moment.

  • dev Note

    the algorithm perform a fixed number of iteration, the code could evoluate to tke into account the FVF convergence, however this value depends on the range on number of axons.