Example #1
0
 def setUp(self):
     self.oo = neurodata()
     self.ramon_segment = self.oo.get_ramon('kasthuri2015_ramon_v4',
                                            'neurons',
                                            3,
                                            3,
                                            include_cutout=True)
     self.default_ramon_segment = ndio.ramon.RAMONSynapse()
Example #2
0
    def put_ramon_volume(self, token, channel, annofile, ramonobj, x_start,
                         y_start, z_start, resolution=1, conncomp=0,
                         remote='neurodata'):

        vol, ramons = self.create_ramon_volume(token, channel, annofile,
                                               ramonobj, conncomp=conncomp,
                                               remote='neurodata')

        if remote is 'neurodata':
            import ndio.remote.neurodata as neurodata
            nd = neurodata()
        else:
            raise ValueError("remote option not implemented.")

        # upload paint
        print('uploading paint...')
        nd.post_cutout(token, channel,
                       x_start, y_start, z_start,
                       vol, resolution=1)

        # upload ramon
        print('uploading RAMON...')
        print('Sorry, I can\'t upload RAMONObjects yet...' \
              'waiting for new functionality.')
Example #3
0
 def setUp(self):
     self.nd = neurodata()
     self.nd_force_chunk = neurodata(chunk_threshold=0)
Example #4
0
 def setUp(self):
     self.nd = neurodata()
     self.nd_force_chunk = neurodata(chunk_threshold=0)
Example #5
0
 def setUp(self):
     self.nd = neurodata()
Example #6
0
 def setUp(self):
     self.nd = neurodata()
     self.t = "kasthuri2015_ramon_v4"
     self.c = "neurons"
     self.ramon_id = 1
Example #7
0
"""
... and collect all of the region names in a dictionary with the "id" field as keys.
"""

regionDict = getChildrenNames(root)
#print(leafList)
#for key in regionDict.keys():
#    print('{0}, "{1}"'.format(key, regionDict[key]))
#print(regionDict)
#sys.exit()
"""
Next we RAMONify the data
"""
token = "ara3_to_AutA"
channel = "annotation_draft"
nd = neurodata(hostname='synaptomes.neurodata.io/nd/')

for regionId in regionDict.keys():
    regionName = regionDict[regionId]

    kvpairs = {'name': regionName}
    ramonObj = ndramon.RAMONGeneric(id=regionId, resolution=0, kvpairs=kvpairs)
    try:
        nd.post_ramon(token, channel, ramonObj)
        print "Successfully posted ramon obj {0} for {1}".format(
            regionId, regionName)
    except:
        print "Failed to post ramon obj {0} for {1}".format(
            regionId, regionName)
Example #8
0
 def setUp(self):
     self.n = neurodata()
     self.t = 'kasthuri2015_ramon_v4'
     self.c = 'neurons'
Example #9
0
 def setUp(self):
     self.oo = neurodata()
     self.ramon_segment = self.oo.get_ramon("kasthuri2015_ramon_v4", "neurons", 3, 3, include_cutout=True)
     self.default_ramon_segment = ndio.ramon.RAMONSynapse()
Example #10
0
 def setUp(self):
     self.nd = neurodata(check_tokens=True)
Example #11
0
 def setUp(self):
     self.nd = neurodata()
     self.ramon_id = 1
Example #12
0
 def setUp(self):
     self.nd = neurodata(check_tokens=True)
Example #13
0
 def setUp(self):
     self.nd = neurodata()
     self.ramon_id = 1
Example #14
0
 def setUp(self):
     self.nd = neurodata()
     self.t = 'kasthuri2015_ramon_v4'
     self.c = 'neurons'
     self.ramon_id = 1
Example #15
0
from PyTablePrinter import tableprinter

import ndio.remote.neurodata as neurodata
nd = neurodata()

public_datasets_and_tokens = nd.get_public_datasets_and_tokens()
public_datasets_and_tokens = [
    {'name': k, 'channels': cs} for k, cs in public_datasets_and_tokens.items()
]


def channel_summary(item):
    return len(item['channels'])


table_printer = tableprinter.TablePrinter(public_datasets_and_tokens, col_order=[
    # lookup    Col Title               # Function to generate data
    ('name',    'Name',                 None),
    (None,      'Number of Channels',   channel_summary)
])

print(table_printer.to_markdown())
Example #16
0
import os
import argparse

from PIL import Image
import numpy as np

import ndio
from ndio.remote import neurodata
# setup ndio (note that because of the /ocp redirect, we force /nd)
nd = neurodata(hostname='synaptomes.neurodata.io/nd/')

def create_annotation_channel(token, channel):
    try:
        ret = nd.create_channel(name=channel, token=token, channel_type='annotation', dtype='uint32', readonly=False)
        if ret == True:
            print "Created channel for {}".format(channel)
        else:
            print "Error creating channel {}".format(channel)
    except ndio.remote.RemoteDataUploadError, e:
        print e

def ingest_annotation_slice(filename, token, channel, zindex):
    imdata = Image.open(filename, 'r')
    imarr = np.asarray(imdata, dtype=np.uint32)
    imarr = np.transpose(imarr)
    imstack = imarr[:,:,np.newaxis]
    try:
        ret = nd.post_cutout(token=token, channel=channel, x_start=0, y_start=0, z_start=zindex, data=imstack, resolution=0)
        if ret == True:
            print "Posted slice {} for channel {}".format(zindex, channel)
        else:
Example #17
0
 def setUp(self):
     self.oo = neurodata()
Example #18
0
 def setUp(self):
     self.oo = neurodata()
Example #19
0
import ndio
import scipy.io as io
import os
import ndio.remote.neurodata as neurodata

nd = neurodata()

# LIST OF PROJECT NAMES
#'Ex2R18C1', 'Ex2R18C2', 'Ex3R43C1', 'Ex3R43C2', 'Ex3R43C3', 'Ex6R15C1', 'Ex6R15C2', 'Ex10R55','Ex12R75', 'Ex12R76', 'Ex13R51',

volumeList = [
    'Ex2R18C1', 'Ex2R18C2', 'Ex3R43C1', 'Ex3R43C2', 'Ex3R43C3', 'Ex6R15C1',
    'Ex6R15C2', 'Ex10R55', 'Ex12R75', 'Ex12R76', 'Ex13R51'
]

#
#baseStr = "/data/anish/Synaptome/kristina15/rawVolumes/";
baseStr = "/Users/anish/Documents/Connectome/Synaptome-Duke/"

folderStrBoolean = os.path.isdir(baseStr)
if (folderStrBoolean == False):
    os.mkdir(baseStr)
    print "Folder Created"

for token in volumeList:
    print token
    channels = nd.get_channels(token)
    x_stop, y_stop, z_stop = nd.get_image_size(token, resolution=0)
    print x_stop, y_stop, z_stop

    # See if directory exists
Example #20
0
 def setUp(self):
     self.nd = neurodata()