SetNeuronType
Changes the type of the specified timestamped variable.
Syntax
SetNeuronType(doc, var, type)
Parameters
Parameter |
Type |
Description |
---|---|---|
doc |
documentReference |
Reference to the document |
var |
variableReference |
Reference to the variable |
type |
number |
If type is positive, the variable type is set to ‘neuron’, if type is zero or negative, the variable type is set to ‘event’ |
Return
None.
Note
Neuron and event types are almost identical. The main difference is that when a data file is opened by NeuroExplorer, all the neuron variables in this file are selected for analysis.
You may need to use this function when creating new neuron variables using NewEvent()
function.
NewEvent
creates an event variable and the variable type can later be changed to neuron using SetNeuronType()
function.
Examples
Python
import nex
doc = nex.GetActiveDocument()
doc["neuron1"] = nex.NewEvent(doc, 0)
nex.SetNeuronType(doc, doc["neuron1"], 1)
NexScript
doc = GetActiveDocument()
doc["neuron1"] = NewEvent(doc, 0)
SetNeuronType(doc, doc["neuron1"], 1)