mt = h.MechanismType(0)
mt = h.MechanismType(1)
Provides a way of iterating over all membrane mechanisms or point processes and allows selection via a menu or under hoc control.
The 0 argument creates a list of all available distributed membrane mechanisms (as opposed to PointProcesses). eg "hh", "pas", "extracellular". that can be inserted into a section.
The 1 argument creates a list of all available Point Processes. eg. IClamp, AlphaSynapse, VClamp.
Mechanism order is the same as the argument order that created the "special" during nrnivmodl or mknrndll. Therefore when a saved session depends on information in a MechanismType it is dependent on a particular special or dll.
Example:
from neuron import h # Print the names of all density mechanisms mt = h.MechanismType(0) mname = h.ref('') for i in range(mt.count()): mt.select(i) mt.selected(mname) print(mname[0])
See also
mt.select("name")
mt.select(i)
Note
strdef must be a NEURON string reference (e.g. one created via strdef = h.ref('')); to access its contents use strdef[0]; see the example for the constructor above. In particular stdef cannot be a Python string.
mt.make()
mt.make(objectvar)
Description:
- mt.make()
- For distributed mechanisms. Inserts selected mechanism into currently accessed section.
- mt.make(objectvar)
- For point processes. The arg becomes a reference to a new point process of type given by the selection. Note that the newly created point process is not located in any section. Note that if objectvar was the only reference to another object then that object is destroyed.
Note
Currently only allows invoking HOC commands; passing in a Python function is not supported as of NEURON 7.4.
The i'th point process is an ARTIFICIAL_CELL and can therefore be a source for a NetCon object. This means it is NetCon stimulator or that the point process can be used as an artificial neural network cell.
This seems to have, but does not, equivalent functionality to has_net_event() and was introduced because ARTIFICIAL_CELL objects are no longer located in sections. Some ARTIFICIAL_CELLs such as the PatternStim do not make use of net_event in their implementation, and some PointProcesses do use net_event and must be located in sections for their proper function, e.g. reciprocal synapses.
Example:
from neuron import h cable = h.Section(name='cable') cable.nseg = 5 stim = [h.IClamp(i/2., sec=cable) for i in range(3)] mt = h.MechanismType(1) mt.select("IClamp") pp = mt.pp_begin() while h.object_id(pp) != 0: x = pp.get_loc() print("%s located at %s(%g)" % (pp, h.secname(), x)) h.pop_section() # restores section selection from before the get_loc pp = mt.pp_next()