Пример #1
0
 def getAnnotations(self):
     myAnnotations = GARI.getMyAnnotations()
     y = self.skeletonID
     z = str(y)
     if z in myAnnotations:
         self.annotations = myAnnotations[z]
     return self.annotations
Пример #2
0
def buildFromSkidList(myList):
    # sets list of all skeleton IDs
    mySkels = myList

    # creates dictionary with keys as str(skel IDs) and values as number of synapses with GF1
    myGF1Connectivity = GC.removeExtra()

    # creates dictionary with key-value pairs of str(skelID) and list of str(annotations)
    myAnnotations = GARI.getMyAnnotations()

    # creates a dictionary with key-value pairs of int(skelID) and and str(neuron name)
    myNames = GLT.getLookUpTableSkID_Name()

    # creates empty list to be filled with all instances
    myNeurons = []

    # creates list of of all instances while setting each instance's name and skeletonID to be an element from mySkls
    for i in mySkels:
        x = GFinputNeuron(i)
        myNeurons.append(x)

    # converts skeletonID attribute to string for use as dictionary key then adds all available synapses from dictionary of synapses and all       available annotations from dictionary of annotations
    for elem in myNeurons:
        y = elem.skeletonID
        z = str(y)
        if z in myGF1Connectivity:
            elem.GF1synapseCount = myGF1Connectivity[z]
        if z in myAnnotations:
            elem.annotations = myAnnotations[z]
            p = elem.annotations
        if y in myNames:
            elem.neuronName = myNames[y]

    return myNeurons
Пример #3
0
def builder(SKID=None):
    if SKID is None:
        # sets list of all skeleton IDs
        mySkels = GARI.getListOfSkID_int()

        for i in mySkels:
            mySkels.append(int(i))

        myNeurons = []

        for i in mySkels:
            x = neuronSet(i)
            myNeurons.append(x)

    else:
        SKID = int(SKID)
        myNeurons = []
        x = neuronSet(SKID)
        myNeurons.append(x)

    myAnnotations = GARI.getMyAnnotations()

    myNames = GLT.getLookUpTableSkID_Name()

    return myNeurons
Пример #4
0
def builder(SKID=None):
    if SKID is None:
        # sets list of all skeleton IDs
        mySkels = GARI.getListOfSkID_int()

        # creates dictionary with keys as str(skel IDs) and values as number of synapses with GF1
        myGF1Connectivity = GC.removeExtra()
        myGF2Connectivity = GC.removeExtra(skeleton_id='291870')

        # creates empty list to be filled with all instances
        myNeurons = []

        # creates list of of all instances while setting each instance's name and skeletonID to be an element from
        # mySkls
        for i in mySkels:
            x = GFinputNeuron(i)
            myNeurons.append(x)
    else:
        SKID = int(SKID)
        myNeurons = []
        x = GFinputNeuron(SKID)
        myNeurons.append(x)
        myGF1Connectivity = []
        myGF2Connectivity = []

        # creates dictionary with key-value pairs of str(skelID) and list of str(annotations)
    myAnnotations = GARI.getMyAnnotations()

    # creates a dictionary with key-value pairs of int(skelID) and and str(neuron name)
    myNames = GLT.getLookUpTableSkID_Name()

    myCommissures = GARI.queryByMetaAnnotation('commissure')

    myClassTypes = GARI.queryByMetaAnnotation('classType')
    # converts skeletonID attribute to string for use as dictionary key then adds all available synapses from
    # dictionary of synapses and all       available annotations from dictionary of annotations
    for elem in myNeurons:
        y = elem.skeletonID
        z = str(y)
        if z in myGF1Connectivity:
            elem.GF1synapseCount = myGF1Connectivity[z]
        else:
            elem.GF1synapseCount = 0
        if z in myGF2Connectivity:
            elem.GF2synapseCount = myGF2Connectivity[z]
        else:
            elem.GF2synapseCount = 0
        if z in myAnnotations:
            elem.annotations = myAnnotations[z]
            p = elem.annotations
            for abc in p:
                if (
                        'Unclassified' in abc or 'LC4' in abc or 'LPLC2' in abc or 'JONeuron' in abc or 'GCI' in abc
                        or 'putative DN' in abc) and 'synaptic' not in abc and 'andGFN' not in \
                        abc and 'HK' not in abc and 'Exploration' not in abc and 'type 37' not in abc and 'type 38' \
                        not in abc and 'type 44' not in abc and 'type 48' not in abc and 'miscellaneous' not in abc \
                        and "Ascending" not in abc and "Descending" not in abc and "shared" not in abc:
                    elem.classification = abc
                if 'RIGHT' in abc or 'LEFT' in abc or 'midLine' in abc:
                    if elem.hemisphere is None:
                        elem.hemisphere = abc
                        elem.somaSide = abc
                if "JON" in abc and "synaptic" not in abc:
                    elem.classification = abc
                if elem.commissure is None:
                    if abc in myCommissures:
                        elem.commissure = abc
                if elem.classType is None:
                    if abc in myClassTypes:
                        elem.classType = abc
                if elem.cellBodyRind is None:
                    if 'CBR' in abc and len(abc) == 4:
                        elem.cellBodyRind = abc
        if "JONeuron" in elem.annotations:
            elem.identification = 'JONeuron'
        if elem.hemisphere is None:
            elem.hemisphere = "RIGHT HEMISPHERE"
            elem.somaSide = "RIGHT HEMISPHERE"
        if elem.commissure is None and 'Bilateral' not in elem.annotations:
            elem.commissure = 'unilateral'
        if y in myNames:
            elem.neuronName = myNames[y]
    return myNeurons