当前位置: 首页>>代码示例>>Python>>正文


Python NeuroObject.__init__方法代码示例

本文整理汇总了Python中neuro_object.NeuroObject.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python NeuroObject.__init__方法的具体用法?Python NeuroObject.__init__怎么用?Python NeuroObject.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在neuro_object.NeuroObject的用法示例。


在下文中一共展示了NeuroObject.__init__方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: __init__

# 需要导入模块: from neuro_object import NeuroObject [as 别名]
# 或者: from neuro_object.NeuroObject import __init__ [as 别名]
 def __init__(self, network, parentRegion = None, ontologyTerm = None, *args, **keywords):
     """
     Regions represent a physical subset of a nervous system.  They can also be hierarchical with regions nested within other regions.  Regions can also be associated with an entry in one of the :class:`ontologies <Library.Ontology.Ontology>` in the library.
     
     You create a region by messaging a network:
     
     >>> region1 = network.createRegion(...)
     """
     
     if ontologyTerm is not None:
         if 'name' not in keywords:
             keywords['name'] = ontologyTerm.name
         if 'abbreviation' not in keywords and ontologyTerm.abbreviation is not None:
             keywords['abbreviation'] = ontologyTerm.abbreviation
     
     NeuroObject.__init__(self, network, *args, **keywords)
     
     self.parentRegion = None
     self.subRegions = []
     self.ontologyTerm = ontologyTerm
     self.arborizations = []
     self.pathways = []
     self.neurons = []
     if parentRegion is not None:
         parentRegion._addSubRegion(self)
开发者ID:JaneliaSciComp,项目名称:Neuroptikon,代码行数:27,代码来源:region.py

示例2: __init__

# 需要导入模块: from neuro_object import NeuroObject [as 别名]
# 或者: from neuro_object.NeuroObject import __init__ [as 别名]
 def __init__(self, network, neurite1, neurite2, *args, **keywords):
     """
     GapJunction objects represent a gap junction between two :class:`neurites <Network.Neurite.Neurite>` in a :class:`network <Network.Network.Network>`.
     
     Instances of this class are created by using the gapJunctionWith method of :meth:`Neuron <Network.Neuron.Neuron.gapJunctionWith>` and :meth:`Neurite <Network.Neurite.Neurite.gapJunctionWith>` objects.
     
     >>> neuron1.gapJunctionWith(neuron2)
     """
     
     NeuroObject.__init__(self, network, *args, **keywords)
     self._neurites = set([neurite1, neurite2])
开发者ID:JaneliaSciComp,项目名称:Neuroptikon,代码行数:13,代码来源:gap_junction.py

示例3: __init__

# 需要导入模块: from neuro_object import NeuroObject [as 别名]
# 或者: from neuro_object.NeuroObject import __init__ [as 别名]
 def __init__(self, network, *args, **keywords):
     """
     Muscle objects represent muscles in the :class:`network <Network.Network.Network>` and can be :class:`innervated <Network.Innervation.Innervation>` by :class:`neurites <Network.Neurite.Neurite>`.
     
     Create a muscle by messaging the network:
     
     >>> muscle1 = network.createMuscle()
     >>> neuron1.innervate(muscle1)
     """
     
     NeuroObject.__init__(self, network, *args, **keywords)
     self._innervations = []
开发者ID:JaneliaSciComp,项目名称:Neuroptikon,代码行数:14,代码来源:muscle.py

示例4: __init__

# 需要导入模块: from neuro_object import NeuroObject [as 别名]
# 或者: from neuro_object.NeuroObject import __init__ [as 别名]
 def __init__(self, network, neurite, muscle, *args, **keywords):
     """
     Innervations represent a :class:`neurite's <Network.Neurite.Neurite>` connection to a :class:`muscle <Network.Muscle.Muscle>`.
     
     Create an innervation by messaging a :meth:`neuron <Network.Neuron.Neuron.innervate>` or :meth:`neurite <Network.Neurite.Neurite.innervate>`:
     
     >>> neuron1 = network.createNeuron()
     >>> muscle1 = network.createMuscle()
     >>> innervation_1_1 = neuron1.innervate(muscle1)
     """
     
     NeuroObject.__init__(self, network, *args, **keywords)
     self.neurite = neurite
     self.muscle = muscle
开发者ID:JaneliaSciComp,项目名称:Neuroptikon,代码行数:16,代码来源:innervation.py

示例5: __init__

# 需要导入模块: from neuro_object import NeuroObject [as 别名]
# 或者: from neuro_object.NeuroObject import __init__ [as 别名]
 def __init__(self, network, preSynapticNeurite = None, postSynapticPartners = [], activation = None, *args, **keywords):
     """
     A Synapse object represents a chemical synapse between a single pre-synaptic neurite and one or more post-synaptic neurites.
     
     Instances of this class are created by using the synapseOn method of :meth:`Neuron <Network.Neuron.Neuron.synapseOn>` and :meth:`Neurite <Network.Neurite.Neurite.synapseOn>` objects. 
     
     A synapse's activation attribute should be one of None (meaning unknown), 'excitatory' or 'inhibitory'. 
     
     >>> neuron1.synapseOn(neuron2, activation = 'excitatory')
     """
     
     NeuroObject.__init__(self, network, *args, **keywords)
     self.preSynapticNeurite = preSynapticNeurite
     self.postSynapticPartners = postSynapticPartners
     self.activation = activation
开发者ID:mthunemann,项目名称:Neuroptikon,代码行数:17,代码来源:synapse.py

示例6: __init__

# 需要导入模块: from neuro_object import NeuroObject [as 别名]
# 或者: from neuro_object.NeuroObject import __init__ [as 别名]
 def __init__(self, neurite, region, sendsOutput=None, receivesInput=None, *args, **keywords):
     """
     Arborizations represent a neurite's arborization within a region.
     
     You create an arborization by messaging a :meth:`neuron <Network.Neuron.Neuron.arborize>` or :meth:`neurite <Network.Neurite.Neurite.arborize>`:
     
     >>> neuron1 = network.createNeuron()
     >>> region1 = network.createRegion()
     >>> arborization_1_1 = neuron1.arborize(region1)
     """
     
     NeuroObject.__init__(self, neurite.network, *args, **keywords)
     self.neurite = neurite
     self.region = region
     self.sendsOutput = sendsOutput      # does the neurite send output to the arbor?      None = unknown
     self.receivesInput = receivesInput  # does the neurite receive input from the arbor?  None = unknown
开发者ID:JaneliaSciComp,项目名称:Neuroptikon,代码行数:18,代码来源:arborization.py

示例7: __init__

# 需要导入模块: from neuro_object import NeuroObject [as 别名]
# 或者: from neuro_object.NeuroObject import __init__ [as 别名]
 def __init__(self, network, target = None, modality = None, *args, **keywords):
     """
     Stimulus objects represent external stimulation of objects in the network.
     
     Stimulii are created by calling the :meth:`stimulate <Network.Object.Object.stimulate>` method on an object in the network.  The modality argument must be a :class:`modality <Library.Modality.Modality>` from the library or None to indicate unknown modality.
     
     >>> stimulus = neuron1.stimulate(modality = library.modality('light'))
     """
     
     if target is None:
         raise ValueError, gettext('A stimulus must have a target')
     
     if not keywords.has_key('name') or keywords['name'] is None:
         keywords['name'] = modality.name
         
     NeuroObject.__init__(self, network, *args, **keywords)
     self.target = target
     self.modality = modality
开发者ID:JaneliaSciComp,项目名称:Neuroptikon,代码行数:20,代码来源:stimulus.py

示例8: __init__

# 需要导入模块: from neuro_object import NeuroObject [as 别名]
# 或者: from neuro_object.NeuroObject import __init__ [as 别名]
 def __init__(self, region1 , region2, region1Projects = None, region1Activation = None, region2Projects = None, region2Activation = None, *args, **keywords):
     """
     Pathways connect pairs of :class:`regions <Network.Region.Region>`.  They consist of bundles of :class:`neurites <Network.Neurite.Neurite>` which can be optionally specified.
     
     You create a pathway by :meth:`messaging <Network.Region.Region.projectToRegion>` one of the regions:
     
     >>> pathway_1_2 = region1.projectToRegion(region2)
     """
     
     NeuroObject.__init__(self, region1.network, *args, **keywords)
     
     self._neurites = []
     
     self.region1 = region1
     self.region1Projects = region1Projects
     self.region1Activation = region1Activation
     self.region2 = region2
     self.region2Projects = region2Projects
     self.region2Activation = region2Activation
开发者ID:JaneliaSciComp,项目名称:Neuroptikon,代码行数:21,代码来源:pathway.py

示例9: __init__

# 需要导入模块: from neuro_object import NeuroObject [as 别名]
# 或者: from neuro_object.NeuroObject import __init__ [as 别名]
    def __init__(self, network, root, pathway=None, *args, **keywords):
        """
        Neurites represent projections from :class:`neurons <Network.Neuron.Neuron>` or other neurites.
        
        You create a neurite by messaging a :meth:`neuron <Network.Neuron.Neuron.extendNeurite>` or :meth:`neurite <Network.Neurite.Neurite.extendNeurite>`:
        
        >>> neurite1 = neuron.extendNeurite(...)
        >>> neurite2 = neurite1.extendNeurite(...)
        """

        NeuroObject.__init__(self, network, *args, **keywords)
        self.root = root
        self._neurites = []
        self.arborization = None
        self._synapses = []
        self._gapJunctions = []
        self._innervations = []
        self._pathway = pathway
        if pathway is not None:
            pathway.addNeurite(self)
开发者ID:JaneliaSciComp,项目名称:Neuroptikon,代码行数:22,代码来源:neurite.py

示例10: __init__

# 需要导入模块: from neuro_object import NeuroObject [as 别名]
# 或者: from neuro_object.NeuroObject import __init__ [as 别名]
    def __init__(self, network, neuronClass = None, *args, **keywordArgs):
        """
        Neurons represent individual neural cells in the network.

        You create a neuron by messaging the network:

        >>> neuron1 = network.createNeuron(...)
        """

        # Upconvert old 'function' singleton param to list expected by new 'functions' param.
        if 'function' in keywordArgs:
            functions = set([function])
            del function
        # Upconvert old 'neurotransmitter' singleton param to list expected by new 'neurotransmitters' param.
        if 'neurotransmitter' in keywordArgs:
            neurotransmitters = [neurotransmitter]
            del neurotransmitter

        # Pull out the keyword arguments specific to this class before we call super.
        # We need to do this so we can know if the caller specified an argument or not.
        # For example, the caller might specify a neuron class and one attribute to override.  We need to know which attributes _not_ to set.
        localAttrNames = ['activation', 'functions', 'neurotransmitters', 'polarity', 'region', 'neuronImage', 'links']
        localKeywordArgs = {}
        for attrName in localAttrNames:
            if attrName in keywordArgs:
                localKeywordArgs[attrName] = keywordArgs[attrName]
                del keywordArgs[attrName]

        NeuroObject.__init__(self, network, *args, **keywordArgs)

        self._neurites = []
        self.neuronClass = neuronClass
        self.activation = None
        self._functions = set()
        self.neurotransmitters = []
        self.polarity = None
        self.region = None
        self._synapses = []
        self.neuronImage = []
        self.links = []

        for attrName in localAttrNames:
            if attrName == 'functions':
                attrValue = set()
            elif attrName in ('neurotransmitters', 'links', 'neuronImage'):
                attrValue = []
            else:
                attrValue = None
            if attrName in localKeywordArgs:
                # The user has explicitly set the attribute.
                if attrName == 'functions':
                    attrValue = set(localKeywordArgs[attrName])
                elif attrName == 'neuronImage':
                    for img in localKeywordArgs[attrName]:
                        if img['path']:
                            imageLabel = img['label']
                            imageLocation = img['path']
                            myImage = self.Img(imageLabel, imageLocation)
                            attrValue.append(myImage)
                else:
                    attrValue = localKeywordArgs[attrName]  
            elif self.neuronClass:
                attrValue = getattr(self.neuronClass, attrName) # Inherit the value from the class
            if attrName == 'functions':
                attrName = '_functions'
            setattr(self, attrName, attrValue)
        if self.region is not None:
            self.region.neurons.append(self)
开发者ID:JaneliaSciComp,项目名称:Neuroptikon,代码行数:70,代码来源:neuron.py


注:本文中的neuro_object.NeuroObject.__init__方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。