for chan in reduced_cell_type.getChanMechsForGroup('soma_group'): if chan.getName() in ['NaP_CML', 'NaR_CML', 'NaT_CML']: chan.setDensity(0) reduced_cell_type.associateGroupWithChanMech('soma_group', chan) for chan in vervaeke_cell_type.getChanMechsForGroup('soma_group'): if chan.getName() in ['NaP', 'NaR', 'NaT']: chan.setDensity(0) vervaeke_cell_type.associateGroupWithChanMech('soma_group', chan) # generate pm.doGenerate(sim_config_name, 1234) while pm.isGenerating(): time.sleep(0.02) # pick a segment to stimulate on the detailed cell cth = CellTopologyHelper() distances_dict = dict(cth.getSegmentDistancesFromRoot(vervaeke_cell_type, dendritic_group)) stim_seg_detailed = random.choice([seg_id for seg_id,dist in distances_dict.items() if 200. < dist < 220.]) # pick a segment to stimulate on the reduced cell stim_seg_reduced = 6 # map distances of all ancestors of stimulation segment ancestor_dists = dict(cth.getDistancesFromAncestorSegments(vervaeke_cell_type, stim_seg_detailed)) source_segment_index = 0 source_fraction_along = 0.5 delay = 0. locs = [] detailed_seg_ids = []