To set the new bin value in the Rate Histograms template, you need to write:
ModifyTemplate(doc, "Rate Histograms", "Bin (sec)", "5.0")
Note that parameter name should be specified exactly as it is shown in the left column of the Properties
Panel (e.g. not "Bin", but "Bin (sec)" as in the example above). You can select the parameter name in the
left column of Properties Panel and press Ctrl+C to copy the parameter name to the clipboard and then
paste the name of the parameter into your script.
If you need to use a numeric value as newparvalue, you need to convert it to string using NumToStr
function. For example, if you need to set Select Data From = doc["Start"][1]:
ModifyTemplate(doc, "Peri", "Select Data From (sec)", NumToStr(doc["Start"][1]))
ModifyTemplate can be used to specify multiple references in Perievent Histograms, Crosscorrelograms
and Perievent Rasters by using "+":
doc = GetActiveDocument()
ModifyTemplate(doc, "Peri", "Ref. type", "Table (row)")
ModifyTemplate(doc, "Peri", "Reference", "Event04+Event05+Event06")
ApplyTemplate(doc, "Peri")
You can also use "+" to specify multiple interval filters in Perievent Histograms, Crosscorrelograms and
Perievent Rasters.
In Python, you can also use JSON array notation '["Event04", "Event05", "Event06"]':
nex.ModifyTemplate(doc, "Peri", "Reference", '["Event04", "Event05", "Event06"]')
To modify Markers parameter in Perievent Rasters template, you can use the parameter values than
start with either Size:, Clear or AddMarker: .
For example, "Size:8" sets the marker size at 8 points. "Clear" removes all marker events.
"AddMarker:Event06,Triangle Down,0,0,0,0,255,0" adds new marker event Event06 with marker shape
Triangle Down, border color (0,0,0) [meaning red=0,green=0,blue=0] and interior color (0,255,0)
[red=0,green=255,blue=0]. Color values should be numbers from 0 to 255. Valid marker shapes are:
Triangle Down, Triangle Up, Diamond, Square and Circle.
doc = GetActiveDocument()
ModifyTemplate(doc, "PRaster", "Markers", "Size:8") % specifies marker size in points
(8)
ModifyTemplate(doc, "PRaster", "Markers", "Clear") % removes all marker events
ModifyTemplate(doc, "PRaster", "Markers", "AddMarker:Event06,Triangle
Down,0,0,0,0,255,0") % adds new marker Event6
ModifyTemplate(doc, "PRaster", "Markers",
"AddMarker:Neuron07a,Circle,255,0,0,0,0,255") % adds new marker Neuron07a
ModifyTemplate can be used to specify graphics parameters. To change the Graph parameter, you need
to add Graph| before the parameter name:
doc = GetActiveDocument()
ModifyTemplate(doc, "Peri", "Graph|Graph Style", "Histogram")
ModifyTemplate(doc, "Peri", "Graph|Line color", "1")
ModifyTemplate(doc, "Peri", "Graph|Fill under line", "0")
To change the Y Axis parameter, you need to add YAxis| before the parameter name:
ModifyTemplate(doc, "Peri", "YAxis|Max Type", "Fixed")
ModifyTemplate(doc, "Peri", "YAxis|Fixed Max", "50.")
Page 382