ApplyTemplateToWindow

Runs the analysis specified in the template and shows the result in the specified Graph window.

Syntax

ApplyTemplateToWindow(doc, templatename, windownumber)

Parameters

Parameter

Type

Description

doc

documentReference

Reference to the document.

templatename

string

The name of the template. See How To Specify Template Names for details on how to specify template name parameter.

windownumber

number

1-based index of the graph window of the document. Graph windows are named Graphs1, Graphs2, etc. Thus, if you need to specify window Graphs2, windownumber should be equal to 2. If the Graph window with the specified number does not exist, a new Graph window is created

Return

None

Examples

Python

import nex
doc = nex.GetActiveDocument()
# Run PSTH analysis saved in the template PerieventHistograms and show the results in Graph2 window
# We specify template name as "PerieventHistograms". This means that the template file
# C:\Users\current_user\Documents\NeuroExplorer 5\Templates\PerieventHistograms.ntp
# will be used (where current_user is your Windows user name)
nex.ApplyTemplateToWindow(doc, "PerieventHistograms", 2)

NexScript

doc = GetActiveDocument()
% Run PSTH analysis saved in the template PerieventHistograms and show the results in Graph2 window
% We specify template name as "PerieventHistograms". This means that the template file
% C:\Users\current_user\Documents\NeuroExplorer 5\Templates\PerieventHistograms.ntp
% will be used (where current_user is your Windows user name)

ApplyTemplateToWindow(doc, "PerieventHistograms", 2)