[docs]defcrop_fascicle(fasc:fascicle,x0:float,new_l:float)->fascicle:"""_summary_ Parameters ---------- fasc : fascicle fascicle to crop x0 : float x position of the begining of the new fascicle new_l : float length of the new fascicle Returns ------- fascicle fascicle cropped """fasc.define_length(new_l)ifnot(fasc.LisNoneorlen(fasc.NoR_relative_position)==0):foriinrange(fasc.n_ax):iffasc.axons_type[i]==1:_,_,_,_,_,deltax,_,_=get_MRG_parameters(fasc.axons_diameter[i])fasc.NoR_relative_position=fasc.NoR_relative_position+(x0/deltax)fasc.NoR_relative_position-=int(fasc.NoR_relative_position)returnfasc
[docs]defcrop_nerve(nerv:nerve,x0:float,new_l:float)->nerve:"""_summary_ Parameters ---------- nerv : nerve nerve to crop x0 : float x position of the begining of the new fascicle new_l : float length of the new fascicle Returns ------- nerve nerve cropped """nerv.define_length(new_l)forfascinnerv.fascicles.values:fasc=crop_fascicle(fasc,x0,new_l)returnnerv