def test_connectors_between(self): self.assertIsInstance(pymaid.get_connectors_between(config_test.test_skids, config_test.test_skids), pd.DataFrame)
Neuron_2 = pymaid.get_neuron(Neuron_2_skeleton_id_number) #This function downsamples the neuron - it removes large stretches of skeleton that do not have any branch points. #When the argument preserve_cn_treenodes = True, this preserves the treenodes where connectors (pre/postsynapses) #have been placed. Downsampling is used to reduce the computational time, as some 3D reconstructed neurons can become #very large. Neuron.downsample(1000000, preserve_cn_treenodes = True) Neuron_2.downsample(1000000, preserve_cn_treenodes = True) #Get the connectors between the two neurons of interest #When True, the directional argument will return the connectors (pre and post synapses) #from neuron A to neuron B (A-->B; in this case Neuron_1 to Neuron_2). When False, it will return all #connectors between neuron A to neuron B (A<-->B; in this case, all connectors between Neuron_1 to Neuron_2) Neuron_1_to_Neuron_2 = pymaid.get_connectors_between(Neuron_1,Neuron_2, directional = True) def plot_nx(x, plot_connectors=True, highlight_connectors=None, prog='dot'): """ This lets you plot neurons as dendrograms using networkx and its bindings to graphviz. Parameters ---------- x : CatmaidNeuron Neuron to plot. Strongly recommend to downsample the neuron! plot_connectors : bool, optional If True, connectors will be plotted highlight_connectors : list of int These connectors (or more precisely, the treenodes they connect to) will be highlighted in green