'TODO branch', 'soma', 'myelinated', 'unmyelinated', 'root_myelinated', 'root_unmyelinated', 'ends', 'damage', 'axon', 'projection', 'backbone', ] # connect to catmaid and get the source from the connection # default to using environmental variables c = catmaid.connect() src = catmaid.get_source(c, ignore_none_skeletons=True) # create logger logger = logging.getLogger(__name__) logger.setLevel(logging.INFO) # creates two lists, one for error messages and one for url links master_errors = [] master_urls = [] root_errors, root_urls = [], [] leaf_tag_errors, leaf_tag_urls = [], [] loop_errors, loop_urls = [], [] incorrect_tag_errors, incorrect_tag_urls = [], [] max_distance_errors, max_distance_urls = [], []
#!/usr/bin/env python import sys import catmaid server = 'http://catmaid.hms.harvard.edu/catmaid3/' if len(sys.argv) > 1: server = sys.argv[1] print "connecting to server: %s" % server c = catmaid.connect(server) print "api_token: %s" % c.api_token projects = c.projects print "projects: %s" % projects for project in projects: pid = project.get('pid', project.get('id', -1)) if pid == -1: continue print("Project[%s]: %s" % (pid, project['title'])) c.set_project(pid) sids = c.skeleton_ids() print("\t%i skeletons" % len(sids)) if len(sids): sid = sids[0] sk = c.skeleton(sid) print("\tskeleton[%s] type=%s" % (sid, type(sk))) wd = c.wiring_diagram()
import json import os import sys import catmaid if __name__ == "__main__": if len(sys.argv) < 2: outfile = '/home/simulation/tracing/sid_by_annotation.json' else: outfile = sys.argv[1] c = catmaid.connect( 'http://catmaid2.hms.harvard.edu', # server 'wtobin', # username '', # password 'wfly1') # project_id) nids = c.neuron_ids() nid_to_sid = c.nid_to_sid_map() annotations = {} for nid in nids: try: annotation = c.annotation_table(nid) annotations[nid] = annotation except Exception as e: print("Failed to fetch annotations for: %s" % nid) sid_by_annotation = {}
def connect_to_catmaid(): return catmaid.connect(server=opts.server, user=opts.username, password=opts.password, project=opts.authname)
import json import os import sys import catmaid if len(sys.argv) < 2: outfile = '/home/simulation/tracing/sid_by_annotation.json' else: outfile = sys.argv[1] #c = catmaid.connect() c = catmaid.connect('http://catmaid2.hms.harvard.edu', # server 'wtobin', # username '', # password 'wfly1') # project_id) nids = c.neuron_ids() nid_to_sid = c.nid_to_sid_map() annotations = {} for nid in nids: try: annotation = c.annotation_table(nid) annotations[nid] = annotation except Exception as e: print("Failed to fetch annotations for: %s" % nid) sid_by_annotation = {}