In [1]:
import pymaid

rm = pymaid.CatmaidInstance('https://www.your.catmaid-server.org',
                            api_token='YOURTOKEN',
                            http_user='user', # omit if not required
                            http_password='pw') # omit if not required


INFO  : Global CATMAID instance set. (pymaid.fetch)

In [2]:
skids = pymaid.get_skids_by_annotation('glomerulus DL4')
skids


INFO  : Found 5 skeletons with matching annotation(s) (pymaid)
Out[2]:
['6698696', '6170457', '57059', '23829', '483289']

In [3]:
tn_table = pymaid.get_treenode_table(skids[0])
tn_table.head()


INFO  : Retrieving 1 treenode table(s)... (pymaid)
INFO  : 1903 treenodes retrieved. Creating table... (pymaid)
Out[3]:
skeleton_id treenode_id parent_node_id confidence x y z radius creator last_edited reviewers tags
0 6698696 22106010 30501406 5 378008 159302 158000 -1 batesa 2018-07-12 17:22:16+00:00 [] []
1 6698696 30501406 22106009 5 378022 159331 158080 -1 robertsr 2018-07-12 17:22:17+00:00 [] []
2 6698696 25548795 25548717 5 434298 297110 59480 1625 costam 2018-03-28 13:59:08+00:00 [] [soma]
3 6698696 25548717 25548650 5 435449 296530 60680 -1 costam 2018-03-28 13:58:04+00:00 [] []
4 6698696 25548650 25548645 5 436769 296642 61240 -1 costam 2018-03-28 13:57:41+00:00 [] []

In [4]:
neuron_list = pymaid.get_neuron ( ['57311','27295'] )

In [5]:
neuron_list


Out[5]:
neuron_name skeleton_id n_nodes n_connectors n_branch_nodes n_end_nodes open_ends cable_length review_status soma
0 PN glomerulus DA1 57312 LK 57311 4882 429 157 164 105 1182.102458 NA True
1 PN glomerulus DA1 27296 BH 27295 9975 471 212 219 58 1591.519823 NA True

In [6]:
neuron_list[0]


Out[6]:
type <class 'pymaid.core.CatmaidNeuron'>
neuron_name PN glomerulus DA1 57312 LK
skeleton_id 57311
n_nodes 4882
n_connectors 429
n_branch_nodes 157
n_end_nodes 164
n_open_ends 105
cable_length 1182.1
review_status NA
soma 3059181

In [7]:
n = neuron_list[0]

# .nodes is a pandas DataFrame and we can use .head() to show the first couple entries
n.nodes.head()


Out[7]:
treenode_id parent_id creator_id x y z radius confidence type
0 3395047 26660885 25 362196 164703 150960 -1 5 slab
1 26660885 3395044 117 362089 164620 151160 -1 5 slab
2 26171077 7688883 117 366603 156742 153720 -1 5 end
3 7688883 26171069 123 366604 156868 153800 -1 5 slab
4 26171069 26171067 117 366575 156826 153840 -1 5 slab

In [8]:
n.connectors.head()


Out[8]:
treenode_id connector_id relation x y z
0 1208403 29790621 1 448908 150692 218040
1 1208413 29790616 0 448068 150780 218160
2 26660885 26660887 0 361070 163821 151160
3 26660885 26660883 0 361450 164421 151160
4 3155268 26387175 0 365954 157079 155080

In [9]:
n.skeleton_id


Out[9]:
'57311'

In [10]:
neuron_list.skeleton_id


Out[10]:
array(['57311', '27295'], dtype='<U5')

In [11]:
neuron_list[0]


Out[11]:
type <class 'pymaid.core.CatmaidNeuron'>
neuron_name PN glomerulus DA1 57312 LK
skeleton_id 57311
n_nodes 4882
n_connectors 429
n_branch_nodes 157
n_end_nodes 164
n_open_ends 105
cable_length 1182.1
review_status NA
soma 3059181

In [12]:
neuron_list[0].review_status


Out[12]:
90

In [13]:
neuron_list


Out[13]:
neuron_name skeleton_id n_nodes n_connectors n_branch_nodes n_end_nodes open_ends cable_length review_status soma
0 PN glomerulus DA1 57312 LK 57311 4882 429 157 164 105 1182.102458 90 True
1 PN glomerulus DA1 27296 BH 27295 9975 471 212 219 58 1591.519823 NA True

In [14]:
neuron_list[0].get_review()


Out[14]:
90

In [15]:
neuron_list.review_status


Out[15]:
array([90, 88])