def LPLC2_LP_Filter(self): # myGroup = createGroupByAnnotation(self, 'LPLC2') # gets all skeletonNodes for each skeleton in the set self.getAllSkeletonNodes() LPnodesAvg = {} for i in self: if i.curColor is None: JN.autoSaveJSONColorGrad(self) # tests each node in a given skeleton for whether or not it is within the LP (based on a curve built from the points: (191994, 239560), (218895, 239680), (286360,230800), (318592,216920), (332166,209480) run through "mycurvefit.com" for x in self: LPnodes = [] for i in x.skeletonNodes: if -16938980000 + (332993.6 + 16938980000) / ( 1.0 + (i[2] / 379562.8)**25.65271) <= i[1]: LPnodes.append(i) xCount = 0 yCount = 0 zCount = 0 divisor = len(LPnodes) if divisor == 0: print(x.skeletonID) divisor = 1 for i in LPnodes: xCount += i[0] yCount += i[1] zCount += i[2] xAvg = xCount / divisor yAvg = yCount / divisor zAvg = zCount / divisor LPnodesAvg[x.skeletonID] = [xAvg, yAvg, zAvg, x.curColor] return LPnodesAvg
def LC4_LO_Filter(self): if self[0].skeletonNodes is None: # gets all skeletonNodes for each skeleton in the set self.getAllSkeletonNodes() LOnodesAvg = {} for i in self: if i.curColor is None: JN.autoSaveJSONColorGrad(self) # tests each node in a given skeleton for whether or not it is within the LP (based on a curve built from # the points: (191994, 239560), (218895, 239680), (286360,230800), (318592,216920), (332166,209480) run # through "mycurvefit.com" for x in self: LOtnid = [] LOtnid = GN.getDownStreamNodes(skeletonID=x.skeletonID, tag='startOfLobula') LOnodes = [] for tnid in LOtnid: if tnid in x.skeletonNodes: LOnodes.append(x.skeletonNodes[tnid]) xCount = 0 yCount = 0 zCount = 0 divisor = len(LOnodes) if divisor == 0: print(x.skeletonID) divisor = 1 for i in LOnodes: xCount += i[0] yCount += i[1] zCount += i[2] xAvg = xCount / divisor yAvg = yCount / divisor zAvg = zCount / divisor LOnodesAvg[x.skeletonID] = [xAvg, yAvg, zAvg, x.curColor] return LOnodesAvg
def colorByGradient(self): for i in self: if i.curColor is None: JN.autoSaveJSONColorGrad(self) return
# e2c.makeCSV(myDNp02Set, 'saveGeneralSpecificAnnotations') myDNp04Set = CN.builder(6958818) DNp04LC4 = CN.createGroupByAnnotation(myDNp04Set, 'putative LC4 neuron') DNp04LPLC2 = CN.createGroupByAnnotation(myDNp04Set, 'LPLC2') sorted04LC4 = CN.sortBySynH2L(DNp04LC4) sorted04LPLC2 = CN.sortBySynH2L(DNp04LPLC2) # e2c.makeCSV(myDNp04Set, 'saveGeneralSpecificAnnotations') myDNp11Set = CN.builder(5349447) # print(myDNp02Set) DNp11LC4 = CN.createGroupByAnnotation(myDNp11Set, 'putative LC4 neuron') sorted11LC4 = CN.sortBySynH2L(DNp11LC4) JN.autoSaveJSONColorGrad(DNp04LC4) JN.autoSaveJSONColorGrad(DNp04LPLC2) JN.autoSaveJSONColorGrad(DNp02LC4) JN.autoSaveJSONColorGrad(DNp11LC4) sorted02LC4.colorByGradient() sorted04LC4.colorByGradient() sorted11LC4.colorByGradient() e2c.makeCSV(sorted02LC4, 'saveSKIDwithColor') e2c.makeCSV(sorted04LC4, 'saveSKIDwithColor') e2c.makeCSV(sorted11LC4, 'saveSKIDwithColor')