589
NeuroExplorer Manual Copyright © 1998-2020 Nex Technologies

NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

NeuroExplorer Manual

Copyright © 1998-2020 Nex Technologies

Page 2: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Revision: 5.213. Date: 4/5/2020.

Page 3: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Table of Contents

1. Getting Started 9

1.1. Getting Started with NeuroExplorer 10

1.2. Working with Sentinel Keys 11

1.3. NeuroExplorer Screen Elements 13

1.4. NeuroExplorer Menu Commands 16

1.5. Opening Files and Importing Data 25

1.6. Importing Files Created by Data Acquisition Systems 26

1.7. Importing Data from Text Files 28

1.8. Importing Data from Spreadsheets 30

1.9. Importing Data from Matlab 31

1.10. Reading and Writing NeuroExplorer Data Files 32

1.11. 1D Data Viewer 33

1.12. Analyzing Data 34

1.13. Selecting Variables for Analysis 35

1.14. How to Select Variables for Existing Window 36

1.15. How to Select Variables in Variables Panel 38

1.16. Adjusting Analysis Properties 39

1.17. Analysis Templates 41

1.18. Numerical Results 42

1.19. Post-processing 43

1.20. Saving Graphics 44

1.21. Saving Results as PowerPoint Slides 45

1.22. Working with Results Files 46

1.23. Working with Matlab 49

1.24. Working with Excel 51

1.25. Working with R-project 52

2. NeuroExplorer User Interface 56

2.1. NeuroExplorer Screen Elements 59

2.2. NeuroExplorer Menu Commands 62

3. Analysis Reference 71

3.1. Data Types 73

3.1.1. Spike Trains 74

3.1.2. Events 76

3.1.3. Intervals 77

3.1.4. Markers 79

3.1.5. Population Vectors 81

3.1.6. Waveforms 82

3.1.7. Continuously Recorded Data 84

3.2. Data Selection Options 85

3.3. Post-Processing Options 86

3.4. Matlab Options 88

3.5. Excel Options 89

3.6. Confidence Limits for Perievent Histograms 90

3.7. Cumulative Sum Graphs 92

3.8. Rate Histograms 93

3.9. Interspike Interval Histograms 95

3.10. Autocorrelograms 98

Page 1

Page 4: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.11. Perievent Histograms 101

3.12. Crosscorrelograms 106

3.13. Shift-Predictor for Crosscorrelograms 112

3.14. Rasters 114

3.15. Perievent Rasters 115

3.16. Joint PSTH 118

3.17. Cumulative Activity Graphs 120

3.18. Instant Frequency 121

3.19. Interspike Intervals vs. Time 122

3.20. Poincare Maps 123

3.21. Synchrony vs. Time 124

3.22. Trial Bin Counts 126

3.23. Power Spectral Densities 128

3.24. Burst Analysis 132

3.25. Principal Component Analysis 136

3.26. PSTH Versus Time 138

3.27. Correlations with Continuous Variable 140

3.28. Regularity Analysis 142

3.29. Place Cell Analysis 144

3.30. Reverse Correlation 148

3.31. Epoch Counts 151

3.32. Coherence Analysis 153

3.33. Spectrogram Analysis 157

3.34. Perievent Spectrograms 160

3.35. Joint ISI Distribution 163

3.36. Autocorrelograms Versus Time 165

3.37. Perievent Rasters for Continuous 167

3.38. Power Spectra for Continuous 169

3.39. Coherence for Continuous 174

3.40. Analysis of Head Direction Cells 177

3.41. Single Trial Spectrum Analysis 179

3.42. Phase Analysis via Hilbert Transform 182

3.43. Waveform Comparison 184

3.44. Hazard Analysis 186

3.45. Perievent Firing Rates 188

3.46. Find Oscillations 192

3.47. Firing Phase 195

3.48. Detect Spikes 197

3.49. Python-based Analysis 199

3.50. CV2 Analysis 202

3.51. Firing Rates Analysis 204

3.52. Band Energy versus Time Analysis 205

4. Working with Graphics 207

4.1. NeuroExplorer Graphics 208

4.2. Graphics Modes 209

4.3. Positioning the Graphics Objects 211

4.4. Text Labels 213

4.5. Lines 215

4.6. Rectangles 216

Page 2

Page 5: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

5. Working with 3D Graphics 217

5.1. Viewing Multiple Histograms in 3D 218

5.2. 3D Graphics Parameters 219

5.3. Viewing the Neuronal Activity "Movie" 220

5.4. Activity Animation Parameters 222

6. Programming with Python and NexScript 223

6.1. Script Variables 227

6.2. File Variables 228

6.3. Expressions 232

6.4. Flow Control 233

6.5. Functions 235

6.5.1. File Read and Write Functions 236

6.5.1.1. GetFileCount 237

6.5.1.2. GetFileName 239

6.5.1.3. OpenFile 241

6.5.1.4. CloseFile 243

6.5.1.5. ReadLine 244

6.5.1.6. WriteLine 246

6.5.1.7. OpenDocument 247

6.5.1.8. GetActiveDocument 248

6.5.1.9. NewDocument 249

6.5.1.10. CloseDocument 250

6.5.1.11. SaveDocument 251

6.5.1.12. SaveDocumentAs 252

6.5.1.13. SaveNumResults 253

6.5.1.14. SaveNumSummary 254

6.5.1.15. SaveAsTextFile 255

6.5.1.16. MergeFiles 256

6.5.1.17. ReadBinary 257

6.5.1.18. FileSeek 258

6.5.1.19. SelectFile 260

6.5.1.20. SelectFiles 261

6.5.1.21. OpenSavedResult 263

6.5.2. Document Properties Functions 264

6.5.2.1. GetDocPath 265

6.5.2.2. GetDocTitle 266

6.5.2.3. GetTimestampFrequency 267

6.5.2.4. GetDocEndTime 268

6.5.2.5. SetDocEndTime 269

6.5.2.6. GetDocComment 270

6.5.2.7. NeuronNames 271

6.5.2.8. EventNames 274

6.5.2.9. IntervalNames 277

6.5.2.10. WaveNames 280

6.5.2.11. MarkerNames 283

6.5.2.12. ContinuousNames 286

6.5.2.13. NeuronVars 289

6.5.2.14. EventVars 292

6.5.2.15. IntervalVars 295

6.5.2.16. WaveVars 298

6.5.2.17. MarkerVars 301

6.5.2.18. ContinuousVars 304

6.5.2.19. GetSelVarNames 307

6.5.3. Document Variables Functions 308

Page 3

Page 6: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.1. GetVarCount 311

6.5.3.2. GetVarName 312

6.5.3.3. GetVarSpikeCount 313

6.5.3.4. GetVar 314

6.5.3.5. DeleteVar 315

6.5.3.6. Delete 317

6.5.3.7. GetVarByName 318

6.5.3.8. NewEvent 319

6.5.3.9. NewIntEvent 320

6.5.3.10. NewPopVector 321

6.5.3.11. GetContNumDataPoints 322

6.5.3.12. NewContVar 323

6.5.3.13. CopySelectedVarsToAnotherFile 325

6.5.3.14. NewContVarWithFloats 326

6.5.3.15. ContVarStoreValuesAsFloats 328

6.5.3.16. CreateWaveformVariable 330

6.5.3.17. ContMin 331

6.5.3.18. ContMax 332

6.5.3.19. ContMean 333

6.5.3.20. ContAdd 334

6.5.3.21. ContMult 335

6.5.3.22. ContAddCont 336

6.5.3.23. GetName 337

6.5.3.24. GetSpikeCount 338

6.5.3.25. AddTimestamp 339

6.5.3.26. SetNeuronType 340

6.5.3.27. AddContValue 341

6.5.3.28. AddInterval 342

6.5.3.29. Name 343

6.5.3.30. Name 344

6.5.3.31. SamplingRate 345

6.5.3.32. NumPointsInWave 346

6.5.3.33. Timestamps 347

6.5.3.34. Intervals 348

6.5.3.35. ContinuousValues 349

6.5.3.36. FragmentTimestamps 350

6.5.3.37. FragmentCounts 351

6.5.3.38. WaveformValues 352

6.5.3.39. Markers 353

6.5.3.40. MarkerFieldNames 354

6.5.3.41. SetContVarTimestampsAndValues 355

6.5.3.42. SetTimestamps 356

6.5.3.43. SetNeuronPosition 357

6.5.4. Variable Selection Functions 358

6.5.4.1. IsSelected 359

6.5.4.2. Select 360

6.5.4.3. Deselect 361

6.5.4.4. SelectVar 362

6.5.4.5. DeselectVar 363

6.5.4.6. Select 364

6.5.4.7. Deselect 365

6.5.4.8. SelectAll 366

6.5.4.9. DeselectAll 367

6.5.4.10. SelectAllNeurons 368

6.5.4.11. SelectAllEvents 369

Page 4

Page 7: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.12. EnableRecalcOnSelChange 370

6.5.4.13. DisableRecalcOnSelChange 371

6.5.5. Analysis Functions 372

6.5.5.1. ApplyTemplate 373

6.5.5.2. ApplyTemplateToWindow 375

6.5.5.3. PrintGraphics 377

6.5.5.4. Dialog 378

6.5.5.5. ModifyTemplate 380

6.5.5.6. GetTemplateParValue 383

6.5.5.7. RecalculateAnalysisInWindow 385

6.5.5.8. EnableRecalcOnSelChange 386

6.5.5.9. DisableRecalcOnSelChange 387

6.5.5.10. SendGraphicsToPowerPoint 388

6.5.5.11. SaveGraphics 389

6.5.5.12. ExecuteMenuCommand 390

6.5.5.13. SaveResults 392

6.5.5.14. SelectVariablesIn1DView 393

6.5.5.15. SetProperty 394

6.5.5.16. GetPostProcessingScriptParameter 399

6.5.5.17. GetAllAnalysisParameters 400

6.5.5.18. ActivateWindow 401

6.5.5.19. CloseWindow 402

6.5.6. Numerical Results Functions 403

6.5.6.1. GetAllNumericalResults 405

6.5.6.2. GetAllNumResSummaryData 406

6.5.6.3. SetProperty 407

6.5.6.4. GetNumRes 412

6.5.6.5. GetNumResNCols 414

6.5.6.6. GetNumResNRows 415

6.5.6.7. GetNumResColumnName 416

6.5.6.8. SendResultsToExcel 417

6.5.6.9. GetNumResSummaryNCols 419

6.5.6.10. GetNumResSummaryNRows 420

6.5.6.11. GetNumResSummaryColumnName 421

6.5.6.12. GetNumResSummaryData 422

6.5.6.13. SendResultsSummaryToExcel 423

6.5.6.14. SaveNumResults 425

6.5.6.15. SaveNumSummary 426

6.5.6.16. GetNumResSummaryColumnNames 427

6.5.6.17. GetNumResColumnNames 428

6.5.6.18. GetAllNumericalResultsAsCOM 429

6.5.7. Operations on Variables Functions 430

6.5.7.1. Rename 432

6.5.7.2. Join 433

6.5.7.3. Sync 434

6.5.7.4. NotSync 435

6.5.7.5. FirstAfter 436

6.5.7.6. FirstNAfter 437

6.5.7.7. LastBefore 438

6.5.7.8. IntervalFilter 439

6.5.7.9. SelectTrials 440

6.5.7.10. SelectRandom 441

6.5.7.11. SelectEven 442

6.5.7.12. SelectOdd 443

6.5.7.13. ISIFilter 444

Page 5

Page 8: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.14. FirstInInterval 445

6.5.7.15. LastInInterval 446

6.5.7.16. StartOfInterval 447

6.5.7.17. EndOfInterval 448

6.5.7.18. MakeIntervals 449

6.5.7.19. MakeIntFromStart 450

6.5.7.20. MakeIntFromEnd 451

6.5.7.21. IntOpposite 453

6.5.7.22. IntOr 454

6.5.7.23. IntAnd 455

6.5.7.24. IntSize 456

6.5.7.25. IntFind 457

6.5.7.26. MarkerExtract 458

6.5.7.27. Shift 460

6.5.7.28. NthAfter 461

6.5.7.29. PositionSpeed 462

6.5.7.30. FilterContinuousVariable 464

6.5.7.31. LinearCombinationOfContVars 466

6.5.7.32. AbsOfContVar 468

6.5.7.33. DecimateContVar 469

6.5.7.34. ContAdd 470

6.5.7.35. ContMult 471

6.5.7.36. ContAddCont 472

6.5.8. Matlab Functions 473

6.5.8.1. SendSelectedVarsToMatlab 474

6.5.8.2. ExecuteMatlabCommand 475

6.5.8.3. GetVarFromMatlab 476

6.5.8.4. GetContVarFromMatlab 477

6.5.8.5. GetContVarWithTimestampsFromMatlab 478

6.5.8.6. GetIntervalVarFromMatlab 479

6.5.9. Excel Functions 480

6.5.9.1. SetExcelCell 481

6.5.9.2. CloseExcelFile 482

6.5.10. PowerPoint Functions 483

6.5.10.1. SendGraphicsToPowerPoint 484

6.5.10.2. ClosePowerPointFile 485

6.5.11. Running Script Functions 486

6.5.11.1. RunScript 487

6.5.11.2. Sleep 489

6.5.12. Math Functions 490

6.5.12.1. seed 492

6.5.12.2. expo 493

6.5.12.3. floor 494

6.5.12.4. ceil 495

6.5.12.5. round 496

6.5.12.6. abs 497

6.5.12.7. sqrt 498

6.5.12.8. pow 499

6.5.12.9. exp 500

6.5.12.10. min 501

6.5.12.11. max 502

6.5.12.12. log 503

6.5.12.13. sin 504

6.5.12.14. cos 505

6.5.12.15. tan 506

Page 6

Page 9: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.16. acos 507

6.5.12.17. asin 508

6.5.12.18. atan 509

6.5.12.19. RoundToTS 510

6.5.12.20. GetFirstGE 511

6.5.12.21. GetFirstGT 512

6.5.12.22. GetBinCount 513

6.5.12.23. BitwiseAnd 514

6.5.12.24. BitwiseOr 515

6.5.12.25. GetBit 516

6.5.13. String Functions 517

6.5.13.1. Left 518

6.5.13.2. Mid 519

6.5.13.3. Right 520

6.5.13.4. Find 521

6.5.13.5. StrLength 523

6.5.13.6. NumToStr 524

6.5.13.7. StrToNum 525

6.5.13.8. GetNumFields 526

6.5.13.9. GetField 527

6.5.13.10. CharToNum 528

6.5.13.11. NumToChar 529

6.5.14. Debug Functions 530

6.5.14.1. Trace 531

6.5.14.2. MsgBox 532

7. COM/ActiveX Interfaces 533

7.1. Application 534

7.1.1. ActiveDocument Property 535

7.1.2. DocumentCount Property 536

7.1.3. Version Property 537

7.1.4. Visible Property 538

7.1.5. OpenDocument Method 539

7.1.6. Document Medhod 540

7.1.7. Sleep Method 541

7.1.8. RunNexScript Method 542

7.1.9. RunNexScriptCommands Method 543

7.2. Document 544

7.2.1. Path Property 546

7.2.2. FileName Property 547

7.2.3. Comment Property 548

7.2.4. TimestampFrequency Property 549

7.2.5. StartTime Property 550

7.2.6. EndTime Property 551

7.2.7. VariableCount Property 552

7.2.8. NeuronCount Property 553

7.2.9. EventCount Property 554

7.2.10. IntervalCount Property 555

7.2.11. MarkerCount Property 556

7.2.12. WaveCount Property 557

7.2.13. ContinuousCount Property 558

7.2.14. Variable Method 559

7.2.15. Neuron Method 560

Page 7

Page 10: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.16. Event Method 561

7.2.17. Interval Method 562

7.2.18. Marker Method 563

7.2.19. Wave Method 564

7.2.20. Continuous Method 565

7.2.21. DeselectAll Method 566

7.2.22. SelectAllNeurons Method 567

7.2.23. SelectAllContinuous Method 568

7.2.24. ApplyTemplate Method 569

7.2.25. GetNumericalResults Method 570

7.2.26. Close Method 571

7.3. Variable 572

7.3.1. Name Property 573

7.3.2. TimestampCount Property 574

7.3.3. Timestamps Method 575

7.3.4. IntervalStarts Method 576

7.3.5. IntervalEnds Method 577

7.3.6. FragmentTimestamps Method 578

7.3.7. FragmentCounts Method 579

7.3.8. ContinuousValues Method 580

7.3.9. MarkerValues Method 581

7.3.10. WaveformValues Method 582

7.3.11. SamplingRate Property 583

7.3.12. Select Method 584

7.3.13. Deselect Method 585

Page 8

Page 11: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••••

••

•••

1. Getting Started

Installation Before you can use NeuroExplorer, you must install NeuroExplorer program files, Sentinel system driversand install the Sentinel hardware key.

Running NeuroExplorer Setup Before you begin installing NeuroExplorer and its components, please exit all currently runningapplications. Please follow the following steps to install NeuroExplorer:

Download NeuroExplorer setup file from NeuroExplorer Web site. For 64-bit systems, download

http://www.neuroexplorer.com/downloads/NeuroExplorer5Setup64.exe For 32-bit Windows,

download http://www.neuroexplorer.com/downloads/NeuroExplorer5Setup32.exe Double-click the downloaded file. NeuroExplorer Version 5 setup screen appearsFollow the prompts of the setup dialogs and complete the installationAt the end of the installation process, Sentinel System Driver Setup will start automaticallyFollow Sentinel Driver Setup prompts and complete the installation of Sentinel DriversReboot your computer

NeuroExplorer Setup will create the following directory structure: The main NeuroExplorer directory: C:\Program Files\Nex Technologies\NeuroExplorer 5SentinelDrivers subdirectory: C:\Program Files\Nex Technologies\NeuroExplorer 5\SentinelDrivers.If you need to reinstall Sentinel Drivers, you can run SentinelSetup.7.5.8.exe program in thisdirectory.By default, additional NeuroExplorer files are copied to 'NeuroExplorer 5' directory in the currentuser Documents folder. You can also specify custom directory for scripts, templates and other fileswhen running NeuroExplorer setup.

Installing Hardware Key Before you can use NeuroExplorer, you need to install provided Sentinel Hardware Key on yourcomputer. To install the USB key:

Make sure to run the NeuroExplorer setup and reboot the computer after installing NeuroExplorerAttach the key to the available USB portIf the New Hardware Found wizard is shown, accept the defaults in the wizard

Page 9

Page 12: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••••••••••••••••

•••

1.1. Getting Started with NeuroExplorer This section, Getting Started with NeuroExplorer, describes the basics of using NeuroExplorer:

Working with Sentinel keys NeuroExplorer Screen Elements Opening Files and Importing Data Importing Files Created By Data Acquisition Systems Importing Data from Text Files Importing Data from the Spreadsheets Analyzing Data Selecting Variables for AnalysisAdjusting Analysis Properties Analysis Templates Numerical Results Post-processing Working with Results Files Working with Matlab Working with Excel Saving GraphicsWorking with R-project

Additional information is available in the following sections: Working with Graphics NeuroExplorer Analysis Reference Programming with Python and NexScript

NeuroExplorer Technical Support NeuroExplorer users can get help via e-mail: [email protected]. Please visit NeuroExplorer

Web site http://www.neuroexplorer.com for program updates and latest information about NeuroExplorer.

NeuroExplorer Updates To get the latest version of NeuroExplorer, download the file

http://www.neuroexplorer.com/downloads/NeuroExplorer5Setup64.exe. This setup file will execute the complete install – it will create folders, menu items in Start\Programs andcreate a desktop icon for NeuroExplorer.

Page 10

Page 13: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.2. Working with Sentinel Keys NeuroExplorer requires a Sentinel key to operate. Sentinel drivers need to be installed so thatNeuroExplorer can communicate with the Sentinel keys. These drivers are installed when you runNeuroExplorer setup (NeuroExplorer5Setup64.exe).

Error Messages and Troubleshooting 1. Unable to initialize Sentinel library Make sure that Sentinel drivers version 7.5.8 or later are installed:

- Open Control Panel | Uninstall a program and verify that Sentinel System Driver Installer 7.5.8 islisted in Currently Installed Programs. - If an older version (prior to 7.5.8) of Sentinel Driver installer is listed, remove this version and rebootthe computer. To install Sentinel 7.5.8 drivers, run the driver installer: C:\Program Files\Nex Technologies\NeuroExplorer 5\SentinelDrivers\SentinelSetup.7.5.8.exe - Reboot the computer after installing the drivers.

2. Unable to find Sentinel key 1) Verify that you are using a NeuroExplorer key. The code SRB10491 should be printed on the key. Thenewer keys also have Neuroexplore printed on them. 2) Make sure that Sentinel drivers version 7.5.8 or later are installed.

- Open Control Panel | Uninstall a program and verify that Sentinel System Driver Installer 7.5.8 islisted in Currently Installed Programs. - If an older version (prior to 7.5.8) of Sentinel Driver installer is listed, remove this version and rebootthe computer. To install Sentinel 7.5.8 drivers, run the driver installer: C:\Program Files\Nex Technologies\NeuroExplorer 5\SentinelDrivers\SentinelSetup.7.5.8.exe - Reboot the computer after installing the drivers.

3) If the problem persists, you may need to use the Cleanup utility. - Uninstall NeuroExplorer and all the Sentinel software items listed in Control Panel | Uninstall aprogram - Download Sentinel cleanup utility (64-bit SSD Cleanup - Driver Cleanup utility) from Sentinel

Downloads page - Unzip and run the utility. Make sure you let the utility finish running. It may take several minutes. - Reboot the computer - Run NeuroExplorer setup. Make sure not to cancel Sentinel Driver Setup. Accept defaults inSentinel Driver Setup. - Reboot the computer

4) If you still have problems with the Sentinel key, download Sentinel Advanced Medic (SentinelAdvanced Medic - Sentinel Diagnostic - SAM131.exe) from Sentinel Downloads page

Run Sam131.exe, it will extract Sam1.3.1.exe.

Page 11

Page 14: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Run Sam1.3.1.exe: - Click Enable Logging - Click Troubleshoot at the bottom of the dialog - Click Acknowledge at the bottom of the dialog The program may crash, but it will create the log file SentinelLog.txt E-mail the log file to [email protected] Contact NeuroExplorer technical support ( [email protected] ) if you still have problems

with the Sentinel key. 3. Unable to read Sentinel key data

Contact NeuroExplorer technical support ( [email protected] ). Sentinel key may be

damaged. 4. Sentinel key does not have version 5 license

You are using NeuroExplorer version 3 or version 4 Sentinel key. If you purchased NeuroExplorer version 5, contact NeuroExplorer technical support (

[email protected] ). If you would like to upgrade to NeuroExplorer version 5, contact NeuroExplorer support (

[email protected] ) or one of the NeuroExplorer resellers listed in the Purchase Page of

the NeuroExplorer web site.

Page 12

Page 15: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.3. NeuroExplorer Screen Elements NeuroExplorer user interface consists of the main window surrounded by several panels. These panelsallow you to select files, select analyses and specify analysis properties. The figure below shows thedefault layout of NeuroExplorer window. Files, Properties, Analyses, Variables and Explore panels arevisible and Templates and Scripts panels are hidden. To view a hidden panel, click at the panel tab oruse View menu command. You can reposition panels by dragging them with your mouse and you can save and restore windowlayouts using Window menu commands.

Files Panel

Page 13

Page 16: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

This view allows you to quickly browse through your data files. When you select (single-click) one of thedata files, NeuroExplorer displays the file header information in the Properties panel. To open the datafile, simply double-click the file name.

Analyses Panel

This view allows you to quickly select one of the analyses available in NeuroExplorer. To apply analysisto the active data file, click at the analysis name.

Properties Panel

The left column of the Properties Panel lists the names of adjustable parameters for the selected object.The right column contains various controls that can be used to change the parameter values. To applythe changes, press the Apply button or hit the F5 key.

Templates Panel The Templates View can be used to quickly execute an Analysis Template. Double-click the templatename and the corresponding template will be immediately executed. You can create subfolders in your template directory and then NeuroExplorer will allow you to navigatethrough the templates tree within the Templates View.

Variables Panel

Page 14

Page 17: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

You can analyze all the variables in your data file, a subset of the variables, or may be just one variable.Variables Panel allows you to quickly select and deselect the variables used for analysis:

The left column shows the variables that are not currently selected; the right column shows the selectedvariables. To move variables from column to column, first select them, then press ">" (Select) or "<"(Deselect) buttons.

Scripts Panel This panel can be used to select a script to be executed. Double-click the script name to run the selectedscript. You can create subfolders in your script directory and then NeuroExplorer will allow you to navigatethrough the scripts tree within the Scripts View.

Explore Panel

Explore panel allows you to quickly explore analysis parameter ranges. Select a parameter you want toexplore from a list and drag a slider. NeuroExplorer will keep recalculating analysis with the newparameter values while you drag the slider, thus creating an “analysis animation”. One of the best uses for this panel is to explore analysis properties over a sliding window within your file:

Specify Use Time Range using Analysis | Edit menu command, then Data Selection tab Select ‘Select Data From’ and ‘Select Data To’ parameters in the list boxes of the Explore panel Click on Link Sliders check box

Now, when you drag one of the sliders, the other one will follow allowing you to visualize analysis resultsover a sliding window in time.

See Also NeuroExplorer Menu Commands

Page 15

Page 18: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.4. NeuroExplorer Menu Commands The following menu commands are available in NeuroExplorer

Menu Command Description

File | New Create a new document

File | Open... Open an existing document

File | Restore Last Analysis Restore lasts analysis

File | Close Close the active document

File | Save Save the active document

File | Save As .NEX File... Save the active document with a new name

File | Save As .NEX5 File... Save the active document with a new name

File | Import Data | Plexon PLX,PL2 or DDT File...

Import data from Plexon .plx file

File | Import Data | Plexon SPKFile...

Import data from Plexon .spk file

File | Import Data | Alpha OmegaData File...

Import data from Alpha-Omega file

File | Import Data | BlackrockMicrosystems File...

Import data from Blackrock Microsystems file

File | Import Data | CED Spike-2Data File...

Import data from CED Spike-2 file

File | Import Data | CORTEX DataFile...

Import data from CORTEX data file

File | Import Data | DataWaveFile...

Import data from DataWave file

File | Import Data | MultichannelSystems Data File...

Import data from Multichannel Systems file

File | Import Data | Neuralynx DataFile...

Import data from Neuralynx file(s)

File | Import Data | RC ElectronicsData File...

Import data from RC Electronics file

File | Import Data | Stranger DataFile...

Import data from Stranger file

File | Import Data | Text File... Import data from a text file

File | Import Data | Text File withContinuous Variables...

Import continuous variables from a text file

File | Import Data | AxonInstruments ABF File...

Import data from Axon Instruments ABF file

File | Import Data | Axion Data Import data from Axion data file

Page 16

Page 19: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

File...

File | Import Data | MED64 MobiusNative Format Data File...

Import data from MED64 Mobius file

File | Import Data | MED64 Mobius.csv Spike Time File...

Import data from MED64 .csv file

File | Import Data | European DataFormat .edf File...

Import data from European Data Format .edf file

File | Import Data | KlustaSuite.kwik File...

Import data from KlustaSuite .kwik file

File | Import Data | Open EphysFiles...

Import data from Open Ephys files (.continuous, .spikes and.events)

File | Import Data | Intan DataFile...

Import data from Intan data file

File | Import Data | Ripple DataFile...

Import data from Ripple data file

File | Import Data | 3Brain DataFile...

Import data from 3Brain data file

File | Export Data | As a Text File... Export Timestamps As a Text File

File | Merge Files... Merge several similar data files into one

File | Connect to Plexon Server Connect to Plexon Server

File | Print... Change the printer and printing options

File | Print Preview Display full pages

File | Print Setup... Change the printer and printing options

File | Page Setup... Open a dialog to edit page elements

File | Save NeuroExplorer State... Save NeuroExplorer State

File | Restore NeuroExplorerState...

Restore NeuroExplorer State

File | Exit Quit the application; prompts to save documents

Edit | Undo Undo the last action

Edit | Redo Redo the previously undone action

Edit | Cut Cut the selection and put it on the Clipboard

Edit | Copy Copy the selection and put it on the Clipboard

Edit | Paste Insert Clipboard contents

Edit | Edit Graphics | Switch toPage Layout Mode

Edit the layout of the whole page

Edit | Edit Graphics | Switch toGraph Layout Mode

Edit the layout of each graph

Page 17

Page 20: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Edit | Edit Graphics | BlockProperties...

Edit the properties of the block of graphs

Edit | Edit Graphics | GraphProperties...

Edit graph properties

Edit | Edit Graphics | X AxisProperties...

Edit X axis properties

Edit | Edit Graphics | Y AxisProperties...

Edit Y axis properties

Edit | Edit Graphics | PageLabels...

Edit text elements of the page

Edit | Edit Graphics | GraphLabels...

Edit text elements of each graph

Edit | Edit Markers | Split IntoMultiple Events...

Split marker variable into multiple event variables

Edit | Edit Markers | ExtractEvents...

Extract events according to the specified conditions

Edit | Edit Markers | ExtractPosition Variables...

Extract position variables

Edit | Delete Variables... Open a dialog to select the variables you would like to delete

Edit | Copy Selected Variables toAnother File...

Copy selected variables to another file

Edit | Operations on DataVariables...

Open Operations on Data Variables dialog

Edit | Add Interval Variable... Add an interval variable to the current document

Edit | Add Population Vector... Open a dialog to add a population vector to current document

Edit | Set Positions of theNeurons...

Set positions of the neurons

Edit | Digital Filter ContinuousVariable...

Digital filter continuous variable

Edit | Convert Video-BasedContinuous Variables...

Open a dialog to convert video-based variable to a cont. variable

View | Toolbar Show or hide the toolbar

View | Status Bar Show or hide the status bar

View | 1D Data Viewer Window Open a one-dimensional data viewer

View | Numerical Results Window Open numerical results window

View | Files Panel View Files panel

View | Analyses Panel View Analyses panel

View | Properties Panel View Properties panel

View | Variables Panel View Variables panel

Page 18

Page 21: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

View | Templates Panel View Templates panel

View | Scripts Panel View Scripts panel

View | Explore Panel View Explore panel

View | Restore Default Layout... Restore default panel layout

View | Options... Open NeuroExplorer Options dialog

View | Data Import Options... Open Data Import Options dialog

View | Average/Overlay ChartWindow

Open Average/Overlay Chart window

View | Results Folder Summary Open results folder summary window

View | History Thumbnails... Open History Thumbnails dialog

View | History Script... Open History Script in NexScript editor

Analysis | Edit Parameters... Open the dialog to edit the current analysis parameters

Analysis | Select Variables ... Select Variables for Analysis

Analysis | Increase X Range Increase X Range in the current analysis

Analysis | Decrease X Range Decrease X Range in the current analysis

Analysis | Restore Last Analysis Restore lasts analysis

Results | Graphical Results | CopyGraphics to the Clipboard

Copy all the block graphics to the clipboard

Results | Graphical Results | SaveGraphics in WMF File...

Saves graphics in a Windows Metafile

Results | Graphical Results | SaveGraphics in PNG File...

Save graphics in a .png file

Results | Graphical Results | SaveGraphics in SVG File...

Save graphics in a .svg (Scalable Vector Graphics) file

Results | Graphical Results | SendGraphics to PowerPoint...

Send graphics to PowerPoint

Results | Numerical Results | ViewNumerical Results Window

Open numerical results window

Results | Numerical Results | CopyNumerical Results to the Clipboard

Copy Numerical Results to the clipboard

Results | Numerical Results | SaveNumerical Results in a Text File...

Save numerical results as a text file

Results | Numerical Results | SaveSummary of Numerical Results in aText File....

Save summary of numerical results in a text file

Results | Numerical Results | SendNumerical Results to Excel...

Send Numerical Results To Excel

Results | Numerical Results | Send Send Numerical Results to Matlab

Page 19

Page 22: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Numerical Results to Matlab

SavedResults | Set ResultsFolder...

Sets current saved results folder

SavedResults | Open SavedResults File...

Open saved results file

SavedResults | Open Data FileReferenced in Result

Open data file referenced in result

SavedResults | Restore Analysis inNeuroExplorer

Restore analysis in NeuroExplorer

SavedResults | Quick Save Results Quick save results

SavedResults | Save CurrentAnalysis Results in Results File...

Save current analysis results in results File

SavedResults | Results FolderSummary

Open results folder summary window

SavedResults | Add Slides withSelected Results...

Add Slides with Selected Results

Graphics | Edit Graphics | Switch toPage Layout Mode

Edit the layout of the whole page

Graphics | Edit Graphics | Switch toGraph Layout Mode

Edit the layout of each graph

Graphics | Edit Graphics | BlockProperties...

Edit the properties of the block of graphs

Graphics | Edit Graphics | GraphProperties...

Edit graph properties

Graphics | Edit Graphics | X AxisProperties...

Edit X axis properties

Graphics | Edit Graphics | Y AxisProperties...

Edit Y Axis properties

Graphics | Edit Graphics | ColorScale Properties...

Edit color scale properties

Graphics | Edit Graphics | PageLabels...

Edit text elements of the page

Graphics | Edit Graphics | GraphLabels...

Edit text elements of each graph

Graphics | Export Graphics | CopyGraphics to the Clipboard

Copy all the block graphics to the clipboard

Graphics | Export Graphics | SaveGraphics in WMF File...

Saves graphics in a Windows Metafile

Graphics | Export Graphics | SaveGraphics in PNG File...

Save graphics in a .png file

Graphics | Export Graphics | Send Send Graphics to PowerPoint

Page 20

Page 23: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Graphics to PowerPoint...

Graphics | Fonts | Enable FontAutoScale

Allow NeuroExplorer to reduce font sizes if there are too manygraphs

Graphics | Fonts | Increase fontsize

Increase font size

Graphics | Fonts | Decrease fontsize

Decrease font size

Graphics | Zoom | Zoom In Zoom In

Graphics | Zoom | Zoom Out Zoom Out

Graphics | Zoom | Fit to Window Scale Block so that it fits the screen

Graphics | Insert | Insert Text Insert text into figure

Graphics | Insert | Insert Line Add line

Graphics | Insert | Insert Rectangle Add rectangle to the figure

Graphics | Insert | Insert Text Labelwith the Variable Name

Insert text element with the variable name to each graph

Graphics | Bring to front Bring selected object to front

Graphics | Send to back Send to back

Script | New Script Open a script window

Script | Open Script... Open existing script

Script | History Script... Open history script

Script | Script Options... Open Script Options dialog

Template | Save Template ... Save Template

Template | Save As New Template...

Save As New Template

Template | Save As DefaultTemplate

Saves the current configuration as a default template for thisanalysis

Template | Open Template andRun Analysis From Template...

Opens a File Open dialog to select the template

Template | View TemplateProperties...

View Template Properties

3DView | View Histograms in 3D Show the results in 3D Viewer

3DView | View HistogramVariations in 3D

View Histogram Z-scores in 3D

3DView | 3D Activity Animation Opens a 3D activity viewer

3DView | Graphics Parameters... Opens a dialog to edit this window's graphics parameters

3DView | Save As New 3DTemplate...

Save current graphics parameters as a new 3D template

Page 21

Page 24: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3DView | Save Current 3DTemplate

Save current graphics parameters as a new 3D template

3DView | Save As New AnimationTemplate...

Save current animation template as a new template

3DView | Save Current AnimationTemplate

Save current animation template

Matlab | Matlab Options... Matlab Options

Matlab | Get Data From Matlab |Get Timestamp Variables...

Get timestamp variables from Matlab

Matlab | Get Data From Matlab |Get Continuous Variables...

Get continuous variables from Matlab

Matlab | Get Data From Matlab |Get Continuous Variables withTimestamps...

Get continuous variables with timestamps from Matlab

Matlab | Get Data From Matlab |Get Interval Variables...

Get interval variables from Matlab

Matlab | Get Data From Matlab |Open Matlab As Engine

Open Matlab as engine

Matlab | Send Selected Variablesto Matlab

Send selected variables to Matlab

Matlab | Send Numerical Results toMatlab

Send numerical results to Matlab

R-project | Settings for running R-project via command line...

Open a dialog to specify R-project options

Markers | Split Into MultipleEvents...

Split marker variable into multiple event variables

Markers | Extract Events... Extract events according to the specified conditions

Markers | Extract PositionVariables...

Extract position variables

Online | Connect to Plexon Server Connect to Plexon online data server

Online | Connect to CerebusServer

Connect to Cerebus online data server

Online | Connect to NeuralynxServer

Connect to Neuralynx online data server

Online | Connect to AlphaMapServer

Connect to AlphaMap online data server

Online | Pause Online Data ServerUpdates

Pause online data server Updates

Online | Reset Online Data File Restart the data collection

Online | Disconnect from OnlineData Server

Disconnect from online data server

Page 22

Page 25: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Online | Plexon Online Options... Plexon online options

Online | Cerebus Online Options... Cerebus online options

Online | Neuralynx OnlineOptions...

Neuralynx online options

Online | AlphaMap OnlineOptions...

AlphaMap online options

Sound | Play Continuous Variableas Sound

Play continuous variable as sound

Window | Cascade Arrange windows so they overlap

Window | Tile Horizontally Arrange windows as non-overlapping tiles

Window | Tile Vertically Arrange windows as non-overlapping tiles

Window | Arrange Icons Arrange icons at the bottom of the window

Window | Numerical ResultsWindow

Open numerical results window

Window | Close All Windows Close all child windows

Window | Close All WindowsExcept Currently Active Window

Close all windows except currently active window

Window | Files Panel View Files panel

Window | Analyses Panel View Analyses panel

Window | Parameters Panel View Properties panel

Window | Variables Panel View Variables panel

Window | Templates Panel View Templates panel

Window | Scripts Panel View Scripts panel

Window | Explore Panel View Explore panel

Window | Restore Default Layout... Restore default panel layout

Window | Save Current Layout in aFile...

Saves current panel layout

Window | Restore Layout from aFile...

Restore panel layout from a file

Help | Help Topics List Help topics

Help | NeuroExplorer Web Site Open NeuroExplorer web site home page in the default browser

Help | NeuroExplorer Blog Open NeuroExplorer Blog page in the default browser

Help | Check for Updates... Check for the updates

Help | Update Sentinel Key toEnable Version 5...

Update Sentinel key

Help | About NeuroExplorer... Display program information, version number and copyright

Page 23

Page 26: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

 

See Also NeuroExplorer Screen Elements

Page 24

Page 27: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

1.5. Opening Files and Importing Data NeuroExplorer can read native data files created by popular data acquisition systems (Alpha Omega,CED Spike-2, Cortex, Blackrock Microsystems, Intan Technologies, Multi Channel Systems, Neuralynx,Plexon and many others. See Importing Files Created By Data Acquisition Systems for more

information). NeuroExplorer can also import data from text files (see Importing Data from Text Files ). You can import the data from spreadsheets using the clipboard (see Importing Data from Spreadsheets ). NeuroExplorer has its own data format and by default saves the data in the binary file with the extension.nex or.nex5. To open a NeuroExplorer data file,

press File Open toolbar button , orselect File | Open... menu command.

To import data in any of the supported file formats, select the corresponding File | Import command:

You can also paste data directly into Data View. See Importing Data from the Text Files and Importing

Data from Spreadsheets for more information.

Page 25

Page 28: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.6. Importing Files Created by Data Acquisition Systems NeuroExplorer can read native data files created by many popular data acquisition systems (see tablebelow). In addition, several companies have implemented export of recorded data as .nex or .nex5 files. NeuroExplorer can also analyze data online during recording session. Plexon, Neuralynx, Alpha Omegaand Blackrock recording systems are supported in the online mode.  

Data acquisition system Files with these extensions that can be opened inNeuroExplorer

3Brain .brw, .bxr

Alpha Omega Engineering .isi, .lsm, .map, .mat, .mpx, .nda

Axion Biosystems .raw

Axon Instruments .abf

Blackrock Microsystems .nev, .ns1, .ns2, .ns3, .ns4, .ns5, .ns6, .ns7, .ns8, .ns9

CED Spike-2 .smr, .smrx

Cortex (no specified extension, use File | Import | Cortex menucommand)

DataWave Technologies .act, .cut, .dat, .edt, .uff

European Data Format .edf

g.Tec Medical Engineering g.Recorder .hdf5

Intan Technologies .rhd, .rhs (time.dat, amplifier.dat and other .dat files areloaded automatically when .rhd or .rhs file is open)

KlustaSuite spike sorting software .kwik

MED64 (Panasonic, Alpha MEDScientific)

.csv, .modat

Multichannel Systems .mcd, .msrd

Neuralynx .dat, .nev, .ncs, .nse, .nst, .nts, .ntt, .nvt, .t

NeuroExplorer .nex, .nex5

Open ePhys .continuous, .events, .spikes

Plexon .ddt, .pl2, .plx, .spk

RC Electronics .prm

Ripple Neuro .nev, .nf1, .nf2, .nf3, .nf4, .nf5, .nf6, .nf7, .nf8, .nf9

Thomas Recording WAV file .wav

Tucker-Davis Technologies .sev, .tbk, .tdx, .tev, .tin, .tnt, .tsq

Text file with timestamps .txt

Page 26

Page 29: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Text file with continuous data .txt

File Import Options File import options can be set in the Data Import dialog (use View | Data Import Options menucommand to invoke the dialog).

Page 27

Page 30: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.7. Importing Data from Text Files You can specify text import options in the Text Import dialog:

Sampling Frequency - this parameter defines the internal representation of the timestamps thatNeuroExplorer will use for this file. Internally, the timestamps are stored as integers representing thenumber of time ticks from the start of the experiment. The time tick is equal to 1./ Sampling_Frequency Timestamp Units - this parameter defines how the numbers representing the timestamps are treated byNeuroExplorer. If the timestamps are in time ticks, they are stored internally exactly as they are in thetext file. If the timestamps are in seconds, NeuroExplorer converts them to time ticks: Internal_Timestamp = Timestamp_In_Seconds * Sampling_Frequency NeuroExplorer can import timestamped data stored in the following text formats:

1. Multicolumn table of timestamps In this format, each column in the text file contains the timestamps of a neuron. The first element in eachcolumn is a neuron name, that is the first line of the file contains names of all the variables. Each name should be less than 64 characters long and should contain only letters, digits or theunderscore sign. The first character of the name should be a letter. The timestamps are numbersrepresenting the neuron firing time (or event time) in seconds or in time ticks. NeuroExplorer assumesthat the columns are separated by tabs. Here is an example of a text file with the timestamps represented in seconds: Neuron01 Neuron020.01 0.0010.3 0.050.5 0.1 0.4 0.6 NeuroExplorer can also export data in this format (use File | Save Data | As a Text File menucommand).

2. Pairs <name> <timestamp> The text file in this format should contain the pairs of the type <name><timestamp>

Page 28

Page 31: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

where <name> is a character string that is less than 64 characters long and contains only letters, digits and theunderscore sign. The first character of the name should be a letter. If the number is used for the name,NeuroExplorer will add "event" at the beginning of the name. <timestamp> is a number representing the neuron firing time (or event time) in seconds or in time ticks. Here is an example of a text file with the timestamps represented in seconds: Neuron01 0.01Neuron01 0.3Neuron02 0.001Neuron02 0.05Neuron01 0.5Neuron02 0.1Neuron02 0.4

3. Multicolumn text files with continuous data NeuroExplorer can also import continuous data from a multicolumn text file where each columncorresponds to a continuous variable: ContChannel1 ContChannel2114.74609 -63.4765656.15234 -358.88672-187.98828 -63.47656-48.82813 388.18359-26.85547 285.64453 The columns may be separated by any number of spaces, tabs or commas. When you import continuous data from text files, the following dialog is shown:

First line contains variable names – if this option is selected, the fields of the first line of the text file areused as variable names. The second line in the file is the first row of data. First Data Point Timestamp specifies the timestamp of the first data point in each continuous variable. Time Between Data Points specifies the time step used in calculation of the timestamp for each row ofdata. For data row N (N = 1, 2, …) in the text file, the timestamp is calculated using the following formula: DataRowTimestamp = FirstDataPoint + (N-1)*TimeBetweenDataPoints

Page 29

Page 32: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

•••

1.8. Importing Data from Spreadsheets Timestamped data can be pasted directly into the NeuroExplorer data table. To paste the following twotimestamped variables (BarPress and Reward) from a spreadsheet to NeuroExplorer:

In Excel:

Using the mouse, select the cell range with both variables (A1 to B5)Select Edit | Copy menu command

In NeuroExplorer: Select Data view of the file in NeuroExplorerSelect the Timestamps tab of the Data viewRight-click and select Paste menu command:

 NeuroExplorer will create two new Event variables and add them to the file. You need to save the file(use File | Save or File | SaveAs menu command) to make this change permanent.

Page 30

Page 33: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

••

1.9. Importing Data from Matlab You can create spike trains (1xN or Nx1 matrices with timestamps in seconds) or continuous variables inMatlab and transfer them to NeuroExplorer on the fly. Here is how to do this:

Select File | New menu command.Select Matlab | Get Data From Matlab | Open Matlab As Engine menu command. NeuroExplorerwill open Matlab as engine.In opened Matlab, run your Matlab scripts and create (or load from file) spike train variables orcontinuous variables.To import timestamp variables, in NeuroExplorer, select Matlab | Get Data From Matlab | GetTimestamp Variables... menu command. NeuroExplorer will open a dialog with the list of availableMatlab variables.In the dialog, select the variables you want to transfer to NeuroExplorer and press OK.To import continuous variables, in NeuroExplorer, select Matlab | Get Data From Matlab | GetContinuous Variables... menu command. NeuroExplorer will open a dialog with the list of availableMatlab variables.In the dialog, select one of the variables you want to transfer to NeuroExplorer and press OK.NeuroExplorer will open a dialog where you will specify the variable import options.

Page 31

Page 34: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.10. Reading and Writing NeuroExplorer Data Files NeuroExplorer Data file has the following structure: file header variable header 1 variable header 2 ... data for variable i data for variable j ... Each variable header contains the size of the array that stores the variable data as well as the location ofthis array in the file. The pseudo-code for reading NeuroExplorer data file looks like this: open file in binary mode read file header for each variable read variable headerend for for each variable header seek to the file offset specified in the variable header read variable dataend for The C++ source code of the program that reads and writes NeuroExplorer data files is available atNeuroExplorer web site: http://www.neuroexplorer.com/downloads/HowToReadAndWriteNexFiles.zip   There are also Matlab scripts to read and write NeuroExplorer data files: http://www.neuroexplorer.com/downloads/HowToReadAndWriteNexFilesInMatlab.zip  

Page 32

Page 35: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

1.11. 1D Data Viewer NeuroExplorer provides a window that displays graphically all the selected variables. To open thiswindow, use View | 1D Data Viewer Window menu command. You can also use 1D view to manually add events to the data file. Simply press the left mouse buttonwhen the pointer is in the 1D view and NeuroExplorer will add a new timestamp to the variableManualEvent. You can also specify to what Event variable NeuroExplorer will add timestamps when youclick in 1D view (use On mouse click parameter in the Properties Panel).

Mouse wheel can be used to quickly navigate in 1D View:

Click in 1D View so set 1D View as an active window in NeuroExplorerPress Shift and rotate mouse wheel to shift 1D View horizontallyPress Ctrl and rotate mouse wheel to increase time range (zoom out) and decrease time range(zoom in)

Page 33

Page 36: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.12. Analyzing Data NeuroExplorer provides a variety of spike train analysis methods. Each method has a number ofparameters and options. You can apply any available analysis by clicking at the corresponding analysisin the Analyses Panel (you can also use Analysis | Select Analysis menu commands):

After you click at one of the analysis items, NeuroExplorer will open a dialog that will allow you to edit theanalysis parameters. When you click OK in this dialog, NeuroExplorer will apply the specified analysis toall the selected variables. Any combination of analysis parameters and options (together with all the graphics options) can besaved as a template. To save the current configuration as a template, right-click in the Graph Windowand select Save As New Template menu command. The template names are shown in the Templatesview of the control panel. When you open a new data file, you can simply double-click on the template name to apply the specificanalysis with the selected parameter values.

Page 34

Page 37: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

1.13. Selecting Variables for Analysis NeuroExplorer can analyze at once any group of variables in the file. To select the variables to be analyzed, use one of the following methods:

Select the variables using the Variable Panel (see How to select variables using Variables Panel )Select the variables using Analysis | Select Variables menu command. This command will invokethe Variable Selection dialog similar to Variables Panel.Select the variables directly in the Variables Window by using the check boxes located next to thevariable names. Please note that variable selection in Variables Window is applied only whena new Graph Window or 1D View is created. To change the list of selected variables inexisting Graph Window, use Variables Panel or Analysis | Select Variables menu command. See How to Select Variables for Existing Analysis Window for details.

Page 35

Page 38: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

1.14. How to Select Variables for Existing Window Variables selected in the Variables spreadsheet of data window are used to populate variables lists ofnew analysis windows. If you would like to change the list of variables for existing analysis window, please follow these steps:

Click anywhere in analysis window to activate itIf Variables panel is visible, make changes in selected variables list ( how? ) and press Apply

button:

If Variables panel is hidden, click at panel tab to open it:

Page 36

Page 39: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

Make changes in selected variables list ( how to make changes? ) and press Apply buttonIf Variables panel or its tab is not visible, use View | Variables Panel menu command

Page 37

Page 40: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.15. How to Select Variables in Variables Panel Select variables for analysis by moving them from the left (available) to the right (selected) list box. In thefigure below, 6 variables (Neuron04a, Neuron05b, ..., Neuron07a) are selected for analysis:

To move variables from one listbox to another:

Select variables using the mouse (in the figure above two variables in Available listbox are selected-- ContChannel01 and ContChannel02)Press one of four buttons just above the listboxes

The drop-down box above the buttons can be used to specify what kind of variables are shown in theavailable window:

Page 38

Page 41: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

1.16. Adjusting Analysis Properties There are several methods to adjust the analysis parameters:

Use Analysis | Edit Parameters menu command to invoke the Analysis Parameters dialogRight-click in the Graph Window and choose Analysis Parameters item in the floating menuSingle-click in the graph area of the Graph Window and adjust parameters in the Properties Panel

The floating menu is the fastest way to adjust any analysis or graphics parameters. Double-click (or right-click) anywhere in the Graph Window to invoke this menu:

This menu allows you to go directly to analysis properties, graph properties, axes properties, etc. Youcan also use it to save the current template and save the current analysis configuration as a newtemplate. You can also single-click in the graph area of the Graph Window and adjust parameters in the PropertiesPanel:

Page 39

Page 42: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Page 40

Page 43: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••••

••

1.17. Analysis Templates In any analysis in NeuroExplorer, you can adjust a large number of parameters:

Analysis type (Rate Histograms, IIH, etc)Analysis parameters (Bin, XMin, XMax, etc.)Graph parameters (graph type, graph color, grid lines, etc)Parameters of X and Y axes (labels, numerics, lines, colors, etc.)Graph and page labels and other elements

NeuroExplorer allows you to save all these parameters so that when you open another data file, you caneasily reproduce exactly the same analysis with the same axes, labels and so on. The set of all the analysis parameters is called the Template. To save the current analysis as a template:

Select the menu command Template | Save As New Template, orRight-click in the graph and choose the Save As New Template command in the floating menu.

After you saved the template, the name of the template appears in the Templates Window (see

NeuroExplorer Screen Elements ). You can apply the template to the currently opened file by double-

clicking the template name in the Templates Window. You can specify templates directory by selecting Templates | Template Properties... menu command.

Page 41

Page 44: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.18. Numerical Results To view the analysis numerical results, select View | Numerical Results Window menu command. NeuroExplorer will open Numerical Results Window:

Note that the window has two Excel-style sheets -- the Results sheet and the Summary sheet. TheResults sheet usually contains the bin counts or other histogram values. The Summary sheet containssummary statistics of the analyses such as the mean firing rate, the number of spikes used in theanalysis, etc.

Page 42

Page 45: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.19. Post-processing For the histogram-style analyses, NeuroExplorer has an optional Post-Processing analysis step. Youcan select post-processing options using Post-processing tab in the Analysis Parameters dialog (double-click in Graph window and select Analysis Parameters menu item):

You can smooth the resulting histogram with Gaussian or Boxcar filters. You can also add bin informationto the matrix of results. See Post-processing Options for details. See Saving Results as PowerPoint Slides, Working with Matlab and Working with Excel for more

information on NeuroExplorer post-processing options.

Page 43

Page 46: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.20. Saving Graphics NeuroExplorer can save the contents of the Graph window in a file using the Windows Metafile format.The file can then be opened in any program that can use the.wmf format files (a word processor,graphics editor, etc.). To save the graphics in a metafile, use Graphics | Export Graphics menu commands. You can also copy the graphics to the clipboard and then paste in another application. To copy thegraphics, single-click in the graph area and then select Edit | Copy menu command. See also Saving Results as PowerPoint Slides.

Page 44

Page 47: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••••

1.21. Saving Results as PowerPoint Slides NeuroExplorer version 3 provides a powerful new option that allows you to save graphics, analysisparameters and your annotations as slides in a PowerPoint Presentation. To save your results to PowerPoint, press a toolbar button , or select Graphics | Export Graphics |Export to PowerPoint menu command. NeuroExplorer will start PowerPoint if PowerPoint is notrunning, and will add a new slide to the specified presentation file. The slide will contain:

Copy of the graphicsAnalysis parametersYour commentData file nameCurrent date and time

PowerPoint presentation then becomes your lab notebook where you can save your NeuroExploreranalysis results.

Page 45

Page 48: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

••

1.22. Working with Results Files NeuroExplorer can save both graphical and numerical results of the analysis in a NeuroExplorer resultsfile. Since each result has both graphics and numerical values, the results are saved in a set of files withcommon file name and different extensions. You can use Saved Results | Quick Save Results menu command to save all the current results. For example, if you run Aurocorrelograms analysis on data file TestDataFile54.nex and select QuickSave Results, the results will be saved in the following 5 files:

TestDataFile54_nex Autocorrelograms.nexresult (text file with links to other files of this result)TestDataFile54_nex Autocorrelograms numres.txt (text file with numerical results)TestDataFile54_nex Autocorrelograms numres summary.txt (text file with the summary of numericalresults)TestDataFile54_nex Autocorrelograms.png (.png file with graphical analysis results)TestDataFile54_nex Autocorrelograms.ntp (template file with analysis parameters)

By default, these files be saved in the folder: C:\Users\<your_user_name>\Documents\NeuroExplorer5\Results. You can also specify a custom results directory using Saved Results | Set Results Foldermenu command.   The .nexresult file is the file containing description of the analysis and the links to other result files. Youcan open this file in NeuroExplorer using Saved Results | Open Saved Results File menu command. When you open results file, NeuroExplorer loads graphics and numerical results files and shows awindow with 4 tabs:  

Page 46

Page 49: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

  This window looks similar to the Graphical results window, but the results are not 'live' -- you cannotadjust analysis parameters and recalculate the results. However, you can restore the analysis saved in the results file. Use Saved Results | Restore Analysisin NeuroExplorer menu command:

  NeuroExplorer will do the following:

Open data file used in the calculation of resultsSelect variables for analysis exactly as they were selected in the saved resultsRun the analysis used in the calculation of results (using the same analysis parameters)

You can also use Saved Results | Results Folder Summary menu command to view all the savedresults in a grid:  

In this Results Folder Summary View you can: - Sort results by any of the columns by clicking at the column header - Open results file by double-clicking the row representing the file

Page 47

Page 50: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

- Convert selected results to PowerPoint slides using right-click and selecting Add Slides... contextmenu command - Select results using Find combo box in the NeuroExplorer toolbar. The text in all the columns will beused when filtering the results. For example, to view only results saved in 2015, type 2015 in Find box:

Page 48

Page 51: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

1.23. Working with Matlab NeuroExplorer can interact with Matlab via COM interface using Matlab as a powerful post-processingengine. Matlab can also control NeuroExplorer and exchange data with NeuroExplorer via NeuroExplorerCOM interfaces. See COM/ActiveX Interfaces for details. Immediately after calculating the histograms, NeuroExplorer can send the resulting matrix of histogramsto Matlab and then ask Matlab to execute any series of Matlab commands. Use the Matlab tab in the Analysis parameters dialog to specify the matrix name and the Matlabcommand string. NeuroExplorer can also send its data variables to Matlab. To transfer the variables to Matlab, use Matlab| Send Selected Variables to Matlab menu command. In general, a continuous variable may contain several fragments of data. Each fragment may be of adifferent length. NeuroExplorer does not store the timestamps for all the A/D values since they would usetoo much space. Instead, for each fragment, it stores the timestamp of the first A/D value in the fragmentand the index of the first data point in the fragment. Therefore, for a continuous variable (namedContVar1), the following 3 vectors will be created in Matlab:

ContVar1 - vector (or matrix with 2 columns) of all A/D values in milliVolts. If "Optimize transfer forsmall amounts of data" is selected in View | Options | Matlab, Contvar1 is a matrix with 2 columns:the first column contains A/D values in millivolts, the second column contains timestamps inseconds.ContVar1_ts - vector of fragment timestamps in seconds. Each timestamp is for the first A/D valueof the fragment.ContVar1_ind - array of indexes. Each index is the position of the first data point of the fragment inthe A/D array. If ContVar1_ind (2) = 201, it means that the second fragment is ContVar1 [201],ContVar1 [202], etc.ContVar1_ts_step - digitizing step in seconds.

You can generate all the timestamps for continuous variable using this Matlab script: function [ ts ] = MakeTs( fragmentInd, fragmentTs, numValues, step )% MakeTs: makes timestamps for continuous variable based on the fragment% information% INPUT: fragmentInd - vector of fragment indexes% fragmentTs - vector of fragment timestamps% numValues - total number of values in all fragments% step - digitizing step of continuous variable%% Example: NeuroExplorer sent continuous variable FP01 via file transfer% The following values were sent:% FP01 - vector of continuous values% FP01_ind - fragment indexes% FP01_ts - fragment timestamps% FP01_ts_step - digitizing step%% to generate all timestamps for FP01, use:%% ts = MakeTs(FP01_ind, FP01_ts, size(FP01,1), FP01_ts_step);% ts = []; numFr = size(fragmentTs);

Page 49

Page 52: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

% add fake index for the last fragment fragmetInd = [fragmentInd; numValues+1]; for i=1:numFr valuesInFragment = fragmetInd(i+1)-fragmentInd(i); ts = [ts; (fragmentTs(i) + (0:(valuesInFragment-1))*step)']; endend   You can also import timestamped and continuous variables directly from Matlab. See Importing Data

From Matlab for details.

See Also Importing Data From Matlab COM/ActiveX Interfaces

Page 50

Page 53: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

1.24. Working with Excel The easiest way to transfer data and numerical results from NeuroExplorer to Excel is by using theclipboard:

select a range of cells in NeuroExplorer and choose Edit| Copy switch to Excel and use the Paste command (select a cell and choose Edit | Paste ).

NeuroExplorer can also send numerical results directly to Excel. There two ways to send the results toExcel:

Use Send to Excel button on the toolbar or menu command Results | Numerical Results | SendNumerical Results to Excel Use Excel tab in the Analysis Parameters dialog to specify what to transfer to Excel and the locationof the top-left cell for the data from NeuroExplorer.

Page 51

Page 54: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

••

1.25. Working with R-project NeuroExplorer can use R-project via R-project command line interface. You need to download (freedownload from www.r-project.org) and install R-project to be able to use this functionality ofNeuroExplorer. The R-project scripts should be saved in the folder:C:\Users\<your_user_name>\Documents\NeuroExplorer 5\Rscripts. All the R scripts in this folder (except for the scripts with the script names beginning with underscore) willbe shown as menu commands of the R-project menu. NeuroExplorer Setup installs several scripts inthis folder. You can also add your own scripts. The scripts can be used to run additional statistical analysis on numerical results. When you select an R-script to run, NeuroExplorer does the following:

Saves numerical results in a text fileRuns RScript.exe (a command-line interface for R-project) with the specified R-project script file andprovides the script file with the name of the results text fileThe R-project script file saves its numerical results in a text file and its graphical results in a .png fileNeuroExplorer then shows numerical and graphical results of the R-project script in a new window

Each R script can contain script specifications in the comment lines at the start of the script. Here is ascript description block from the t-test R-project script: #Description:calculates t-test p-values for numerical results# of the active analysis results view# assumes that there are multiple result columns# per NeuroExplorer document variable# for example: multiple interval filters are used in analysis#Input:numerical results;multiple columns per variable#Output:summary#Parameter:name=usePairedTest;type=boolean;default=FALSE#Parameter:name=pValueMin;type=number;default=0.05 This description specifies that the script will use numerical results and the script requires that numericalresults contains multiple columns per NeuroExplorer document variable (the #Input line). The script also specifies two parameters: usePairedTest and pValueMin. Each parameter is specified bya line beginning with #Parameter. Each line should contain three name=value pairs separated bysemicolons. The fist pair specifies parameter name (for example, name=usePairedTest). The second pair specifies parameter type (for example, type=boolean). There are three valid parametertypes: number, boolean and string. The third pair specifies the default parameter value. When you run R script, NeuroExplorer displays a dialog to edit parameter values:

Page 52

Page 55: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Here is how you would use this script to evaluate the statistical significance of changes in neuron firingrates over two time intervals (for example, from zero to 1000s and from 1000s to 2000s): - Run Rate Histograms analysis and specify 'Multiple pairs of XMin, XMax...' option:

- Click on Table.. button and specify time intervals:

Page 53

Page 56: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

- Click on OK in dialogs and run Rate Histograms analysis:

- Select R-scripts | t-test menu command:

Page 54

Page 57: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

  The following R-script results will be shown:

Page 55

Page 58: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

2. NeuroExplorer User Interface NeuroExplorer user interface consists of the main window surrounded by several panels. These panelsallow you to select files, select analyses and specify analysis properties. The figure below shows thedefault layout of NeuroExplorer window. Files, Properties, Analyses, Variables and Explore panels arevisible and Templates and Scripts panels are hidden. To view a hidden panel, click at the panel tab oruse View menu command. You can reposition panels by dragging them with your mouse and you can save and restore windowlayouts using Window menu commands.

Files Panel

Page 56

Page 59: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

This view allows you to quickly browse through your data files. When you select (single-click) one of thedata files, NeuroExplorer displays the file header information in the Properties panel. To open the datafile, simply double-click the file name.

Analyses Panel

This view allows you to quickly select one of the analyses available in NeuroExplorer. To apply analysisto the active data file, click at the analysis name.

Properties Panel

The left column of the Properties Panel lists the names of adjustable parameters for the selected object.The right column contains various controls that can be used to change the parameter values. To applythe changes, press the Apply button or hit the F5 key.

Templates Panel The Templates View can be used to quickly execute an Analysis Template. Double-click the templatename and the corresponding template will be immediately executed. You can create subfolders in your template directory and then NeuroExplorer will allow you to navigatethrough the templates tree within the Templates View.

Variables Panel

Page 57

Page 60: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

You can analyze all the variables in your data file, a subset of the variables, or may be just one variable.Variables Panel allows you to quickly select and deselect the variables used for analysis:

The left column shows the variables that are not currently selected; the right column shows the selectedvariables. To move variables from column to column, first select them, then press ">" (Select) or "<"(Deselect) buttons.

Scripts Panel This panel can be used to select a script to be executed. Double-click the script name to run the selectedscript. You can create subfolders in your script directory and then NeuroExplorer will allow you to navigatethrough the scripts tree within the Scripts View.

Explore Panel

Explore panel allows you to quickly explore analysis parameter ranges. Select a parameter you want toexplore from a list and drag a slider. NeuroExplorer will keep recalculating analysis with the newparameter values while you drag the slider, thus creating an “analysis animation”. One of the best uses for this panel is to explore analysis properties over a sliding window within your file:

Specify Use Time Range using Analysis | Edit menu command, then Data Selection tab Select ‘Select Data From’ and ‘Select Data To’ parameters in the list boxes of the Explore panel Click on Link Sliders check box

Now, when you drag one of the sliders, the other one will follow allowing you to visualize analysis resultsover a sliding window in time.

See Also NeuroExplorer Menu Commands

Page 58

Page 61: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

2.1. NeuroExplorer Screen Elements NeuroExplorer user interface consists of the main window surrounded by several panels. These panelsallow you to select files, select analyses and specify analysis properties. The figure below shows thedefault layout of NeuroExplorer window. Files, Properties, Analyses, Variables and Explore panels arevisible and Templates and Scripts panels are hidden. To view a hidden panel, click at the panel tab oruse View menu command. You can reposition panels by dragging them with your mouse and you can save and restore windowlayouts using Window menu commands.

Files Panel

Page 59

Page 62: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

This view allows you to quickly browse through your data files. When you select (single-click) one of thedata files, NeuroExplorer displays the file header information in the Properties panel. To open the datafile, simply double-click the file name.

Analyses Panel

This view allows you to quickly select one of the analyses available in NeuroExplorer. To apply analysisto the active data file, click at the analysis name.

Properties Panel

The left column of the Properties Panel lists the names of adjustable parameters for the selected object.The right column contains various controls that can be used to change the parameter values. To applythe changes, press the Apply button or hit the F5 key.

Templates Panel The Templates View can be used to quickly execute an Analysis Template. Double-click the templatename and the corresponding template will be immediately executed. You can create subfolders in your template directory and then NeuroExplorer will allow you to navigatethrough the templates tree within the Templates View.

Variables Panel

Page 60

Page 63: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

You can analyze all the variables in your data file, a subset of the variables, or may be just one variable.Variables Panel allows you to quickly select and deselect the variables used for analysis:

The left column shows the variables that are not currently selected; the right column shows the selectedvariables. To move variables from column to column, first select them, then press ">" (Select) or "<"(Deselect) buttons.

Scripts Panel This panel can be used to select a script to be executed. Double-click the script name to run the selectedscript. You can create subfolders in your script directory and then NeuroExplorer will allow you to navigatethrough the scripts tree within the Scripts View.

Explore Panel

Explore panel allows you to quickly explore analysis parameter ranges. Select a parameter you want toexplore from a list and drag a slider. NeuroExplorer will keep recalculating analysis with the newparameter values while you drag the slider, thus creating an “analysis animation”. One of the best uses for this panel is to explore analysis properties over a sliding window within your file:

Specify Use Time Range using Analysis | Edit menu command, then Data Selection tab Select ‘Select Data From’ and ‘Select Data To’ parameters in the list boxes of the Explore panel Click on Link Sliders check box

Now, when you drag one of the sliders, the other one will follow allowing you to visualize analysis resultsover a sliding window in time.

See Also NeuroExplorer Menu Commands

Page 61

Page 64: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

2.2. NeuroExplorer Menu Commands The following menu commands are available in NeuroExplorer

Menu Command Description

File | New Create a new document

File | Open... Open an existing document

File | Restore Last Analysis Restore lasts analysis

File | Close Close the active document

File | Save Save the active document

File | Save As .NEX File... Save the active document with a new name

File | Save As .NEX5 File... Save the active document with a new name

File | Import Data | Plexon PLX,PL2 or DDT File...

Import data from Plexon .plx file

File | Import Data | Plexon SPKFile...

Import data from Plexon .spk file

File | Import Data | Alpha OmegaData File...

Import data from Alpha-Omega file

File | Import Data | BlackrockMicrosystems File...

Import data from Blackrock Microsystems file

File | Import Data | CED Spike-2Data File...

Import data from CED Spike-2 file

File | Import Data | CORTEX DataFile...

Import data from CORTEX data file

File | Import Data | DataWaveFile...

Import data from DataWave file

File | Import Data | MultichannelSystems Data File...

Import data from Multichannel Systems file

File | Import Data | Neuralynx DataFile...

Import data from Neuralynx file(s)

File | Import Data | RC ElectronicsData File...

Import data from RC Electronics file

File | Import Data | Stranger DataFile...

Import data from Stranger file

File | Import Data | Text File... Import data from a text file

File | Import Data | Text File withContinuous Variables...

Import continuous variables from a text file

File | Import Data | AxonInstruments ABF File...

Import data from Axon Instruments ABF file

File | Import Data | Axion Data Import data from Axion data file

Page 62

Page 65: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

File...

File | Import Data | MED64 MobiusNative Format Data File...

Import data from MED64 Mobius file

File | Import Data | MED64 Mobius.csv Spike Time File...

Import data from MED64 .csv file

File | Import Data | European DataFormat .edf File...

Import data from European Data Format .edf file

File | Import Data | KlustaSuite.kwik File...

Import data from KlustaSuite .kwik file

File | Import Data | Open EphysFiles...

Import data from Open Ephys files (.continuous, .spikes and.events)

File | Import Data | Intan DataFile...

Import data from Intan data file

File | Import Data | Ripple DataFile...

Import data from Ripple data file

File | Import Data | 3Brain DataFile...

Import data from 3Brain data file

File | Export Data | As a Text File... Export Timestamps As a Text File

File | Merge Files... Merge several similar data files into one

File | Connect to Plexon Server Connect to Plexon Server

File | Print... Change the printer and printing options

File | Print Preview Display full pages

File | Print Setup... Change the printer and printing options

File | Page Setup... Open a dialog to edit page elements

File | Save NeuroExplorer State... Save NeuroExplorer State

File | Restore NeuroExplorerState...

Restore NeuroExplorer State

File | Exit Quit the application; prompts to save documents

Edit | Undo Undo the last action

Edit | Redo Redo the previously undone action

Edit | Cut Cut the selection and put it on the Clipboard

Edit | Copy Copy the selection and put it on the Clipboard

Edit | Paste Insert Clipboard contents

Edit | Edit Graphics | Switch toPage Layout Mode

Edit the layout of the whole page

Edit | Edit Graphics | Switch toGraph Layout Mode

Edit the layout of each graph

Page 63

Page 66: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Edit | Edit Graphics | BlockProperties...

Edit the properties of the block of graphs

Edit | Edit Graphics | GraphProperties...

Edit graph properties

Edit | Edit Graphics | X AxisProperties...

Edit X axis properties

Edit | Edit Graphics | Y AxisProperties...

Edit Y axis properties

Edit | Edit Graphics | PageLabels...

Edit text elements of the page

Edit | Edit Graphics | GraphLabels...

Edit text elements of each graph

Edit | Edit Markers | Split IntoMultiple Events...

Split marker variable into multiple event variables

Edit | Edit Markers | ExtractEvents...

Extract events according to the specified conditions

Edit | Edit Markers | ExtractPosition Variables...

Extract position variables

Edit | Delete Variables... Open a dialog to select the variables you would like to delete

Edit | Copy Selected Variables toAnother File...

Copy selected variables to another file

Edit | Operations on DataVariables...

Open Operations on Data Variables dialog

Edit | Add Interval Variable... Add an interval variable to the current document

Edit | Add Population Vector... Open a dialog to add a population vector to current document

Edit | Set Positions of theNeurons...

Set positions of the neurons

Edit | Digital Filter ContinuousVariable...

Digital filter continuous variable

Edit | Convert Video-BasedContinuous Variables...

Open a dialog to convert video-based variable to a cont. variable

View | Toolbar Show or hide the toolbar

View | Status Bar Show or hide the status bar

View | 1D Data Viewer Window Open a one-dimensional data viewer

View | Numerical Results Window Open numerical results window

View | Files Panel View Files panel

View | Analyses Panel View Analyses panel

View | Properties Panel View Properties panel

View | Variables Panel View Variables panel

Page 64

Page 67: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

View | Templates Panel View Templates panel

View | Scripts Panel View Scripts panel

View | Explore Panel View Explore panel

View | Restore Default Layout... Restore default panel layout

View | Options... Open NeuroExplorer Options dialog

View | Data Import Options... Open Data Import Options dialog

View | Average/Overlay ChartWindow

Open Average/Overlay Chart window

View | Results Folder Summary Open results folder summary window

View | History Thumbnails... Open History Thumbnails dialog

View | History Script... Open History Script in NexScript editor

Analysis | Edit Parameters... Open the dialog to edit the current analysis parameters

Analysis | Select Variables ... Select Variables for Analysis

Analysis | Increase X Range Increase X Range in the current analysis

Analysis | Decrease X Range Decrease X Range in the current analysis

Analysis | Restore Last Analysis Restore lasts analysis

Results | Graphical Results | CopyGraphics to the Clipboard

Copy all the block graphics to the clipboard

Results | Graphical Results | SaveGraphics in WMF File...

Saves graphics in a Windows Metafile

Results | Graphical Results | SaveGraphics in PNG File...

Save graphics in a .png file

Results | Graphical Results | SaveGraphics in SVG File...

Save graphics in a .svg (Scalable Vector Graphics) file

Results | Graphical Results | SendGraphics to PowerPoint...

Send graphics to PowerPoint

Results | Numerical Results | ViewNumerical Results Window

Open numerical results window

Results | Numerical Results | CopyNumerical Results to the Clipboard

Copy Numerical Results to the clipboard

Results | Numerical Results | SaveNumerical Results in a Text File...

Save numerical results as a text file

Results | Numerical Results | SaveSummary of Numerical Results in aText File....

Save summary of numerical results in a text file

Results | Numerical Results | SendNumerical Results to Excel...

Send Numerical Results To Excel

Results | Numerical Results | Send Send Numerical Results to Matlab

Page 65

Page 68: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Numerical Results to Matlab

SavedResults | Set ResultsFolder...

Sets current saved results folder

SavedResults | Open SavedResults File...

Open saved results file

SavedResults | Open Data FileReferenced in Result

Open data file referenced in result

SavedResults | Restore Analysis inNeuroExplorer

Restore analysis in NeuroExplorer

SavedResults | Quick Save Results Quick save results

SavedResults | Save CurrentAnalysis Results in Results File...

Save current analysis results in results File

SavedResults | Results FolderSummary

Open results folder summary window

SavedResults | Add Slides withSelected Results...

Add Slides with Selected Results

Graphics | Edit Graphics | Switch toPage Layout Mode

Edit the layout of the whole page

Graphics | Edit Graphics | Switch toGraph Layout Mode

Edit the layout of each graph

Graphics | Edit Graphics | BlockProperties...

Edit the properties of the block of graphs

Graphics | Edit Graphics | GraphProperties...

Edit graph properties

Graphics | Edit Graphics | X AxisProperties...

Edit X axis properties

Graphics | Edit Graphics | Y AxisProperties...

Edit Y Axis properties

Graphics | Edit Graphics | ColorScale Properties...

Edit color scale properties

Graphics | Edit Graphics | PageLabels...

Edit text elements of the page

Graphics | Edit Graphics | GraphLabels...

Edit text elements of each graph

Graphics | Export Graphics | CopyGraphics to the Clipboard

Copy all the block graphics to the clipboard

Graphics | Export Graphics | SaveGraphics in WMF File...

Saves graphics in a Windows Metafile

Graphics | Export Graphics | SaveGraphics in PNG File...

Save graphics in a .png file

Graphics | Export Graphics | Send Send Graphics to PowerPoint

Page 66

Page 69: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Graphics to PowerPoint...

Graphics | Fonts | Enable FontAutoScale

Allow NeuroExplorer to reduce font sizes if there are too manygraphs

Graphics | Fonts | Increase fontsize

Increase font size

Graphics | Fonts | Decrease fontsize

Decrease font size

Graphics | Zoom | Zoom In Zoom In

Graphics | Zoom | Zoom Out Zoom Out

Graphics | Zoom | Fit to Window Scale Block so that it fits the screen

Graphics | Insert | Insert Text Insert text into figure

Graphics | Insert | Insert Line Add line

Graphics | Insert | Insert Rectangle Add rectangle to the figure

Graphics | Insert | Insert Text Labelwith the Variable Name

Insert text element with the variable name to each graph

Graphics | Bring to front Bring selected object to front

Graphics | Send to back Send to back

Script | New Script Open a script window

Script | Open Script... Open existing script

Script | History Script... Open history script

Script | Script Options... Open Script Options dialog

Template | Save Template ... Save Template

Template | Save As New Template...

Save As New Template

Template | Save As DefaultTemplate

Saves the current configuration as a default template for thisanalysis

Template | Open Template andRun Analysis From Template...

Opens a File Open dialog to select the template

Template | View TemplateProperties...

View Template Properties

3DView | View Histograms in 3D Show the results in 3D Viewer

3DView | View HistogramVariations in 3D

View Histogram Z-scores in 3D

3DView | 3D Activity Animation Opens a 3D activity viewer

3DView | Graphics Parameters... Opens a dialog to edit this window's graphics parameters

3DView | Save As New 3DTemplate...

Save current graphics parameters as a new 3D template

Page 67

Page 70: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3DView | Save Current 3DTemplate

Save current graphics parameters as a new 3D template

3DView | Save As New AnimationTemplate...

Save current animation template as a new template

3DView | Save Current AnimationTemplate

Save current animation template

Matlab | Matlab Options... Matlab Options

Matlab | Get Data From Matlab |Get Timestamp Variables...

Get timestamp variables from Matlab

Matlab | Get Data From Matlab |Get Continuous Variables...

Get continuous variables from Matlab

Matlab | Get Data From Matlab |Get Continuous Variables withTimestamps...

Get continuous variables with timestamps from Matlab

Matlab | Get Data From Matlab |Get Interval Variables...

Get interval variables from Matlab

Matlab | Get Data From Matlab |Open Matlab As Engine

Open Matlab as engine

Matlab | Send Selected Variablesto Matlab

Send selected variables to Matlab

Matlab | Send Numerical Results toMatlab

Send numerical results to Matlab

R-project | Settings for running R-project via command line...

Open a dialog to specify R-project options

Markers | Split Into MultipleEvents...

Split marker variable into multiple event variables

Markers | Extract Events... Extract events according to the specified conditions

Markers | Extract PositionVariables...

Extract position variables

Online | Connect to Plexon Server Connect to Plexon online data server

Online | Connect to CerebusServer

Connect to Cerebus online data server

Online | Connect to NeuralynxServer

Connect to Neuralynx online data server

Online | Connect to AlphaMapServer

Connect to AlphaMap online data server

Online | Pause Online Data ServerUpdates

Pause online data server Updates

Online | Reset Online Data File Restart the data collection

Online | Disconnect from OnlineData Server

Disconnect from online data server

Page 68

Page 71: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Online | Plexon Online Options... Plexon online options

Online | Cerebus Online Options... Cerebus online options

Online | Neuralynx OnlineOptions...

Neuralynx online options

Online | AlphaMap OnlineOptions...

AlphaMap online options

Sound | Play Continuous Variableas Sound

Play continuous variable as sound

Window | Cascade Arrange windows so they overlap

Window | Tile Horizontally Arrange windows as non-overlapping tiles

Window | Tile Vertically Arrange windows as non-overlapping tiles

Window | Arrange Icons Arrange icons at the bottom of the window

Window | Numerical ResultsWindow

Open numerical results window

Window | Close All Windows Close all child windows

Window | Close All WindowsExcept Currently Active Window

Close all windows except currently active window

Window | Files Panel View Files panel

Window | Analyses Panel View Analyses panel

Window | Parameters Panel View Properties panel

Window | Variables Panel View Variables panel

Window | Templates Panel View Templates panel

Window | Scripts Panel View Scripts panel

Window | Explore Panel View Explore panel

Window | Restore Default Layout... Restore default panel layout

Window | Save Current Layout in aFile...

Saves current panel layout

Window | Restore Layout from aFile...

Restore panel layout from a file

Help | Help Topics List Help topics

Help | NeuroExplorer Web Site Open NeuroExplorer web site home page in the default browser

Help | NeuroExplorer Blog Open NeuroExplorer Blog page in the default browser

Help | Check for Updates... Check for the updates

Help | Update Sentinel Key toEnable Version 5...

Update Sentinel key

Help | About NeuroExplorer... Display program information, version number and copyright

Page 69

Page 72: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

 

See Also NeuroExplorer Screen Elements

Page 70

Page 73: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••••••••••••••••••••••••••••••••••••••••

3. Analysis Reference This section, NeuroExplorer Analysis Reference, describes general pre-processing and post-processinganalysis options, analysis parameters and computational algorithms used in analyses.

Data Types Data Selection Options Post-Processing Options Matlab Options Excel Options Confidence Limits for Perievent Histograms Rate Histograms Interspike Interval Histograms Autocorrelograms Perievent Histograms Crosscorrelograms Rasters Perievent Rasters Joint PSTH Cumulative Activity Graphs Instant Frequency Graphs Interspike Intervals vs Time Poincare Maps Spike Distance vs Time Trial Bin Counts Power Spectral Densities Burst Analysis Principal Component Analysis Perievent Histograms vs. Time Correlations with Continuous Variables Regularity Analysis Place Cell Analysis Reverse Correlation Epoch Counts Coherence AnalysisSpectrogram AnalysisPerievent SpectrogramsJoint ISI DistributionAutocorrelograms Versus TimePerievent Rasters for ContinuousPower Spectra for ContinuousCoherence for ContinuousAnalysis of Head Direction CellsSingle Trial Spectrum AnalysisPhase Analysis via Hilbert TransformWaveform Comparison

Page 71

Page 74: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••••••••

Hazard AnalysisPerievent Firing RatesFind OscillationsFiring PhaseDetect SpikesPython-based AnalysisCV2 AnalysisFiring Rates AnalysisBand Energy versus Time Analysis

Page 72

Page 75: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.1. Data Types NeuroExplorer supports several data types -- spike trains, behavioral events, time intervals, continuouslyrecorded data and other data types. The topics in this section describe the data types used inNeuroExplorer, list the properties of data types, and show how to view and modify various data types inNeuroExplorer.  

Page 73

Page 76: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.1.1. Spike Trains In NeuroExplorer, the most commonly used data type is a spike train. A spike train in NeuroExplorerdoes not contain the spike waveforms, it represents only the spike timestamps (the times when thespikes occurred). A special Waveform data type is used to store the spike waveform values. Events are very similar to spike trains. The only difference between spike trains and events is that spike

trains may contain additional information about recording sites, electrode numbers, etc. (for example,

spike trains contain positions of neurons used in the 3D activity "movie" ). Internally, the timestamps are stored as 64-bit signed integers. These integers are usually thetimestamps recorded by the data acquisition system and they represent time in the so-called time ticks.For example, the typical time tick for the Plexon system is 25 microseconds, so an event recorded at 1sec will have the timestamp equal to 40000.

Limitations The maximum number of timestamps (in each spike train) in NeuroExplorer is 2,147,483,647 for 32-bitversion and 4,294,967,295 for 64-bit version. In reality, the limiting factor is the amount of virtual memoryon your machine, since the timestamps of all the variables of a data file should fit into memory.NeuroExplorer requires that in each spike train all the timestamps are in ascending order, that is timestamp[i+1] > timestamp[i] for all i. NeuroExplorer also requires that timestamp[i] >= 0 for all i.  

Timestamped Variables in NexScript You can get access to any timestamp in the current file. For example, to assign the value 0.5 (sec) to thethird timestamp of the variable SPK01a, you can use this script: doc = GetActiveDocument()doc["SPK01a"][3] = 0.5

Viewers You can view the timestamps of the selected variables in graphical display ( View | 1D Data Viewermenu command):

Numerical values of the timestamps (in seconds) are shown in the Timestamps sheet of the Data view:

Page 74

Page 77: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Page 75

Page 78: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.1.2. Events Event data type in NeuroExplorer is used to represent the series of timestamps recorded from externaldevices (for example, stimulation times recorded as pulses produced by the stimulus generator). Eventdata type stores only the times when the external events occurred. A special Marker data type is used to

store the timestamps together with other stimulus or trial information. Events are very similar to spike trains. The only difference between spike trains and events is that spiketrains may contain additional information about recording sites, electrode numbers, etc. Internally, event timestamps are represented exactly as Spike Train timestamps. See Spike Trains for

more information about the timestamps in NeuroExplorer.

Creating Event Variables You can add events to the data file using Copy | Paste command in the Timestamps view (see Importing

Data from Spreadsheets for details). You can also create additional events based on the events in the data file. Use Edit | Operations onData Variables menu command and then select one of the operations in the Operations dialog.

Page 76

Page 79: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.1.3. Intervals Intervals are usually used in NeuroExplorer to select the data from a specified time periods (see Data

Selection Options for details). Each interval variable can contain multiple time intervals. For example, the Frame variable in thefollowing figure has two intervals:

Creating Interval Variables You can create intervals in NeuroExplorer using Edit | Add Interval Variable menu command. You can also create intervals based on existing Event or Interval variables. Use Edit | Operations onData Variables menu command and then select one of the following operations: MakeIntervals MakeIntFromStart MakeIntFromEnd IntOpposite IntAnd IntOr IntSize IntFind Burst analysis creates interval variables (one for each neuron) that contain all the detected bursts as time

intervals.

Interval Variables in NexScript IntVar[i,1] gives you the access to the start of the i-th interval, IntVar[i,2] gives you the access to the end of the i-th interval. For example, the following script creates a new interval variable that has two intervals: from 0 to 100seconds and from 200 to 300 seconds: doc = GetActiveDocument()doc["MyInterval"] = NewIntEvent(doc)AddInterval(doc["MyInterval"], 0., 100.)AddInterval(doc["MyInterval"], 200., 300.) Limitations Internally, NeuroExplorer stores the beginning and the end of each interval as a timestamp (see Spike

Trains for more information about timestamps in NeuroExplorer).

Page 77

Page 80: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Viewers You can view the intervals of the selected variables in graphical display ( View | 1D Data Viewer menucommand, see figure above). The intervals (in seconds) are shown in the Intervals sheet of the Data view.

Page 78

Page 81: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.1.4. Markers Marker data type in NeuroExplorer is used to represent the series of timestamps recorded from externaldevices (for example, stimulation times recorded as pulses produced by the stimulus generator) togetherwith other stimulus or trial information. Event data type stores only the times when the external events

occurred. NeuroExplorer creates Marker variables when it imports, for example, strobed events from Plexon datafiles.

Viewers You can view both the marker timestamps and additional marker information in the Markers tab of theData window:

Extracting Events Usually you will need to extract events with specific trial information from the marker variables. To dothis, use Marker | Split... and Marker | Extract... menu commands. For example, you may want to extract from the marker variable shown in the figure above only themarkers with DIOValue 25624 or 01000. Marker | Extract... menu command will open the Extract dialogbox in which you can specify multiple criteria for extracting events from the marker variable:

Page 79

Page 82: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Page 80

Page 83: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••••

3.1.5. Population Vectors Population vectors in NeuroExplorer can be used to display the linear combinations of histograms insome of the analyses. For example, you can calculate perievent histograms for each individual neuronrecorded in a data file. If you want to calculate the response of the whole population of neurons (that is,create an average PST histogram) you need to use a population vector. Population vector assigns a weight to each spike train or event variable in the file. You can then usepopulation vectors in the following analyses:

Rate HistogramsInterspike Interval HistogramsPerievent HistogramsTrial Counts

If you select the population vector for analysis and then run one of the four analyses listed above, thehistogram corresponding to the population vector will be calculated as: histogram_of_neuron_1 * weight_1 + histogram_of_neuron_2 * weight_2... where the weights are defined in the population vector. For example, to calculate an average histogramfor 6 neurons, the following population vector should be used:

Creating Population Vectors You can create new population vectors in NeuroExplorer using Edit | Add Population Vector menucommand. Principal Component Analysis creates a set of population vectors based on correlations between

activities of individual neurons.

Page 81

Page 84: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

3.1.6. Waveforms The waveform data type is used in NeuroExplorer to store the spike waveform values together with thespike timestamps. The following figure shows the waveform variable sig006a_wf together with thecorresponding spike train sig006a:

The waveform data may not be imported by default from the data files created by the data acquisitionsystems. Use View | Data Import Options menu command to specify which data types NeuroExplorerwill import from the data files. The waveform variables can be used in the following analyses:

Rate HistogramsRastersPerievent Histograms (instead of PST, NeuroExplorer calculates spike-triggered average for awaveform variable)Waveform Comparison

Viewers You can view the waveforms of the selected variables in the graphical display ( View | 1D Data Viewermenu command, see figure above). Numerical values of the waveforms and their timestamps are shown in the Waveforms sheet of the Dataview.

Page 82

Page 85: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

To select a different waveform variable, click in the cell located in the row 1 of the Variable column (thecell shows sig001a_wf in the figure above). Waveform values are shown in columns labeled 1, 2, etc.

Page 83

Page 86: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

••••••••••

3.1.7. Continuously Recorded Data The continuous data type is used in NeuroExplorer to store the data that has been continuously recorded(digitized). The following figure shows continuous variable AD01 together with the spike train sig001a:

Continuous data may not be imported by default from the data files created by the data acquisitionsystems. Use View | Data Import Options menu command to specify which data types NeuroExplorerwill import from the data files. Continuous variables can be used in the following analyses:

Rate HistogramsRastersPerievent Histograms (instead of PST, NeuroExplorer calculates the spike-triggered average for acontinuous variable)Perievent Rasters (NeuroExplorer shows the values of continuous variable using color)Trial Bin CountsSpectral DensitiesCorrelations with Continuous VariableCoherence AnalysisSpectrogramsPerievent SpectrogramsPhase Analysis via Hilbert TransformSingle Trial Spectrum AnalysisFind Oscillations

Limitations Internally, each data point of the continuous variable is stored as a 2-byte integer (if data is imported froma file created by a data acquisition system) or as a 4-byte floating point number (if data is imported from atext file or from Matlab). The maximum number of values (in each continuous variable) in NeuroExploreris 2,147,483,647 for 32-bit version and 4,294,967,295 for 64-bit version. In reality, the limiting factor isthe amount of virtual memory in your computer since all the values should fit into virtual memory.

Viewers You can view continuous variables in the graphical display ( View | 1D Data Viewer menu command,see figure above). Numerical values of the continuous variables are shown in the Continuous sheet of the Data view.

Page 84

Page 87: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.2. Data Selection Options Before performing the analysis, NeuroExplorer can select the timestamped events that are inside thespecified time intervals:

For example, you may want to analyze only the first 10 minutes of the recording session. To do this,choose the Data Selection tab in the Analysis Parameters dialog, click Use only the data from thefollowing time range and specify From and To parameters in seconds:

You can also choose an interval variable (at the bottom of the Data Selection page) as an additional datafilter. NeuroExplorer then will select data from one or more time intervals as specified by the intervalvariable. Some analyses (Perievent Histograms, Perievent Rasters and Crosscorrelograms) allow you to specifyseveral interval filters, so that a different filter will be used for a column or for a row of graphs.

Page 85

Page 88: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.3. Post-Processing Options For the histogram-style analyses, NeuroExplorer has an optional Post-processing analysis step. Youcan select post-processing options using Post-processing tab in the Analysis Parameters dialog. (double-click in the Graph window and select Analysis Parameters menu item):

You can smooth the resulting histogram with Gaussian or Boxcar filters. The boxcar filter is a filter with equal coefficients. If f[i] is i-th filter coefficient and w is the filter width, then f[i] = 1/w for all i Thus for the filter of width 3, the boxcar filter is f[-1] = 0.33333, f[0] = 0.33333, f[1] = 0.33333. and the smoothed histogram sh[i] is calculated as sh[i] = f[-1]*h[i-1] + f[0]*h[i] + f[1]*h[i+1] where h[i] is the original histogram. The boxcar filter needs to include the same number of histogram values before and after the currentvalue. This means that the number of coefficients of the filter cannot be even. If the filter width w isspecified as an even number, the actual filter width will be w+1. The Gaussian filter is calculated using the following formula: f[i] = exp(-i*i/sigma)/norm, i from -2*d to 2*d where d = ( (int)w + 1 )/2sigma = -w * w * 0.25 / log(0.5)norm = sum of exp( -i * i / sigma), i from -2*d to 2*d The parameters of the filter are such that the width of the Gaussian curve at half the height equals to thespecified filter width. Please note that for the Gaussian filter, width of the filter (w) can be a non-integer.For example, w can be 3.5.

Page 86

Page 89: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

See Matlab Options and Excel Options for more information on NeuroExplorer post-processing

capabilities.  

Page 87

Page 90: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.4. Matlab Options NeuroExplorer can interact with Matlab via COM interface using Matlab as a powerful post-processingengine. Immediately after calculating histograms, NeuroExplorer can send the resulting matrix ofhistograms to Matlab and then ask Matlab to execute any series of Matlab commands. Use the Matlab tab in the Analysis parameters dialog to specify the matrix name and the Matlabcommand string.

Page 88

Page 91: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.5. Excel Options NeuroExplorer can send numerical results directly to Excel. There are two ways to send the results toExcel:

Use Send to Excel button on the toolbar or menu command File | Save Numerical Results | SendResults to Excel Use Excel tab in the Analysis Parameters dialog to specify what to transfer to Excel and the locationof the top-left cell for the data from NeuroExplorer.

Page 89

Page 92: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.6. Confidence Limits for Perievent Histograms If the total time interval (experimental session) is T (seconds) and we have N spikes in the interval, thenthe neuron firing rate (spikes per second) is: F = N/T Several options how to calculate neuron firing rate F are available. See Options below. Then if the spike train is a Poisson train, the probability of the neuron to fire in the small bin of the size b(seconds) is P = F*b The expected bin count for the perievent histogram is then: C = P*NRef, where NRef is the number of the reference events. The value C is used for drawing the Mean Frequency in the Perievent Histograms and Cross- andAutocorrelograms. The confidence limits for bin counts are calculated using the assumption that the bin count has a Poissondistribution with mean C. Assume that a random variable S has a Poisson distribution with parameter (and mean) C. Then, the99% confidence limits are calculated as follows: Low Conf. = x such that Prob(S < x) = 0.005 High Conf. = y such that Prob(S > y) = 0.005 If C < 30, NeuroExplorer uses the actual Poisson distribution Prob(S = K) = exp(-C) * (C^K) / K!, where C^K is C to the power of K, to calculate the confidence limits. If C>= 30., the Gaussian approximation of Poisson distribution is used (the approximation ofPoisson(Lambda) is a Gaussian distribution with mean and variance of Lambda). For example, for 99% confidence limits: Low Conf. = C - 2.58*sqrt(C); High Conf.= C + 2.58*sqrt(C);

Reference Abeles M. Quantification, smoothing, and confidence limits for single-units histograms. Journal ofNeuroscience Methods. 5(4):317-25, 1982

Options The following options to calculate neuron firing rate F are available:

Use target and reference timestamps from selected time range and interval filter. T is thelength of all the time intervals used in analysis, N is the number of spikes within these intervals. Use all target and reference timestamps from the file. Here T is the total length of experimentalsession, N is the total number of spikes for a given neuron. Use target timestamps from the time intervals corresponding to bins before zero. This optiononly works for a stimulation-type data. For example, if you stimulate every second and calculatePSTH with XMin=-0.2, XMax=0.2, NeuroExplorer can easily distinguish the spikes before and afterthe stimulus. However, if you stimulate every 200 ms, the spikes before the second stimulus are

Page 90

Page 93: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

also the spikes after the first stimulus, so you cannot distinguish the spikes that should be used tocalculate the mean firing rate. The algorithm: for each reference event timestamp r, a time interval(r+XMin, r) is created (where XMin is PSTH or crosscorrelogram time axis minimum parameter;XMin should be negative). T is the length of all (r+XMin, r) intervals that do not overlap, N is thenumber of spikes in these intervals. If more than 5% of intervals overlap, F is set to zero. Use target timestamps from interval filter. Use this option when you want to calculate theneuron firing rate using spikes from an interval filter that is different from the interval filter specifiedin the Data Selection page. T is the length of all the time intervals of the specified interval filter, N isthe number of spikes within these intervals.

Page 91

Page 94: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.7. Cumulative Sum Graphs Here is the algorithm that is used to draw optional cumulative sum graphs above the histograms. Suppose we have a histogram with bin counts bc[i], i=1,...,N. Cumulative Sum Graph displays thefollowing values cs[i]: for bin 1: cs[1] = bc[1] - A for bin 2: cs[2] = bc[1]+bc[2] - A*2 for bin 3: cs[3] = bc[1]+bc[2]+bc[3] - A*3, etc. The value of A depends on the selected Cumulative Sum option: A is equal to average of all bc[i] if you select "Use all histogram" option A is equal to average of all bc[i] for bins that are before zero on time scale if you select "Use preref asbase" option. If you use "Use all histogram" option, the value of the cumulative sum for the last bin is always zero:sc[N] = bc[1]+bc[2]+...bc[N] - A*N, where A = (bc[1]+bc[2]+...bc[N])/N. NeuroExplorer displays 99% confidence limits for Cumulative Sum Graphs. Confidence limits for "Usepreref as base" option are proportional to square root of bin number. Calculations of confidence limits for "Use all histogram" option are not trivial. These calculations arebased on the formulas developed by the author of NeuroExplorer, Alexander Kirillov.

Page 92

Page 95: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.8. Rate Histograms Rate histogram displays firing rate versus time.

Parameters

Parameter Description

XMin/XMax type An option on how XMin and XMax values are specified.

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds

Bin Histogram bin size in seconds.

Normalization Histogram units (Counts/Bin or Spikes/Second). See Algorithm below.

Set Cont. Mean to Zeroif Small Bin Count

If the number of continuous data points int a bin is too small, set cont. mean(bin value) to zero. See Algorithm below.

Cont. Min Bin CountPercent

Minimum number of continuous data points in a bin as percent of theexpected number of data points. See Algorithm below.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Smooth histogram An option to smooth the histogram after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Add to Results / Bin left An option to add an additional vector (containing a left edge of each bin) tothe matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a middle point of each bin)to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of each bin) tothe matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the form

Page 93

Page 96: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

CR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Histogram minimum.

YMax Histogram maximum.

Spikes The number of spikes used in calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Freq. Mean firing rate (Spikes/Filter_Length).

Mean Hist. The mean of the histogram bin values.

St. Dev. Hist. The standard deviation of the histogram bin values.

St. Err. Mean. Hist. The standard error of mean of the histogram bin values.

Algorithm The time axis is divided into bins. The first bin is [XMin, XMin+Bin). The second bin is [XMin+Bin,Xmin+Bin*2), etc. The left end is included in each bin, the right end is excluded from the bin.   Spike Trains and Events For each bin, the number of events (timestamps) in this bin is calculated. For example, for the first bin bin_count = number of timestamps (ts) such that ts >= XMin and ts < XMin + Bin If Normalization is Counts/Bin, no further calculations are performed. If Normalization is Spikes/Sec, bin counts are divided by Bin.   Continuous Channels For each bin, the average of continuous signal values in this bin is calculated. Normalization parameter isignored. When calculating the average of continuous signal, we may encounter a situation when the number ofdata points in a bin is very small. For example, with a 1 KHz signal and bin = 1 second, we typically have1000 data points in each bin. If we have a bin in which we have only one data point, the average of thesignal in this bin is equal to the single data point value. This value can be very different from the typicalaverage of 1000 data points. Therefore, to avoid these spurious artifacts, we need to check how manydata points are in the bin and set the average to zero if there are too few data points.

Page 94

Page 97: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.9. Interspike Interval Histograms Interspike interval histogram shows the conditional probability of a first spike at time t0+t after a spike attime t0.

Parameters

Parameter Description

Min Interval Minimum interspike interval in seconds.

Max Interval Maximum interspike interval in seconds.

Bin Bin size in seconds.

Normalization Histogram units (Counts/Bin, Probability or Spikes/Second). See Algorithmbelow.

Log Bins and X Axis An option to use Log10 interval scale (see Algorithm below for details).

Bins per decade A bin size option if Log option is selected (see Algorithm below for details).

Y Axis Limit (%) An option to "zoom in" small histogram values. This parameter specifies themaximum of Y axis. If it is 100%, the Y axis maximum is equal to themaximum bin value. If it is, for example, 10%, Y axis maximum is set to 10%of the bin max and the small bin values have better visibility.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Int. filter type Specifies if the analysis will use a single or multiple interval filters.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Create filter on-the-fly Specifies if a temporary interval filter needs to be created (and used topreselect data).

Create filter around Specifies an event that will be used to create a temporary filter.

Start offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the start of interval for the temporary filter.

End offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the end of interval for the temporary filter.

Fix overlaps An option to automatically merge the overlapping intervals in the temporaryfilter.

Overlay Graphs An option to draw several histograms in each graph. This option requires thatInt. filter type specifies that multiple interval filters will be used (either Table(row) or Table (col)).

Smooth Option to smooth the histogram after the calculation. See Post-Processing

Options for details.

Page 95

Page 98: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Add to Results / Bin left An option to add an additional vector (containing a left edge of each bin) tothe matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a middle point of each bin)to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of each bin) tothe matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Histogram minimum.

YMax Histogram maximum.

Spikes The number of spikes used in calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Freq. Mean firing rate (Spikes/Filter_Length).

Mean Hist. The mean of the histogram bin values.

St. Dev. Hist. The standard deviation of the histogram bin values.

St. Err. Mean. Hist. The standard error of mean of the histogram bin values.

Mean ISI The mean of the interspike intervals.

St. Dev. ISI The standard deviation of the interspike intervals.

Coeff. Var. ISI Coefficient of variation of the interspike intervals.

Median ISI Median of the interspike intervals.

Mode ISI Mode of the interspike intervals.

Page 96

Page 99: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Algorithm If Use Log Bins and X Axis option is not selected: The time axis is divided into bins. The first bin is [IntMin, IntMin+Bin). The second bin is [IntMin+Bin,Intmin+Bin*2), etc. The left end is included in each bin, the right end is excluded from the bin. For eachbin, the number of interspike intervals within this bin is calculated. For example, for the first bin bin_count = number of interspike intervals (isi)such that isi >= IntMin and isi < IntMin + Bin If Normalization is Counts/Bin, no further calculations are performed. If Normalization is Probability, bin counts are divided by the number of interspike intervals in the spiketrain. If Normalization is Spikes/Sec, bin counts are divided by NumInt*Bin, where NumInt is the number ofinterspike intervals in the spike train.   If Use Log Bins and X Axis option is selected: The i-th bin (i=1,2,...) is [IntMin * 10 ^ ((i -1)/D), IntMin * 10 ^ (i/D)), where D is the Number of Bins PerDecade. For each bin, the number of interspike intervals within this bin is calculated. For discussion onusing logarithm of interspike intervals, see: Alan D. Dorval, Probability distributions of the logarithm of inter-spike intervals yield accurate entropyestimates from small datasets. Journal of Neuroscience Methods 173 (2008) 129–139  

Page 97

Page 100: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.10. Autocorrelograms Autocorrelogram shows the conditional probability of a spike at time t0+t on the condition that there is aspike at time t0.

Parameters

Parameter Description

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds.

Bin Bin size in seconds.

Normalization Histogram units (Counts/Bin, Probability or Spikes/Second). See Algorithmbelow.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Int. filter type Specifies if the analysis will use a single or multiple interval filters.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Create filter on-the-fly Specifies if a temporary interval filter needs to be created (and used topreselect data).

Create filter around Specifies an event that will be used to create a temporary filter.

Start offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the start of interval for the temporary filter.

End offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the end of interval for the temporary filter.

Fix overlaps An option to automatically merge the overlapping intervals in the temporaryfilter.

Overlay Graphs An option to draw several histograms in each graph. This option requires thatInt. filter type specifies that multiple interval filters will be used (either Table(row) or Table (col)).

Smooth Option to smooth the histogram after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Draw confidence limits An option to draw the confidence limits.

Confidence (%) Confidence level (percent). See Confidence Limits for details.

Conf. mean calculation An option that specifies how the mean firing rate (that is used in thederivation of the confidence limits) is calculated.

Page 98

Page 101: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

There are 2 options: Use data selection and Use all file. See Confidence

Limits for details.

Conf. display An option to draw confidence limits either as horizontal lines or as a coloredbackground.

Conf. line style Line style for drawing confidence limits (used when Conf. display is Lines ).

Conf. background color Background color for drawing confidence limits (used when Conf. display isColored Background ).

Draw mean freq. An option to draw a horizontal line representing the expected histogram valuefor a Poisson spike train. See Confidence Limits for details.

Mean line style Line style for drawing mean frequency.

Add to Results / Bin left An option to add an additional vector (containing a left edge of each bin) tothe matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a middle point of each bin)to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of each bin) tothe matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Histogram minimum.

YMax Histogram maximum.

Spikes The number of spikes used in calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Freq. Mean firing rate (Spikes/Filter_Length).

Page 99

Page 102: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Mean Hist. The mean of the histogram bin values.

St. Dev. Hist. The standard deviation of the histogram bin values.

Conf. Low Lower confidence level.

Conf. High Upper confidence level.

Mean Expected mean value of the histogram.

Norm. Factor Normalization factor. Bin counts are divided by this value. See Normalizationin Algorithm below.

Time of Minimum Position of the histogram minimum (in seconds). If there are multiple bins inthe histogram where the bin value is equal to the histogram minimum, thisvalue represents the position of the first such bin.

Time of Maximum Position of the histogram maximum (in seconds). If there are multiple bins inthe histogram where the bin value is equal to the histogram maximum, thisvalue represents the position of the first such bin.

Algorithm In general, the Autocorrelogram shows the conditional probability of a spike in the spike train at time t onthe condition that there is a spike at time zero. The time axis is divided into bins. The first bin is [XMin, XMin+Bin). The second bin is [XMin+Bin,Xmin+Bin*2), etc. The left end is included in each bin, the right end is excluded from the bin. Let ts[i] be the spike train (each ts is the timestamp). For each timestamp ts[k]: calculate the distances from this spike to all other spikes in the spike train: d[i] = ts[i] - ts[k] for each i except i equal to k: if d[i] is inside the first bin, increment the bin counter for the first bin: if d[i] >= XMin and d[i] < XMin + Bin then bincount[1] = bincount[1] +1 if d[i] is inside the second bin, increment the bin counter for the second bin: if d[i] >= XMin+Bin and d[i] < XMin + Bin*2 then bincount[2] = bincount[2] +1 and so on... . If Normalization is Counts/Bin, no further calculations are performed. If Normalization is Probability, bin counts are divided by the number of spikes in the spike train. Note that the Probability normalization makes sense only for small values of Bin. For Probabilitynormalization to be valid (so that the values of probability are between 0 and 1), there should be no morethan one spike in each bin. For example, if the Bin value is large and for each ts[k] above there are manyd[i] values such that d[i] >= XMin and d[i] < XMin + Bin, the bin count for the first bin can exceed thenumber of spikes in the spike train. Then, the probability value (bincount[1]/number_of_spikes) could belarger than 1. If Normalization is Spikes/Sec, bin counts are divided by NumSpikes*Bin, where NumSpikes is thenumber of spikes in the spike train.

Page 100

Page 103: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.11. Perievent Histograms Perievent Histogram shows the conditional probability of a spike at time t0+t on the condition that there isa reference event at time t0. For continuous variable, this analysis calculates event-triggered average.

Parameters

Parameter Description

Reference Type Specifies if the analysis will use a single or multiple reference events.

Reference Specifies a reference neuron or event (or a group of reference neurons orevents).

XMin Histogram time axis minimum in seconds.

XMax Histogram time axis maximum in seconds

Bin Bin size in seconds.

Normalization Histogram units (Counts/Bin, Probability, Spikes/Second or Z-score). SeeAlgorithm below.

No Selfcount An option not to count reference events if the target event is the same as thereference event (prevents a histogram to have a huge peak at zero whencalculating PSTH versus itself).

Ignore Ref. with MissingData

An option not to use reference events (t) that have missing continuous data intime interval (t+XMin,t+XMax). If this option is not specified and continuousvalues are missing for part of (t+XMin,t+XMax), the missing values arereplaced by zero values. This may distort the resulting PSTH (spike-triggeredaverage).

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Int. filter type Specifies if the analysis will use a single or multiple interval filters.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Create filter on-the-fly Specifies if a temporary interval filter needs to be created (and used topreselect data).

Create filter around Specifies an event that will be used to create a temporary filter.

Start offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the start of interval for the temporary filter.

End offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the end of interval for the temporary filter.

Fix overlaps An option to automatically merge the overlapping intervals in the temporaryfilter.

Page 101

Page 104: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Overlay Graphs An option to draw several histograms in each graph. This option requires thatInt. filter type specifies that multiple interval filters will be used (either Table(row) or Table (col)).

Overlay Options Specifies line colors and line styles for overlaid graphs.

Smooth Option to smooth the histogram after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Draw confidence limits An option to draw the confidence limits.

Confidence (%) Confidence level (percent). See Confidence Limits for details.

Conf. mean calculation An option that specifies how the mean firing rate (that is used in thederivation of the confidence limits) is calculated. There are 3 options: Use data selection, Use all file and Use pre-ref data.See Confidence Limits for details. Note that Use pre-ref data option can only be used for a stimulation typedata, i.e. when the distance between any two consecutive reference events islarger than XMax-XMin. See Confidence Limits for details.

Conf. display An option to draw confidence limits either as horizontal lines or as a coloredbackground.

Conf. line style Line style for drawing confidence limits (used when Conf. display is Lines ).

Conf. background color Background color for drawing confidence limits (used when Conf. display isColored Background ).

Draw mean freq. An option to draw a horizontal line representing the expected histogram valuefor a Poisson spike train. See Confidence Limits for details.

Mean line style Line style for drawing mean frequency.

Draw Cusum An option to draw a cumulative sum graph above the histogram. See

Cumulative Sum Graphs for details.

Add to Results / Bin left An option to add an additional vector (containing a left edge of each bin) tothe matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a middle point of each bin)to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of each bin) tothe matrix of numerical results.

Background An option on how to calculate the histogram background for the peak andthrough analysis. See Peak and Trough Statistics below.

Peak width Peak width (the number of bins in peak) in the peak and through analysis.See Peak and Trough Statistics below.

Left shoulder Specifies the left shoulder value (in seconds) in the peak and throughanalysis. See Peak and Trough Statistics below.

Right shoulder Specifies the right shoulder value (in seconds) in the peak and throughanalysis. See Peak and Trough Statistics below.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Page 102

Page 105: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Reference Reference variable name.

NumRefEvents The number of reference events used in calculation.

YMin Histogram minimum.

YMax Histogram maximum.

Spikes The number of spikes used in calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Freq. Mean firing rate (Spikes/Filter_Length).

Mean Hist. The mean of the histogram bin values.

St. Dev. Hist. The standard deviation of the histogram bin values.

St. Err. Mean. Hist. The standard error of mean of the histogram bin values.

Conf. Low Lower confidence level.

Conf. High Upper confidence level.

Mean Expected mean value of the histogram. If Z-score normalization is specified,this value is zero and the expected mean value of the histogram withCounts/Bin normalization is shown in Z-score Mean.

Norm. Factor Normalization factor. Bin counts are divided by this value. See Normalizationin Algorithm below.

Z-score mean Expected mean value of the histogram before Z-score normalization (in otherwords, confidence mean). See Confidence Limits for details .

Mean Before Ref. Mean of the histogram before the reference event (i.e. for all the bins beforezero on time axis).

Page 103

Page 106: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Bins Before Ref. The number of bins before the bin that contains zero on time axis.

Zero Bin The index of the bin that contains zero on time axis.

Background Mean The mean of the histogram background for the peak and trough analysis. See Peak and Through Statistics below.

Background Stdev The standard deviation of the histogram background for the peak and troughanalysis. See Peak and Trough Statistics below.

Peak Z-score Peak Z-score. See Peak and Trough Statistics below.

Peak/Mean Histogram peak value divided by the background mean value.

Peak Position Peak position (in seconds).

Peak Half Height The Y value of the half height of the peak, i.e. histogram_background_mean+ (peak-mean)/2.

Peak Width at HalfHeight

Peak width at the peak half height level (in seconds).

Trough Z-score Trough Z-score. See Peak and Trough Statistics below.

Trough/Mean Histogram trough value divided by the background mean value.

Trough Position Trough position (in seconds).

Trough Half Height The Y value of the half height of the trough, i.e. histogram_background_mean+ (trough-mean)/2.

Trough Width at HalfHeight

Trough width at the trough half height level (in seconds).

Algorithm In general, the Perievent Histogram shows the conditional probability of a spike in the spike train at timet0+t on the condition that there is a reference event (or reference spike) at time t0. The time axis is divided into bins. The first bin is [XMin, XMin+Bin). The second bin is [XMin+Bin,XMin+Bin*2), etc. The left end is included in each bin, the right end is excluded from the bin. Let ref[i] be the array of timestamps of the reference event, ts[i] be the spike train (each ts is the timestamp) For each timestamp ref[k]: 1) calculate the distances from this event (or spike) to all the spikes in the spike train: d[i] = ts[i] - ref[k] 2) for each i: if d[i] is inside the first bin, increment the bin counter for the first bin: if d[i] >= XMin and d[i] < XMin + Bin then bincount[1] = bincount[1] +1 if d[i] is inside the second bin, increment the bin counter for the second bin: if d[i] >= XMin+Bin and d[i] < XMin + Bin*2 then bincount[2] = bincount[2] +1 and so on... .

Page 104

Page 107: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

•••

  If Normalization is Counts/Bin, no further calculations are performed. If Normalization is Probability, bin counts are divided by the number of reference events. Note that the Probability normalization makes sense only for small values of Bin. For Probabilitynormalization to be valid (so that the values of probability are between 0 and 1), there should be no morethan one spike in each bin. For example, if the Bin value is large and for each ref[k] above there aremany d[i] values such that d[i] >= XMin and d[i] < XMin + Bin, the bin count for the first bin can exceedthe number of reference events. Then, the probability value (bincount[1]/number_of_reference_events)could be larger than 1. If Normalization is Spikes/Sec, bin counts are divided by NumRefEvents*Bin, where NumRefEvents isthe number of reference events. If Normalization is Z-score, bin_value = (bin_count - Confidence_mean)/sqrt(Confidence_mean), whereConfidence_mean is the expected mean bin count calculated according to Conf. mean calculationparameter. Please note that bin counts are assumed to have Poisson distribution (therefore, standarddeviation is equal to square root of expected mean) and Z-score can be considered to have Normaldistribution only for large values (more than 10) of the Confidence_mean.   For continuous variables, the mean of the variable values is calculated for each bin around referenceevent. These mean values are then averaged across all the timestamps of the reference event.

 

Peak and Trough Statistics NeuroExplorer calculates the histogram peak statistics the following way:

Maximum of the histogram is foundIf the histogram contains several maxima with the same value, peak statistics are not calculatedOtherwise, the center of the bin, where the histogram reaches maximum, is shown as PeakPosition in the Summary of Numerical resultsThe mean M and standard deviation S of the bin values of the histogram background are calculated:If Background parameter is set as Bins outside peak/trough, bins outside peak and trough (i.e., binsthat are more than PeakWidth/2 away from the bin with the histogram maximum and the bin with thehistogram minimum) are used to calculate M and S If Background parameter is set as Shoulders,bins that are to the left of Left Shoulder or to the right of Right Shoulder parameters are used tocalculate M and S The value M (mean of the background bin values) is shown as Background Mean in the Summaryof Numerical resultsThe value S (standard deviation of the background bin values) is shown as Background Stdev inthe Summary of Numerical resultsThe value (HistogramMaximum – M)/S is shown as Peak Z-scoreThe value (HistogramMaximum + M)/2 is shown as Peak Half HeightHistogram intersects a horizontal line drawn at Peak Half Height at time points TLeft and TRight.(TRight - TLeft) is shown as Peak Width

Histogram trough statistics are calculated in a similar way. The only difference is that histogram minimuminstead of histogram maximum is analyzed.

Page 105

Page 108: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.12. Crosscorrelograms Crosscorrelogram shows the conditional probability of a spike at time t0+t on the condition that there is areference event at time t0. Compared to PSTH (that calculates the same probabilities), crosscorrelogram allows to use shift-predictors.

Parameters

Parameter Description

Reference Type Specifies if the analysis will use a single or multiple reference events.

Reference Specifies a reference neuron or event (or a group of reference neurons orevents).

XMin Histogram time axis minimum in seconds.

XMax Histogram time axis maximum in seconds

Bin Bin size in seconds.

Normalization Histogram units (Counts/Bin, Probability, Spikes/Second or Z-score). SeeAlgorithm below.

No Selfcount An option not to count reference events if the target event is the same as thereference event (prevents a histogram to have a huge peak at zero whencalculating crosscorrelogram versus itself).

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Int. filter type Specifies if the analysis will use a single or multiple interval filters.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Count bins in filter An option to normalize each bin individually if the interval filter is used. SeeAlgorithm section below for detailed discussion.

Create filter on-the-fly Specifies if a temporary interval filter needs to be created (and used topreselect data).

Create filter around Specifies an event that will be used to create a temporary filter.

Start offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the start of interval for the temporary filter.

End offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the end of interval for the temporary filter.

Fix overlaps An option to automatically merge the overlapping intervals in the temporaryfilter.

Overlay Graphs An option to draw several histograms in each graph. This option requires that

Page 106

Page 109: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Int. filter type specifies that multiple interval filters will be used (either Table(row) or Table (col)).

Overlay Options Specifies line colors and line styles for overlaid graphs.

Smooth Option to smooth the histogram after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Shift-predictor An option to use shift-predictor. Shift-predictor requires that an interval filter isused in the analysis. See Using Shift-Predictor for details.

Shift times How many times to calculate shift predictor. See Using Shift-Predictor fordetails.

Subtract predictor An option to subtract shift-predictor from crosscorrelogram. See Using Shift-

Predictor for details.

Predictor line style Specifies the line used to draw shift-predictor (if subtract predictor is notselected).

Draw confidence limits An option to draw the confidence limits.

Confidence (%) Confidence level (percent). See Confidence Limits for details.

Conf. mean calculation An option that specifies how the mean firing rate (that is used in thederivation of the confidence limits) is calculated. There are 3 options: Use data selection, Use all file and Use pre-ref data.See Confidence Limits for details. Note that Use pre-ref data option can only be used for a stimulation typedata, i.e. when the distance between any two consecutive reference events islarger than XMax-XMin. See Confidence Limits for details.

Conf. display An option to draw confidence limits either as horizontal lines or as a coloredbackground.

Conf. line style Line style for drawing confidence limits (used when Conf. display is Lines ).

Conf. background color Background color for drawing confidence limits (used when Conf. display isColored Background ).

Draw mean freq. An option to draw a horizontal line representing the expected histogram valuefor a Poisson spike train. See Confidence Limits for details.

Mean line style Line style for drawing mean frequency.

Draw Cusum An option to draw a cumulative sum graph above the histogram. See

Cumulative Sum Graphs for details.

Add to Results / Bin left An option to add an additional vector (containing a left edge of each bin) tothe matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a middle point of each bin)to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of each bin) tothe matrix of numerical results.

Background An option on how to calculate the histogram background for the peak andthrough analysis. See Peak and Trough Statistics below.

Page 107

Page 110: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Peak width Peak width (the number of bins in peak) in the peak and through analysis.See Peak and Trough Statistics below.

Left shoulder Specifies the left shoulder value (in seconds) in the peak and throughanalysis. See Peak and Trough Statistics below.

Right shoulder Specifies the right shoulder value (in seconds) in the peak and throughanalysis. See Peak and Trough Statistics below.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Reference Reference variable name.

NumRefEvents The number of reference events used in calculation.

YMin Histogram minimum.

YMax Histogram maximum.

Spikes The number of spikes used in calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Freq. Mean firing rate (Spikes/Filter_Length).

Mean Hist. The mean of the histogram bin values.

St. Dev. Hist. The standard deviation of the histogram bin values.

St. Err. Mean. Hist. The standard error of mean of the histogram bin values.

Conf. Low Lower confidence level.

Conf. High Upper confidence level.

Mean Expected mean value of the histogram. If Z-score normalization is specified,this value is zero and the expected mean value of the histogram with

Page 108

Page 111: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Counts/Bin normalization is shown in Z-score Mean.

Norm. Factor Normalization factor. Bin counts are divided by this value. See Normalizationin Algorithm below.

Z-score mean Expected mean value of the histogram before Z-score normalization (in otherwords, confidence mean). See Confidence Limits for details .

Mean Before Ref. Mean of the histogram before the reference event (i.e. for all the bins beforezero on time axis).

Bins Before Ref. The number of bins before the bin that contains zero on time axis.

Zero Bin The index of the bin that contains zero on time axis.

Background Mean The mean of the histogram background for the peak and trough analysis. See Peak and Through Statistics below.

Background Stdev The standard deviation of the histogram background for the peak and troughanalysis. See Peak and Trough Statistics below.

Peak Z-score Peak Z-score. See Peak and Trough Statistics below.

Peak/Mean Histogram peak value divided by the background mean value.

Peak Position Peak position (in seconds).

Peak Half Height The Y value of the half height of the peak, i.e. histogram_background_mean+ (peak-mean)/2.

Peak Width at HalfHeight

Peak width at the peak half height level (in seconds).

Trough Z-score Trough Z-score. See Peak and Trough Statistics below.

Trough/Mean Histogram trough value divided by the background mean value.

Trough Position Trough position (in seconds).

Trough Half Height The Y value of the half height of the trough, i.e. histogram_background_mean+ (trough-mean)/2.

Trough Width at HalfHeight

Trough width at the trough half height level (in seconds).

Algorithm Crosscorrelogram shows the conditional probability of a spike at time t0+t on the condition that there is areference event at time t0. The time axis is divided into bins. The first bin is [XMin, XMin+Bin). The second bin is [XMin+Bin,XMin+Bin*2), etc. The left end is included in each bin, the right end is excluded from the bin. Let ref[i] be the array of timestamps of the reference event, ts[i] be the spike train (each ts is the timestamp). For each timestamp ref[k]: 1) calculate the distances from this event (or spike) to all the spikes in the spike train: d[i] = ts[i] - ref[k]

Page 109

Page 112: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

2) for each i: if d[i] is inside the first bin, increment the bin counter for the first bin: if d[i] >= XMin and d[i] < XMin + Bin then bincount[1] = bincount[1] +1 if d[i] is inside the second bin, increment the bin counter for the second bin: if d[i] >= XMin+Bin and d[i] < XMin + Bin*2 then bincount[2] = bincount[2] +1 and so on... . If Normalization is Counts/Bin, no further calculations are performed. If Normalization is Probability, bin counts are divided by the number of reference events. Note that the Probability normalization makes sense only for small values of Bin. For Probabilitynormalization to be valid (so that the values of probability are between 0 and 1), there should be no morethan one spike in each bin. For example, if the Bin value is large and for each ref[k] above there aremany d[i] values such that d[i] >= XMin and d[i] < XMin + Bin, the bin count for the first bin can exceedthe number of reference events. Then, the probability value (bincount[1]/number_of_reference_events)could be larger than 1. If Normalization is Spikes/Sec, bin counts are divided by NumRefEvents*Bin, where NumRefEvents isthe number of reference events. If Normalization is Z-score, bin_value = (bin_count - Confidence_mean)/sqrt(Confidence_mean), whereConfidence_mean is the expected mean bin count calculated according to Conf. mean calculationparameter. Please note that bin counts are assumed to have Poisson distribution (therefore, standarddeviation is equal to square root of expected mean) and Z-score can be considered to have Normaldistribution only for large values (more than 10) of the Confidence_mean. If the option Count Bins In Filter is selected, for normalization Spikes/Second, NeuroExplorer will dividebin count by NumTimesBinWasInFilter*Bin instead of NumRefEvents*Bin. The problem is that whenthe interval filter is used, bins close to XMin and to XMax may often (when a reference event is close tothe beginning or to the end of the interval in the interval filter) be positioned outside the filter andtherefore will not be used for many reference events. Hence, the bins close to 0.0 will be used in analysismore often than the bins close to XMin and XMax. If the option Count Bins In Filter is selected,NeuroExplorer will count the number of times each bin was used in the calculation and use this count,NumTimesBinWasInFilter, (instead of the number of reference events) to normalize the histogram.

Peak and Trough Statistics NeuroExplorer calculates histogram peak statistics the following way:

Maximum of the histogram is foundIf the histogram contains several maxima with the same value, peak statistics are not calculatedOtherwise, the center of the bin, where the histogram reaches maximum, is shown as PeakPosition in the Summary of Numerical resultsThe mean M and standard deviation S of the bin values of the histogram background are calculated:If Background parameter is set as Bins outside peak/trough, bins outside peak and trough (i.e., binsthat are more than PeakWidth/2 away from the bin with the histogram maximum and the bin with thehistogram minimum) are used to calculate M and S If Background parameter is set as Shoulders,bins that are to the left of Left Shoulder or to the right of Right Shoulder parameters are used tocalculate M and S

Page 110

Page 113: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

The value M (mean of the background bin values) is shown as Background Mean in the Summaryof Numerical resultsThe value S (standard deviation of the background bin values) is shown as Background Stdev inthe Summary of Numerical resultsThe value (HistogramMaximum – M)/S is shown as Peak Z-score The value (HistogramMaximum + M)/2 is shown as Peak Half HeightHistogram intersects a horizontal line drawn at Peak Half Height at time points TLeft and TRight.(TRight - TLeft) is shown as Peak Width

Histogram trough statistics are calculated in a similar way. The only difference is that histogram minimuminstead of histogram maximum is analyzed.

Page 111

Page 114: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••••••

3.13. Shift-Predictor for Crosscorrelograms Shift-predictor is defined for a series of trials - you take the spikes of one neuron in trial 1 and correlatethem with the spikes of another neuron in trial 2, etc. These "trials" are represented in NeuroExplorer as time intervals, i.e. pairs of numbers: start of interval 1, end of interval 1 start of interval 2, end of interval 2, etc. To use the shift-predictor, you need to create those "trials" first. You need an external event that is fired at the beginning of each trial. Suppose Event03 is the event thathappens at the beginning of each trial and each trial lasts 20 seconds. To create the trial intervals:

click on the New Events! button (or select Edit | Operations on Variables menu command)in the operations list, select MakeIntervals in the First Operand, select the external event Event03 set Shift Min to 0. and Shift Max to 20.0in the New Var Name, type: Trials press Run the Operation buttonclose the dialog.

Now, click on the Crosscorrelogram button, select Shift-predictor page and select Trials as an intervalfilter and specify other shift-predictor parameters.  

Classic Shift-Predictor Algorithm   Suppose we have n trial intervals: [trial_1_start, trial_1_end], [trial_2_start, trial_2_end], ..., [trial_n_start, trial_n_end] and we have 2 spike trains: reference spike train with N timestamps r1, r2, ... , rN; and target spike train with M timestamps s1, s2, ... , sM.   Shift-predictor for shift = 1 is calculated like this:   Step 1: find all the timestamps ri that are inside the first trial interval [trial_1_start, trial_1_end] Step 2: find all the timestamps sj that are inside the second trial interval [trial_2_start, trial_2_end] Step 3: shift all the timestamps ri so that they align with the second trial: calculate new timestamps pi = ri + (trial_2_start - trial_1_start) Step 4: calculate a crosscorrelogram between pi and sj   Repeat Steps 1 through 4 with interval [trial_2_start, trial_2_end] in Step 1 and interval [trial_3_start,trial_3_end] in Step 2.

Page 112

Page 115: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

... Repeat Steps 1 through 4 with interval [trial_n_start, trial_n_end] in Step 1 and interval [trial_1_start,trial_1_end] in Step 2. Note that we wrap around the trials: the last trial is correlated with the first one.   Then, calculate shift-predictors for shift = 2: Repeat Steps 1 through 4 with interval [trial_1_start, trial_1_end] in Step 1 and interval [trial_3_start,trial_3_end] in Step 2. That is, shift trials by 2. ... And, finally, calculate shift-predictors for shift = Number_of_shifts specified in the shift-predictor options.  

Shift-Predictor With Random Shuffle When using random shuffle, for each shift, we shuffle the trial numbers. That is, we take trial numbersarray tn = [1, 2, 3, ..., n] and randomly shuffle this array. If randomly shuffled array is tn_shuffled, wecorrelate trial i with trial tn_shuffled[i].  

More on Time Intervals These time intervals can be used in other analyses in NeuroExplorer to analyze spikes only from thoseintervals. For example, you may have a pre-drug period in the experiment (say, from 0 to 600 seconds) and wantto analyze the spikes from this pre-drug time period. To do this, you create a new "interval variable" (let's call it "PreDrug") that contains only one interval (0.,600.) (press "New Intervals!" button to create a new interval variable). Then you can calculate, for example, the autocorrelograms for the spikes in the pre-drug period byspecifying PreDrug as an "interval filter" in the Data Selection page of the Autocorrelogram parametersdialog.

Page 113

Page 116: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.14. Rasters The raster display shows the spikes as vertical lines (tick) positioned according to the spikes timestamps.This analysis does not generate numerical results since the raster lines (ticks) are drawn directly from thedata. Some generic analysis statistics are available in the Summary of Numerical Results (see below).

Parameters

Parameter Description

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Vert. size The size of a raster tick (in percent of the graph height).

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Y axis minimum (added for compatibility with other analyses, always 0).

YMax Y axis maximum (added for compatibility with other analyses, always 1).

Spikes The number of spikes used in calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Freq. Mean firing rate (Spikes/Filter_Length).

Algorithm The raster display shows the spikes as vertical lines positioned according to the spikes timestamps.

Page 114

Page 117: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.15. Perievent Rasters This analysis shows the timestamps of the selected variable relative to the timestamps of the referencevariable.

Parameters

Parameter Description

Reference Type Specifies if the analysis will use a single or multiple reference events.

Reference Specifies a reference neuron or event (or a group of reference neurons orevents).

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds

Markers An option to display additional events (as markers - triangles, squares, etc.)in the perievent raster.

Background Intervals An option to draw intervals in the raster background.

Trial Order This option allows you to specify how the raster lines are drawn. The rasterlines (corresponding to reference events) can be drawn in the order ofreference events (with the first event on top, the last at the bottom of theperievent raster), or in the reverse order (the first event at the bottom of theraster display, the last event at the top). This option is ignored if Sort trialsparameter is not None.

Sort trials An option to sort raster lines. By default, the raster lines (corresponding to reference events) are drawn inthe order specified by the Trial Order parameter. This option allows you todisplay reference events in a different order. For example, in behavioralexperiments, you can sort the trials according to the latency of the response.

Sort event Specifies how to identify the timestamps (in Sort ref. variable) that will beused in sorting.

Sort ref. Specifies event variable that will be used to sort trials.

Histogram An option to draw a histogram.

Bin Histogram bin size in seconds.

Normalization Histogram units (Counts/Bin, Probability or Spikes/Second). See Algorithmbelow.

No Selfcount An option not to count reference events if the target event is the same as thereference event (prevents a histogram to have a huge peak at zero whencalculating PSTH versus itself).

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Page 115

Page 118: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Int. filter type Specifies if the analysis will use a single or multiple interval filters.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Create filter on-the-fly Specifies if a temporary interval filter needs to be created (and used topreselect data).

Create filter around Specifies an event that will be used to create a temporary filter.

Start offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the start of interval for the temporary filter.

End offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the end of interval for the temporary filter.

Fix overlaps An option to automatically merge the overlapping intervals in the temporaryfilter.

Smooth histogram An option to smooth the histogram after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Reference Reference variable name.

NumRefEvents The number of reference events used in calculation.

YMin Histogram minimum.

YMax Histogram maximum.

Spikes The number of spikes used in calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Freq. Mean firing rate (Spikes/Filter_Length).

Mean Hist. The mean of the histogram bin values.

St. Dev. Hist. The standard deviation of the histogram bin values.

St. Err. Mean. Hist. The standard error of mean of the histogram bin values.

Algorithm For the perievent histogram calculation, see Perievent Histograms. Let ref[i] be the array of timestamps of the reference event, sortref[i] be the array of timestamps of the sort event.

Page 116

Page 119: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

If Sort Trials is selected, the following algorithm is used: 1) for each timestamp ref[k], NeuroExplorer finds the smallest sortref[i], such that sortref[i] > ref[k] 2) the distance between two events is calculated: dist[k] = sortref[i] - ref[k] 3) the trials ref[k] are sorted array sorted in ascending or descending order of dist[k]. Continuous variables can also be used in this analysis. However, you may prefer to use PeriEventRasters for Continuous Variables analysis. For each ref[k], NeuroExplorer calculates a series of bins. The first bin is: [ref[k]+XMin, ref[k]+XMin+Bin] the second bin is [ref[k]+XMin+Bin, ref[k]+XMin+Bin+Bin], etc. Then, the average value of a continuous variable is calculated within each of the bins and this averagevalue is displayed using the color scale. If bin does not contain any timestamps of the continuousvariable, the previous value of the continuous variable is used.

Page 117

Page 120: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.16. Joint PSTH Joint PSTH matrix shows the correlations of the two neurons around the reference events.

Parameters

Parameter Description

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds

Bin Bin size in seconds.

Reference Specifies a reference neuron or event.

Bottom Neuron The neuron of event shown along the horizontal axis (the vertical axis showsa neuron selected for analysis).

Diag The width (in seconds) of the area in the scatter matrix around its maindiagonal used to calculate the main diagonal histogram.

Normalization Scatter matrix normalization.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Int. filter type Specifies if the analysis will use a single or multiple interval filters.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Create filter on-the-fly Specifies if a temporary interval filter needs to be created (and used topreselect data).

Create filter around Specifies an event that will be used to create a temporary filter.

Start offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the start of interval for the temporary filter.

End offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the end of interval for the temporary filter.

Fix overlaps An option to automatically merge the overlapping intervals in the temporaryfilter.

Smooth Option to smooth the histograms (not the scatter matrix) after the calculation.See Post-Processing Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Page 118

Page 121: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Matrix Scale An option on how to draw the scatter matrix (color or black and white).

Font size (% matrix) Font size in percent of scatter matrix height.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Y axis minimum (added for compatibility with other analyses, always 0).

YMax Y axis maximum (added for compatibility with other analyses, always 1).

Spikes The number of spikes of the neuron shown on the vertical axis used incalculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Freq. Mean firing rate (Spikes/Filter_Length).

Hist. norm. Normalization factor. Histogram bin counts are divided by this value.

Color scale minimum Scatter matrix color scale minimum.

Color scale maximum Scatter matrix color scale maximum.

Algorithm The main Joint PSTH matrix shows the correlations of the bin counts of two neurons around thereference events. Histograms to the left of and below the matrix are standard perievent histograms fortwo specified neurons. The first histogram to the right of the matrix shows the correlations of near-coincident spikes around the reference events. The far-right histogram shows correlations of firings oftwo neurons around reference events. See the following paper for details on Joint PSTH analysis: M. H. J. Aertsen, G. L. Gerstein, M. K. Habib and G. Palm. Dynamics of Neuronal Firing Correlation:Modulation of "Effective Connectivity" J. Neurophysiol., Vol. 61, pp. 900-917, 1989.

Page 119

Page 122: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.17. Cumulative Activity Graphs The cumulative activity display shows a stepwise function which makes a jump at the moment of spikeand stays constant between the spikes.

Parameters

Parameter Description

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds  

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Y axis minimum.

YMax Y axis maximum.

Spikes The number of spikes used in calculation.

Mean Freq. Mean firing rate.

Algorithm The cumulative activity display shows the stepwise function, which makes a jump at the moment of spikeand stays constant between the spikes.

Page 120

Page 123: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.18. Instant Frequency The instant frequency display shows the instantaneous frequency of the spike train (at the end of eachinterspike interval, the inverted interspike interval is drawn as a vertical line).

Parameters

Parameter Description

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds

Graph Style An option to draw vertical lines or points.  

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Y axis minimum.

YMax Y axis maximum.

Spikes The number of spikes used in calculation.

Mean Freq. Mean firing rate.

Algorithm The instant frequency display shows the instantaneous frequency of the spike train. For each spike that occurred at time t[i] it draws the vertical line from point ( t[i], 0.) to point (t[i], 1/(t[i] - t[i-1])), where t[i-1] is the time of the preceding spike. In other words, at the end of each interspike interval, the inverted interspike interval is drawn as a verticalline.

Page 121

Page 124: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.19. Interspike Intervals vs. Time The intervals vs. time graph displays interspike intervals against time (at the end of each interspikeinterval, the point is drawn with the Y coordinate equal to the interspike interval).

Parameters

Parameter Description

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds  

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Y axis minimum.

YMax Y axis maximum.

Spikes The number of spikes used in calculation.

Mean Freq. Mean firing rate.

Algorithm The intervals vs. time graph displays interspike intervals against time. For each spike that occurred at time t[i] it draws the point with the coordinates (t[i], t[i] - t[i-1]), where t[i-1] is the time of the preceding spike. In other words, at the end of each interspike interval, the point is drawn with the Y coordinate equal to theinterspike interval.

Page 122

Page 125: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.20. Poincare Maps For each spike, a point is displayed where the X coordinate of the point is the current interspike intervaland Y coordinate of the point is the preceding interspike interval.

Parameters

Parameter Description

Min Interval Time axis minimum in seconds.

Max Interval Time axis maximum in seconds

Log Axis Scale An option to use Log10 axis scales.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Int. filter type Specifies if the analysis will use a single or multiple interval filters.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

 

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Y axis minimum.

YMax Y axis maximum.

Spikes The number of spikes used in calculation.

Mean Freq. Mean firing rate.  

Algorithm For each spike that occurred at time t[i], Poincare plot shows the point with the coordinates (t[i] - t[i-1], t[i-1] - t[i-2]). That is, the X coordinate of the point is the current interspike interval and Y coordinate of the point is thepreceding interspike interval.

Page 123

Page 126: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.21. Synchrony vs. Time For each spike, this graph shows the distance from this spike to the closest spike (timestamp) in thereference event. This analysis is useful in identifying the moments in time when several neurons are in sync with thereference neuron. To do this, you need to select Inverted Distance. Then, high values will indicate spikesthat are close to each other. Also, it is useful to specify that the graphs are shown in 1 column (in Num.Columns in Properties panel). The red arrow in the picture below shows a moment in time where several neurons have almost-synchronous spikes with the reference.  

 

Parameters

Parameter Description

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds

Reference Reference event.

Distance An option to draw linear or inverted distance.  

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Page 124

Page 127: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Variable Variable name.

YMin Y axis minimum.

YMax Y axis maximum.

Spikes The number of spikes used in calculation.

Mean Freq. Mean firing rate.

Algorithm For each spike that occurred at time t[i], this graph shows the distance from this spike to the closest spike(timestamp) in the reference event: dist = min(abs(t[i] - ref[j])), where ref[j] is a timestamp of the reference event If Distance is Linear, the vertical line is drawn from point ( t[i], 0.) to point (t[i], dist). If Distance is Inverted, the vertical line is drawn from point ( t[i], 0.) to point (t[i], 1/dist).

Page 125

Page 128: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.22. Trial Bin Counts Trial bin counts analysis computationally is essentially the same as the perievent histogram. Thedifference is that the bin counts are saved for each reference event. When used with continuous data, foreach bin and reference vent, the average of the continuous values within the bin is calculated.

Parameters

Parameter Description

Reference Specifies a reference neuron or event.

XMin Histogram time axis minimum in seconds.

XMax Histogram time axis maximum in seconds

Bin Bin size in seconds.

Normalization Histogram units (Counts/Bin, Probability or Spikes/Second). See Algorithmbelow.

No Selfcount An option not to count reference events if the target event is the same as thereference event (prevents a histogram to have a huge peak at zero whencalculating PSTH versus itself).

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

   

Summary of Numerical Results

Page 126

Page 129: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Color Scale Min Color scale minimum.

Color Scale Max Color scale maximum.

Reference Reverence event.

NumRefEvents Number of reference events.

Bin001Mean Mean of all the values for Bin 1.

Bin001SdDev Standard deviation of all the values for Bin 1.  

Algorithm Trial bin counts analysis computationally is essentially the same as the perievent histogram. Thedifference is that the bin counts are saved for each reference event. When used with continuous data, foreach bin and reference vent, the average of the continuous values within the bin is calculated. The time axis is divided into bins. The first bin is [XMin, XMin+Bin). The second bin is [XMin+Bin,Xmin+Bin*2), etc. The left end is included in each bin, the right end is excluded from the bin. Let ref[i] be the array of timestamps of the reference event, ts[i] be the spike train (each ts is the timestamp) For each timestamp ref[k]: Set all bin counts to zero: bincount[i] = 0 for all i Calculate the distances from this event (or spike) to all the spikes in the spike train: d[i] = ts[i] - ref[k] for each i: if d[i] is inside the first bin, increment the bin counter for the first bin: if d[i] >= XMin and d[i] < XMin + Bin then bincount[1] = bincount[1] +1 if d[i] is inside the second bin, increment the bin counter for the second bin: if d[i] >= XMin+Bin and d[i] < XMin + Bin*2 then bincount[2] = bincount[2] +1 and so on... . If Normalization is Counts/Bin, no further calculations are performed. If Normalization is Spikes/Sec, bin counts are divided by Bin.  

Page 127

Page 130: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.23. Power Spectral Densities This analysis captures the frequency content neuronal rate histograms.

Parameters

Parameter Description

Max Frequency Maximum frequency of the spectrum in Hz

Number of values Number of values in the spectrum.

Window Overlap (%) Window overlap in percent (from 0 to 90).

Window Preprocessing Preprocessing to be done for each window before calculating the spectrum ofthe window.

Windowing Function Windowing Function to be applied to each window before calculating thespectrum of the window.

Discard IncompleteWindows

Option to discard the last window if it contains less than the expected numberof data points (less than NumberOfFrValues*2 points).

Use Multitaper Algorithm Option to use multi-taper algorithm.

Time-Bandwidth Product Time-Bandwidth Product when using multi-taper algorithm.

Number of Tapers Number of Tapers when using multi-taper algorithm.

Show Frequency From Minimum frequency to be shown in the spectrum graph.

Show Frequency To Maximum frequency to be shown in the spectrum graph.

Normalization Spectrum normalization. See Algorithm below.

Log Frequency Scale An option show Log10 frequency scale.

Smooth Option to smooth the spectrum after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Int. filter type Specifies if the analysis will use a single or multiple interval filters.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Create filter on-the-fly Specifies if a temporary interval filter needs to be created (and used topreselect data).

Create filter around Specifies an event that will be used to create a temporary filter.

Start offset Offset (in seconds, relative to the event specified in Create filter around

Page 128

Page 131: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

parameter) for the start of interval for the temporary filter.

End offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the end of interval for the temporary filter.

Fix overlaps An option to automatically merge the overlapping intervals in the temporaryfilter.

Overlay Graphs An option to draw several histograms in each graph. This option requires thatInt. filter type specifies that multiple interval filters will be used (either Table(row) or Table (col)).

Overlay Options Specifies line colors and line styles for overlaid graphs.

Add to Results / Bin left An option to add an additional vector (containing a left edge of each bin) tothe matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a middle point of each bin)to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of each bin) tothe matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

   

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Spectrum minimum.

YMax Spectrum maximum.

Spikes The number of spikes used in spectrum calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Freq. Mean firing rate (Spikes/Filter_Length).

Page 129

Page 132: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Frequency of Minimum The position of the minimum of the displayed spectrum (in Hz). If there aremultiple bins in the spectrum where the spectrum value is equal to thespectrum minimum, this value represents the frequency of the first such bin.

Frequency of Maximum The position of the maximum of the displayed spectrum (in Hz). If there aremultiple bins in the spectrum where the spectrum value is equal to thespectrum maximum, this value represents the frequency of the first such bin.

 

Algorithm Spectral Densities for Spike Trains and Events Spectral Densities are defined only for continuously recorded signals, so series of timestamps (neuronsand events) need to be converted to continuously recorded signals to calculate the spectra. NeuroExplorer uses rate histograms to represent spike trains as continuous signals. Rate histogramparameters are calculated using the following formulas: Bin = 1./(2.* Maximum_Frequency ) NumberofBins = 2* Number_of_Frequency_Values The rate histogram over the whole analysis time period is split up into data segments (or windows) oflength N (where N is NumberOfBins), overlapping by D points. If overlap is 50%, then D is N/2. For each segment, the signal is preprocessed according to Window Preprocessing parameter. Forexample, if Subtract Mean is selected, ProcessedSignal[i] = Signal[i] - meanOfSignalInSegment. The overlapping segments are then windowed: after the data is split up into overlapping segments, theindividual data segments have a window applied to them (that is, ProcessedWindowedSignal[i] =ProcessedSignal[i]*WindowValue[i]; the window is specified by the Windowing Function). Most window functions afford more influence to the data at the center of the segment than to data at theedges, which represents a loss of information. To mitigate that loss, the individual data segments arecommonly overlapped in time (as in the above step). After doing the above, the periodogram is calculated by computing the discrete Fourier transform, andthen computing the squared magnitude of the result. The individual periodograms are then time-averaged, which reduces the variance of the individual power measurements. The end result is an arrayof power measurements vs. frequency "bin". For multi-taper spectral estimate, several periodograms (tapers) are calculated for each segment. Eachtaper is calculated by applying a specially designed windowing function (Slepian function, see

http://en.wikipedia.org/wiki/Multitaper ). All the tapers for a given segment are then averaged to form the

periodogram of the segment. The individual segment periodograms are then time-averaged. See  http://www.spectraworks.com/Help/mtmtheory.html for a discussion on selecting Multi-Taper

parameters.   Normalization If Normalization is Raw PSD (Numerical Recipes), the power spectrum is normalized so that the sum ofall the spectrum values is equal to the mean squared value of the rate histogram. The formulas (13.4.10)of Numerical Recipes in C are used (squared fft values are divided by Nb^2 where Nb is the number ofvalues in data window, NumberofBins above). (Numerical Recipes in C, Press, Flannery, et al.

Page 130

Page 133: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

(Cambridge University Press, 1992)) If Normalization is % of Total PSD (Numerical Recipes), the power spectrum is normalized so that thesum of all the spectrum values equals 100. If Normalization is Log of PSD (Numerical Recipes), the power spectrum is calculated using the formula: power_spectrum[i] = 10.*log10(raw_spectrum[i]) where raw_spectrum is calculated as described above in Raw PSD (Numerical Recipes). If Normalization is Raw PSD (Matlab), the power spectrum is normalized as described in

http://www.mathworks.com/help/signal/ug/psd-estimate-using-fft.html (squared fft values are divided by

Fs*Nb, where Fs is sampling rate, Nb is the number of values in window, NumberOfBins defined above). If Normalization is Log of PSD (Matlab), the power spectrum is calculated using the formula: power_spectrum[i] = 10.*log10(raw_spectrum_matlab[i]) where raw_spectrum_matlab is calculated as described above in Raw PSD (Matlab).

Page 131

Page 134: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.24. Burst Analysis This analysis identifies bursts in spike trains. Burst start and end times, duration of each burst and otherburst statistics are calculated. For each neuronal variable, a new interval variable can also be created that would contain the timeintervals corresponding to bursts.

Parameters

Parameter Description

Algorithm Selection of MaxInterval, Surprise or Firing Rate Based algorithms.

Max Interval Maximum interspike interval to start the burst (in seconds, MaxIntervalmethod).

Max End Interval Maximum interspike interval to end the burst (in seconds, MaxIntervalmethod).

Min Interburst Interval Minimum interval between bursts (in seconds, MaxInterval method).

Min Burst Duration Minimum burst duration (in seconds, MaxInterval method)

Min Number of Spikes Minimum number of spikes in the burst (MaxInterval method).

Min Surprise Minimum surprise of the burst (Surprise method).

Firing Rate Method Bin Firing Rate Method Bin (seconds).

Firing Rate MethodSmooth Width

Width of the Gaussian filter used in Firing Rate Method.

Firing Rate MethodThreshold

Firing Rate Method Threshold (number of standard deviations).

Firing Rate MethodMinimum Number ofSpikes in Burst

Firing Rate Method Minimum Number of Spikes in Burst.

Display Specifies what burst statistics to display.

Add Burst Interval Vars. An option to create interval variables containing time intervals correspondingto bursts.

Page 132

Page 135: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

 

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Burst rate histogram minimum.

YMax Burst rate histogram maximum.

Spikes The number of spikes used in spectrum calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Frequency Mean firing rate (Spikes/Filter_Length).

Num Bursts Number of bursts.

Bursts Per Second Burst rate in bursts per second.

Bursts Per Minute Burst rate in bursts per minute.

% of Spikes in Bursts Percent of spikes in bursts.

Mean Burst Duration Mean duration of burst (in seconds).

St. Dev. of BurstDuration

Standard deviation of burst duration.

Mean Spikes in Burst Average number of spikes in burst.

St. Dev. of Spikes inBurst

Standard deviation of the number of spikes in burst.

Mean ISI Burst Mean interspike interval in burst.

St. Dev of ISI in Burst Standard deviation of interspike intervals in burst.

Page 133

Page 136: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••••

Mean Freq. in Burst Mean firing rate (1/interspike_interval) in burst.

St. Dev. of Freq. in Burst Standard deviation of (1/interspike_interval) in burst.

Mean Peak Frequencyin Burst

Mean of (1/min_interspike_interval), where min_interspike_interval is theminimum interspike interval in a burst.

St. Dev. PeakFrequency in Burst

Standard deviation of (1/min_interspike_interval), wheremin_interspike_interval is the minimum interspike interval in a burst.

Mean Interburst Interval Average length (in seconds) of interburst interval. Interburst interval is theinterval from the end of the previous burst to the start of the current burst.

St. Dev. of InterburstInterval

Standard deviation of the interburst intervals.

Mean Burst Surprise Average burst surprise.

St. Dev. Burst Surprise Standard deviation of burst surprise.  

Algorithm For each spike train, NeuroExplorer identifies bursts and calculates burst start and end times, burstduration, number of spikes in burst, mean ISI in burst and peak frequency (1/min_interspike_interval) inburst. Optionally, creates a new Interval variable and stores all the burst intervals in this variable.

MaxInterval Method Find all the bursts using the following algorithm:

Scan the spike train until an interspike interval is found that is less than or equal to Max. Interval.While the interspike intervals are less than Max. End Interval, they are included in the burst.If the interspike interval is more than Max. End Interval, the burst ends.Merge all the bursts that are less than Min. Interval Between Bursts apart.Remove the bursts that have duration less than Min. Duration of Burst or have fewer spikes thanMin. Number of Spikes.

Surprise Method 1) First the mean firing rate ( Freq ) and mean interspike interval ( MeanISI ) of the neuron arecalculated. Freq = NumberOfSpikes / (FileEndTime – FileStartTime) MeanISI = 1 / Freq 2) NeuroExplorer scans the spike train until it finds two sequential ISI's so that each of those ISIs is lessthan MeanISI/2. The surprise of the resulting 3-spike sequence is calculated: If we assume that a random variable P has a Poisson distribution with parameter Freq and we alsoassume that the burst has N spikes and the distance from the first to the last spike of the burst is T, thenthe surprise of the burst is: S = - log10 (Probability that P has at least N points in a time interval of length T ) 3) NeuroExplorer adds the spikes to the end of the burst until the first ISI that is more than MeanISI andcalculates surprise for each of the bursts (with 3 initial spikes, 4 spikes, 5 spikes, etc.) The burst withmaximum surprise Smax is then selected.

Page 134

Page 137: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

4) NeuroExplorer removes the spikes from the beginning of the burst and calculates the surprise for eachof the reduced bursts. The burst with maximum surprise Smax is then selected. 5) If Smax is more than MinSurprise and the number of spikes in the burst is more than 3,NeuroExplorer adds the burst to the result.

Firing Rate Based Method 1) Firing rate histogram with the specified bin size is calculated. 2) Rate histogram is smoothed using Gaussian smooth filter of the specified width. See Post-Processing

Options for details of filter design. 3) Mean and Standard Deviation (STD) of the smoothed rate histogram are calculated. 4) Bins that have smooth histogram values of more than Mean+STD*Firing_Rate_Method_Threshold areconsidered to be in the burst. Burst start is the first spike in the burst bins, burst end is the last spike inthe burst bins. 5) Bursts that have fewer spikes than the specified Minimum Number of Spikes in Burst are removed.

Reference Legendy C.R. and Salcman M. (1985): Bursts and recurrences of bursts in the spike trains ofspontaneously active striate cortex neurons. J. Neurophysiology, 53(4):926-39.

Page 135

Page 138: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.25. Principal Component Analysis This analysis calculates eigenvalues and eigenvectors (principal components) of the matrix ofcorrelations of rate histograms. The analysis creates population vectors corresponding to the principal

components.

Parameters

Parameter Description

Bin Bin size in seconds.

Vectors Prefix A string specifying how the population vector names will be generated. Forexample, if prefix is pca1, the vector names will be pca1_01, pca1_02, etc.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name and PCA statistics name.

pca1_N The weight of the variable in the N-th eigenvector. The rows at the bottom ofthe table also show Eigenvalue of this eigenvector, % of variance it explains,and the cumulative percent of the variance explained by this and precedingeigenvectors.

Corr with VAR Correlation with the specified variable.

Page 136

Page 139: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Numerical Results The Results sheet shows for each neuron the weights this neuron has in all the eigenvectors.

 

Algorithm Step 1. Rate histograms are calculated for each of the selected neurons. The time axis is divided into bins. The first bin is [0, Bin). The second bin is [Bin, Bin*2), etc. The leftend is included in each bin, the right end is excluded from the bin. For each bin, the number of events(spikes) in this bin is calculated. For example, for the first bin bin_count = number of timestamps (ts) such that ts >= 0 and ts < Bin Bin counts are calculated in such a way for all the selected variables resulting in a matrix bin_count[i, j], where i is the neuron number, j is the bin number. Step 2. The matrix of correlations between neurons c[t, s] is calculated: c[t, s] = correlation between vectors bin_count[t, *] and bin_count[s, *], s, t = 1, ..., number of selectedneurons. Step 3 The eigenvalues and eigenvectors are calculated for the matrix c[t, s]. The eigenvectors (principalcomponents) are sorted according to their eigenvalues. The first principal component has the largesteigenvalue. Each principal component becomes a new population vector in the data file.

Page 137

Page 140: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.26. PSTH Versus Time This analysis shows the dynamics of the perievent histogram over time. It calculates multiple PSThistograms using a "sliding window" in time. Each histogram is shown as a vertical stripe with colorsrepresenting the bin counts. Horizontal axis represents the position of the sliding window in time.

Parameters

Parameter Description

Reference Specifies a reference neuron or event.

XMinPSTH Histogram time minimum in seconds.

XMaxPSTH Histogram time maximum in seconds

BinPSTH Histogram bin size in seconds.

Start Start of the first sliding window in seconds.

Duration Duration of the sliding window in seconds.

Shift How much sliding window is shifted each time.

Number of shifts The number of sliding windows to be used.

Normalization Histogram units (Counts/Bin, Probability or Spikes/Second). See Algorithmbelow.

No Selfcount An option not to count reference events if the target event is the same as thereference event (prevents a histogram to have a huge peak at zero whencalculating PSTH versus itself).

Sliding window axisdirection

Direction of the sliding window axis (horizontal or vertical).

Sliding window axisalignment

Allows to specify what values are shown in the sliding window axis. There aretwo options: Start of Window and Center of Window.  Suppose your data has the strongest correlation at 50 seconds. This meansthat the window that has 50 seconds as its center will show the highest PSTvalues. If the window width is 20 seconds, it will be the window [40,60]. If youare using 'Start of window' option, you will see the peak at 40 instead of 50seconds. However, with 'Center of window' option, the peak will be at 50seconds.

Smooth Option to smooth the histogram after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Page 138

Page 141: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Reference Reference variable name.

YMin PSTH minimum.

YMax PSTH maximum.

Color Scale Min PSTH minimum.

Color Scale Max PSTH maximum.

Spikes The number of spikes in the variable.

Algorithm NeuroExplorer calculates multiple PST histograms (see Perievent Histogram for more information on

how each PSTH is calculated). Each histogram is calculated for a different interval (window) in time: [window_start[i], window_end[i]], i = 1,..., Number of Shifts. That is, for each histogram only the timestamps that are within the window are used. The following rules are used to calculate the windows: window_start[1] = Start window_end[1] = Start + Duration window_start[2] = Start + Shift window_end[2] = Start + Shift + Duration ...

Page 139

Page 142: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.27. Correlations with Continuous Variable This analysis calculates crosscorrelations between a continuously recorded variable and a neuronal firingrate, or crosscorrelations between a continuously recorded variable and another continuous variable.

Parameters

Parameter Description

Reference Specifies a reference continuous variable.

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds.

Bin Type An option to specify how the bin value is determined. If this option is Auto,NeuroExplorer will use the bin equal to the A/D sampling interval of thereference variable.

Bin Bin size in seconds. Used if Bin Type is set to User defined.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Smooth Option to smooth the histogram after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Add to Results / Bin left An option to add an additional vector (containing a left edge of each bin) tothe matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a middle point of each bin)to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of each bin) tothe matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the form

Page 140

Page 143: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

CR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Reference Reference variable name.

YMin Y axis minimum.

YMax Y axis maximum.

Mean Hist. Mean of all the correlation values for this variable.

St. Dev. Hist Standard deviation of all the correlation values for this variable.

St. Err. Mean Hist Standard error of mean of all the correlation values for this variable.

Algorithm This analysis calculates standard correlograms for two (continuously recorded) vectors. For spike trainsand events, NeuroExplorer first calculates the rate histograms with the specified bin size, and thencalculates the correlations between the reference variable and the rate histogram. If x[i], i=1,...N is the vector of all the values of the reference variable with sampling rate SR and y[i],i=1,...,N is the vector of all the values of another continuous variable or values of spike train ratehistogram, then correlation[lag_n_seconds] = Pearson correlation between vectors { x[1], x[2], …, x[N-lag_in_samples] } and { y[1+lag_in_samples], y[2+lag_in_samples], …, y[N] } where lag_in_samples = lag_in_seconds*SR.   Let's consider the following example. We have continuous variable Cont1. We create continuous variableCont2 by running shift operation on Cont1 with shift=0.02s.   For each value of time t, we have Cont1[t] = Cont2[t+0.02]. This means that if reference is Cont1 andlag_in_seconds = 0.02s, we will calculate Pearson correlation of identical vectors. That is, our correlationresult will have the highest value close to 1.0 at 0.02 seconds.    

Page 141

Page 144: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.28. Regularity Analysis This analysis estimates the regularity of neuronal firing after the stimulation.

Parameters

Parameter Description

Reference Specifies a reference event or spike train.

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds.

Bin Bin size in seconds. Used if Bin Type is set to User defined.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

ISI Graph This parameter determines how the mean ISI values is displayed in thegraph.

SD Graph This parameter determines how the standard deviation of ISI is displayed inthe graph.

CV Graph This parameter determines how the CV (coefficient of variation) values aredisplayed in the graph.

CV Graph Max This parameter determines the scale for the CV values in the graph. CVvalues are scaled from zero (bottom of the graph) to CV Graph Max (top ofthe graph).

Add to Results / Bin left An option to add an additional vector (containing a left edge of each bin) tothe matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a middle point of each bin)to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of each bin) tothe matrix of numerical results.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

NumRefEvents Number of reference events.

YMin Histogram minimum.

Page 142

Page 145: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

YMax Histogram maximum.

Spikes The number of spikes used in calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Freq. Mean firing rate (Spikes/Filter_Length).

Mean Hist. The mean of the histogram bin values (ISI values).

St. Dev. Hist. The standard deviation of the histogram bin values.

St. Dev. ISI The mean value of the SD ISI graph.

CV The mean value of the CV ISI graph.

Algorithm This analysis estimates the regularity of neuronal firing after the stimulation. The time axis is divided intobins with the first bin starting at the stimulus sync pulse. Interspike intervals are computed and intervalvalues are placed in time bins according to the latency of the first spike in the interval (if the end of the ISIis more than XMax, the interval is not used in the analysis). Then the mean and standard deviation ineach bin are calculated. CV is equal to standard deviation for the bin divided by the mean ISI for the bin. Let ref[i] be the array of timestamps of the reference event, ts[i] be the spike train (each ts is the timestamp) For each timestamp ref[k]: 1a) calculate the distances from this event (or spike) to all the spikes in the spike train: d[i] = ts[i] - ref[k] 1b) calculate the interspike interval isi[i] = ts[i+1] - ts[i] 1c) for each i: if d[i] is inside the first bin ( d[i] >= XMin and d[i] < XMin + Bin ) and d[i] + isi[i] < XMax, add isi[i] to the series of intervals for the first bin if d[i] is inside the second bin ( d[i] >= XMin+Bin and d[i] < XMin + Bin*2 ) and d[i] + isi[i] < XMax, add isi[i] to the series of intervals for the second bin and so on... . 2) for each bin, calculate mean and standard deviation of the series of interspike intervals for this bin.

Reference E.D. Young, J.-M. Robert and W.P. Shofner. Regularity and latency of units in ventral cochlear nucleus:implications for unit classification and generation of response properties. J. Neurophysiology, Vol. 60,1988, 1-29.

Page 143

Page 146: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.29. Place Cell Analysis This analysis estimates the frequency of neuronal firing as a function of position of an animal. The animalposition should be described by two continuously recorded variables.

Parameters

Parameter Description

X Position Continuous variable that describes X position of the animal.

Y Position Continuous variable that describes Y position of the animal.

Fix Positions This option specifies whether NeuroExplorer needs to fix problems that oftenoccur in recording of position variables. For example, when LED is obscuredby the wires, both position variables suddenly jump to 0 and then jump backto the previous position.

Fix Threshold Fix Positions parameter. See Algorithm section below for details.

Fix Bad X Fix Positions parameter. The 'bad' value of X variable. See Algorithm sectionbelow for details.

Fix Bad Y Fix Positions parameter. The 'bad' value of Y variable. See Algorithm sectionbelow for details.

X Min X axis minimum in X Position units.

X Max X axis maximum in X Position units.

Y Min Y axis minimum in Y Position units.

Y Max Y axis maximum in Y Position units.

Number of Bins (X) Number of bins along X axis.

Number of Bins (Y) Number of bins along Y axis.

Display This parameter determines what kind of Place Cell Analysis display is shown(Path, Firing Positions, Time Spent (in each cell), Number of Visits (to eachcell), Spike Counts (for each cell), Firing Rates (for each cell), Firing Fields).

Min. Time Spent Minimum time spent. This parameter is used only with Firing Rates display. Ifthe animal spent less time in the cell than Min Time Spent, the firing rate forthe cell is set to zero.

Min Visits Minimum number of visits. This parameter is used only with Firing Ratesdisplay. If the animal visited the cell less than Min Visits number of times, thefiring rate for the cell is set to zero.

Firing Rate Bin Bin size (in seconds) to calculate firing rates.

Min Std. Dev. in Field Minimum standard deviation in the field. See Algorithm section below fordetails.

Min. Pixels in Field Minimum number of pixels in the field. See Algorithm section below fordetails.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used in

Page 144

Page 147: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

analysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Int. filter type Specifies if the analysis will use a single or multiple interval filters.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Create filter on-the-fly Specifies if a temporary interval filter needs to be created (and used topreselect data).

Create filter around Specifies an event that will be used to create a temporary filter.

Start offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the start of interval for the temporary filter.

End offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the end of interval for the temporary filter.

Fix overlaps An option to automatically merge the overlapping intervals in the temporaryfilter.

Smooth Matrix An option to smooth the matrix after the calculation. See Post-Processing

Options for details.

Smooth Radius The radius of the smoothing filter (in cells) See Post-Processing Options fordetails.

Smooth Colors An option to smooth colors (blend colors across cells to make smooth colortransitions). This option may require considerable computation time.

Bins with Num VisitsLess than Min

An option on how to display cells where the number of visits is less than thespecified minimum ( Min Visits parameter).

Bins with Time SpentLess than Min

An option on how to display cells where the time spent is less than thespecified minimum ( Min. Time Spent parameter).

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Page 145

Page 148: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Column Description

Variable Variable name.

Spikes The number of spikes used in calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Position ISI mode Average interval between two consecutive position data points (in seconds).

Mean Firing Rate Mean firing rate (mean of all the firing rates for all the cells).

St. Dev. Firing Rate Standard deviation of the firing rate (st. dev. of all the firing rates for all thecells).

Firing Fields The number of firing fields.

Field N Num Cells The number of cells in the firing field N.

Field N Centroid X X coordinate of the field N centroid.

Field N Centroid Y Y coordinate of the field N centroid.

Field N Peak Rate Maximum firing rate among the cells inside the firing field N.

Field N Spikes Number of spikes in field N.

Field N Time Spent Total time spend in the field N.

Field N Rate Average firing rate in field N ( Field N Spikes divided by Field N Time Spent ).

Field N Coherence Coherence measures the local smoothness of the firing rate distribution in thefield. It is the Pearson correlation of the firing rate in each cell (pixel) with thefiring rate averaged over the pixel and its 8 nearest neighbors.

Algorithm If Fix Positions is set to Use 4 Neighbors, NeuroExplorer will analyze X and Y position variables and dothe following: for each point x[t], calculate the average of its 4 neighbors: aver = (x[t-2]+x[t-1]+x[t+1]+x[t+2])/4 if abs(x[t] - aver) > FixThreshold, then assign x[t] the average of its neighbors: x[t] = aver   If Fix Positions is set to Ignore Bad, NeuroExplorer will ignore position points that have coordinates thatare within 0.001 of the specified 'bad' X and X values.   If Fix Positions is set to Interpolate, for each position point that has coordinates that are within 0.001 ofthe specified 'bad' X and X values, the X and Y values are interpolated using the closest previous validposition and the closest next valid position.  

Page 146

Page 149: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

The following steps are then performed: The position space is divided into cells with width ( XMax - XMin )/ Number of Bins (X) and height (YMax - YMin )/ Number of Bins (Y). For each cell, the number of visits to this cell and the time spent in the cell are calculated. For each of the neuron firing times, the position of the animal is calculated using linear interpolation ofanimal positions before and after the spike. For each cell, the number of times the neuron fired in this cell is calculated.   With Firing Rates display, if the animal spent less time in the cell than Min Time Spent or visited the cellless than Min Visits number of times, the firing rate for the cell is set to zero. Otherwise the number oftimes the neuron fired in this cell is divided by the time the animal spent in the cell producing the firingrate for the cell.   Firing Field a set of at least Min. Pixels in Field contiguous cells where each cell in the field shared atleast one side with another cell in the field and each cell had a firing rate greater than (Session_mean +Min Std. Dev. in Field * Session_st_dev), where Session_mean is the firing rate of the completerecording session, Session_st_dev is the standard deviation of the mean firing rate. Session_mean andSession_st_dev are calculated the following way: the recording session is divided into time bins of sizeFiring Rate Bin. For each bin i, neuron firing rate R[i] is calculated. Session_mean is the mean of arrayR[i], Session_st_dev is the standard deviation of array R[i]. Centroid of field location is the arithmetic mean center of a firing field's spatial firing rate distributiondetermined after the coordinates of each cell in the field was multiplied by the firing rate in the cell. Coherence measures the local smoothness of the firing rate distribution in the field. It is the Pearsoncorrelation of the firing rate in each cell with the firing rate averaged over the cell and its 8 nearestneighbors.  

Reference A. Fentona, Gyorgy Csizmadiab, and Robert U. Muller. Conjoint Control of Hippocampal Place Cell Firingby Two Visual Stimuli I. The Effects of Moving the Stimuli on Firing Field Positions. The Journal ofGeneral Physiology, Volume 116, Number 2, August 1, 2000 191-210.

Page 147

Page 150: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.30. Reverse Correlation This analysis is used for estimation of receptive fields in vision research. The analysis calculates theaverage visual stimulus that preceded the spike.

Parameters

Parameter Description

Reference the variable that contains timestamps of the stimuli.

Stim. Sequence File The path of the text file that contains the sequence of images used forstimulation. See Algorithm below for file format description.

Char. per pixel The number of characters per pixel in image file.

Pixels in Row The number of pixels in a row for each stimulus image.

Rows in Image The number of rows of pixels in each stimulus image.

Cache Stim. Data An option to cache stimulus image data. If this option is selected, the imagedata is loaded once and stored in memory (until a different stimulus sequencefile is specified). To clear cache, run this analysis once with this optiondisabled.

XMin (deg) Minimum of the X axis of the average stimulus display (in degrees).

XMax (deg) Maximum of the X axis of the average stimulus display (in degrees).

YMin (deg) Minimum of the Y axis of the average stimulus display (in degrees).

YMax (deg) Maximum of the Y axis of the average stimulus display (in degrees).

Time Min (sec) Time minimum in seconds.

Time Max (sec) Time maximum. For example, if Time Min = -0.4 and Time Max = 0,NeuroExplorer will analyze all the stimuli that were presented up to 400 msecbefore each spike.

Time Bin (sec) Time bin.

Display This option specifies what view of the average stimulus will be displayed. See Algorithm below.

Show Slice At This option specifies the slice that will be shown. The units and valid rangedepend on the Display option See Algorithm below.

Z Min Color scale minimum.

Z Max Color scale maximum.

Smooth Colors An option to smooth colors of the average stimulus matrix.

Matrix Scale An option on what color scale to use when drawing the matrix.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results are

Page 148

Page 151: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••••

sent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Save 3D Matrix An option to save 3D matrix of numerical results in a .csv file. 3D matrix (in Xvs. Y display case) is saved starting from the first slice (at Time Min), then thesecond slice, etc. Within the slice, the first row corresponds to Y Min, the firstcolumn corresponds to X Min.

Save File The name of the file that will contain 3D matrix data.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Y axis minimum.

YMax Y axis maximum.

RefCount Number of reference events (and images used).

Color Scale Min Minimum of color scale.

Color Scale Max Maximum of color scale.

Spikes The number of spikes used in calculation.

Algorithm Stimulus File Format. NeuroExplorer assumes that the sequence of images used for stimulation issaved in a text file. The file has the following format:

each line of the file represents a row of pixels in the stimulus imageeach pixel is represented by an integereach pixel has the same number of characters used for its descriptionimages are saved in the file in the order they were presentedimages can be (optionally) separated by blank lines

Here is an example of an image file with 2 images (16 pixels per row, 12 rows per image): 0 1 1 1 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Page 149

Page 152: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 00 1 1 1 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 00 0 0 0 0 0 0 0 0 0 0 0 0 0 0 The computational algorithm works the following way. For each spike of a selected neuron,NeuroExplorer identifies the images that precede the spike and are within the specified time interval(between Tmin and Tmax; for example, if Tmin = -0.4 and Tmax = 0, NeuroExplorer will analyze all thestimuli that were presented up to 400 msec before each spike). Then, NeuroExplorer calculates the average of the presented stimuli over all the spikes. The result is a 3-dimensional matrix (with X, Y, and Time dimensions, time axis is divided into bins of the specified size). Display option identifies what 2-dimensional view of this matrix is presented: X vs. Y display shows an average stimulus image for the specified time slice X vs. Time display shows average X pixels of the stimuli for the specified Y value Y vs. Time display shows average Y pixels of the stimuli for the specified X value

Reference Izumi Ohzawa, Gregory C. DeAngelis, and Ralph D. Freeman (1996). Encoding of binocular disparity bysimple cells in the cat's visual cortex. J. Neurophysiol. 75: 1779-1805.

Page 150

Page 153: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.31. Epoch Counts This analysis is very similar to Perievent Histograms. The only distinction is that, instead of calculatingbin counts for consecutive bins of the same size, Epoch Counts analysis can calculate bin counts for bins(epochs) of any size. Epochs can be of different lengths and can overlap.

Parameters

Parameter Description

Reference Type Specifies if the analysis will use a single or multiple reference events.

Reference Specifies a reference neuron or event (or a group of reference neurons orevents).

Epochs A table of epochs in seconds.

No Selfcount An option not to count reference events if the target event is the same as thereference event (prevents a histogram to have a huge peak at zero whencalculating PSTH versus itself).

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Int. filter type Specifies if the analysis will use a single or multiple interval filters.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Add to Results / Bin left An option to add an additional vector (containing a left edge of each epoch) tothe matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of each epoch)to the matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results

Page 151

Page 154: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Reference The name of the reference event.

NumRefEvents The number of reference events.

YMin Minimum epoch count for this variable.

YMax Maximum epoch count for this variable.

Filter Length The length of the interval filter.

Algorithm Let ref[i] be the array of timestamps of the reference event, ts[i] be the spike train (each ts is thetimestamp) and epochs are specified as EpochStart[j], EpochEnd[j]. For each timestamp ref[k]: 1) calculate the distances from this event (or spike) to all the spikes in the spike train: d[i] = ts[i] - ref[k] 2) for each i: if d[i] is inside the first epoch, increment the counter for the first epoch: if d[i] >= EpochStart[1] and d[i] < EpochEnd[1] then epochcount[1] = epochcount[1] +1 if d[i] is inside the second epoch, increment the counter for the second epoch: if d[i] >= EpochStart[2] and d[i] < EpochEnd[2] then epochcount[2] = epochcount[2] +1 and so on... .

Page 152

Page 155: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.32. Coherence Analysis Coherence is a measure of the degree of relationship, as a function of frequency, between two timeseries.

Parameters

Parameter Description

Reference Specifies a reference variable.

Max. Freq. Frequency maximum (Hz).

Number of Fr. Values Number of frequency values.

Window Overlap Percent of window overlaps when calculating FFTs.

Window Preprocessing Preprocessing to be done for each window before calculating the spectrum ofthe window.

Windowing Function Windowing Function to be applied to each window before calculating thespectrum of the window.

Discard IncompleteWindows

Option to discard the last window if it contains less than the expected numberof data points (less than NumberOfFrValues*2 points).

Use Multitaper Algorithm Option to use multi-taper algorithm.

Time-Bandwidth Product Time-Bandwidth Product when using multi-taper algorithm.

Number of Tapers Number of Tapers when using multi-taper algorithm.

Show Freq. From An option to show a subset of frequencies. Specifies minimum frequency tobe displayed.

Show Freq. To An option to show a subset of frequencies. Specifies maximum frequency tobe displayed.

Calculate Specifies whether coherence values or coherence phases are calculated.

Confidence Level (%) Confidence level (percent) for the coherence values. Can only be calculated ifa single-taper algorithm is used. See Confidence Level Calculation below fordetails.

Draw confidence level An option to draw the confidence level. Confidence level is not drawn ifcoherence phases are specified in Calculate parameter or if a multi-taperalgorithm is used.

Conf. line style Line style for drawing confidence level.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Page 153

Page 156: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Add to Results / Bin left An option to add an additional vector (containing a left edge of eachfrequency bin) to the matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a center of each frequencybin) to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of eachfrequency bin) to the matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Y Min Y axis minimum.

Y Max Y axis maximum.

Spikes The number of spikes used (for neurons or events).

Rate Hist Bin Bin size of the rate histograms used for the calculations (for neurons orevents).

Filter Length The length of the interval filter.

Mean Freq. Mean firing rate (for neurons or events).

Confidence Level Confidence level for the coherence values.

Algorithm Neurons and Events Coherence is defined only for continuously recorded signals, so series of timestamps (neurons andevents) need to be converted to continuously recorded signals to calculate coherence. NeuroExplorer uses rate histograms to represent spike trains as continuous signals. Rate histogramparameters are calculated using the following formulas: Bin = 1./(2.* Maximum_Frequency )

Page 154

Page 157: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

NumberOfBins = 2* Number_of_Frequency_Values The rate histogram over the whole analysis time period is split up into data segments (or windows) oflength N (where N is NumberOfBins), overlapping by D points. If overlap is 50%, then D is N/2. For each segment, the signal is preprocessed according to Window Preprocessing parameter. Forexample, if Subtract Mean is selected, ProcessedSignal[i] = Signal[i] - meanOfSignalInSegment. The overlapping segments are then windowed: after the data is split up into overlapping segments, theindividual data segments have a window applied to them (that is, ProcessedWindowedSignal[i] =ProcessedSignal[i]*WindowValue[i]; the window is specified by the Windowing Function). Most window functions afford more influence to the data at the center of the segment than to data at theedges, which represents a loss of information. To mitigate that loss, the individual data segments arecommonly overlapped in time (as in the above step). For two variables X (reference) and Y (target) the following entities are calculated. FFTs of the datasegments (after preprocessing) are calculated. Then, individual and cross-densities are calculated: Pxx = FFT(X)*Conj(FFT(X)), Pyy = FFT(Y)*Conj(FFT(Y)) Pxy = FFT(X)*Conj(FFT(Y)). Here Conj(z) is a complex conjugate of z. Pxx, Pyy and Pxy values are averaged across all intervals andcoherence values are calculated as Mean(Pxy)*Mean(Pxy) / (Mean(Pxx)*Mean(Pyy)). Coherence phase values are calculated as phase of Mean(Pxy). Continuous Variables For continuous variables, if both the reference and the target variables have the same digitizingfrequency, the FFTs of variable values (after applying preprocessing and tapering window) are calculatedand then resampled to the specified frequency steps. If the reference is a timestamped variable or twocontinuous variables have different digitizing rates, the values of continuous variables are averagedwithin the specified bins and then FFTs of these averages are calculated.   Calculation of the Confidence Level Confidence levels can only be calculated if a single-taper algorithm is used. Confidence levels are calculated as described in Kattla and Lowery (2010). The confidence level Z iscalculated as Z = 1 - pow(alpha, 1/(w*L - 1)) where pow(x,y) returns x to the power of y, alpha = 1 - Confidence_Level*0.01, L is the number of overlapped windows w is the correction due to the Hanning window tapering (see eq. (5) and (6) in Kattla and Lowery (2010)).   Reference

Page 155

Page 158: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Kattla S, Lowery MM. Fatigue related changes in electromyographic coherence between synergistic handmuscles. Exp Brain Res. 2010 Apr; 202(1):89-99. Epub 2009 Dec 12.

Page 156

Page 159: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.33. Spectrogram Analysis This analysis captures the frequency content of continuous variables or neuronal rate histograms.

Parameters

Parameter Description

Max. Freq. Maximum frequency for the spectrograms. If at least one continuous variableis selected, the value of the Maximum Frequency parameter is set as0.5*Digitizing frequency of the first selected continuous variable. Allcontinuous variables selected for this analysis should have the samedigitizing rate.

Number of Fr. Values Number of frequency values.

Normalization Spectrum units (see Normalization below).

Start Start of the first window.

Shift Type Option to specify shift in seconds or as a percent of the sliding window width.

Shift (sec) If Shift Type is Absolute, specifies how much sliding window is shifted eachtime (in seconds).

Shift (window %) If Shift Type is Window Percent, specifies how much sliding window isshifted each time as a percent of the overall sliding window width.

Number of Shifts total number of sliding windows.

Window Preprocessing Preprocessing to be done for each window before calculating the spectrum ofthe window.

Windowing Function Windowing Function to be applied to each window before calculating thespectrum of the window.

Use Multitaper Algorithm Option to use multi-taper algorithm.

Time-Bandwidth Product Time-Bandwidth Product when using multi-taper algorithm.

Number of Tapers Number of Tapers when using multi-taper algorithm.

Show Freq. From An option to show a subset of frequencies. Specifies minimum frequency tobe displayed.

Show Freq. To An option to show a subset of frequencies. Specifies maximum frequency tobe displayed.

X Axis Allows to specify what values are shown in the sliding window X axis. Thereare two options: Start of Window and Center of Window. Suppose your data has the strongest spectral value at 5 seconds. Thismeans that the window that has 5 seconds as its center will show the highestspectrum values. If the window width is 2 seconds, it will be the window [4,6].If you are using 'Start of window' option, you will see the peak at 4 instead of5 seconds. However, with 'Center of window' option, the peak will be at 5seconds.

Smooth Option to smooth the spectrum after the calculation. See Post-Processing

Page 157

Page 160: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Color Scale Limit (%) Specifies maximum value for the color scale in percent. Allows you to 'zoomin' small spectrogram values.

Log Vertical FrequencyScale

Option to draw logarithmic vertical frequency scale.

Draw Signal aboveSpectrogram

Option to draw signal above histogram. The signal is drawn for the timevalues specified in X Axis. It is recommended to use Center of Window optionfor X Axis (otherwise, the signal will not be aligned to the spectrogram).

Signal Window Height(%)

The height of the signal window (percent of the total graph window).

Add Freq. Values toResults

An option to add an additional vector (containing a left edge of eachfrequency bin) to the matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Y Min Y axis minimum.

Y Max Y axis maximum.

Color Scale Min Color scale minimum.

Color Scale Max Color scale maximum.

Max Frequency Used Maximum frequency of the FFTs used.

Rate Histogram Bin Rate histogram bin size in seconds (if used).

Window width FFT window width (seconds).

Actual shift Actual window shift used in analysis.

Page 158

Page 161: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Algorithm The power spectrum is calculated for the specified number ( Number of Shifts ) of windows. For eachwindow:  

Normalization If Normalization is Raw PSD (Numerical Recipes), the power spectrum is normalized so that the sum ofall the spectrum values is equal to the mean squared value of the rate histogram. The formulas (13.4.10)of Numerical Recipes in C are used. (Numerical Recipes in C, Press, Flannery, et al. (CambridgeUniversity Press, 1992)) If Normalization is % of Total PSD (Numerical Recipes), the power spectrum is normalized so that thesum of all the spectrum values equals 100. If Normalization is Log of PSD (Numerical Recipes), the power spectrum is calculated using the formula: power_spectrum[i] = 10.*log10(raw_spectrum[i]) where raw_spectrum is calculated as described above in Raw PSD (Numerical Recipes). If Normalization is Raw PSD (Matlab), the power spectrum is normalized as described in

http://www.mathworks.com/help/signal/ug/psd-estimate-using-fft.html If Normalization is Log of PSD (Matlab), the power spectrum is calculated using the formula: power_spectrum[i] = 10.*log10(raw_spectrum_matlab[i]) where raw_spectrum_matlab is calculated as described above in Raw PSD (Matlab).

Page 159

Page 162: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.34. Perievent Spectrograms This analysis captures the frequency content of continuous variables or neuronal rate histograms in thetime windows around reference events. The idea of perievent spectrogram analysis is that you may have stimuli applied to your neural networkand the neurons or LFPs exhibit slight variations of their spectral properties in some periods right afterthe stimuli. You may not see the variation when analyzing the response to the single stimulus, but whenyou average the spectrograms over all the stimuli, you may get a clear picture.

Parameters

Parameter Description

Reference Reference event.

Skip ref. events withmissing cont. data

An option to skip reference events when calculating PeriEvent Spectrogramsfor continuous variables. Use this option when continuous variables havegaps (time periods without data points). See Algorithm below for details.

Max. Freq. Maximum frequency for the spectrograms. If at least one continuous variableis selected, the value of the Maximum Frequency parameter is set as0.5*Digitizing frequency of the first selected continuous variable. Allcontinuous variables selected for this analysis should have the samedigitizing rate.

Number of Fr. Values Number of frequency values.

Normalization Spectrum units (see Normalization in Spectrogram Analysis).

Start Start of the first window (relative to the reference event).

Shift Type Option to specify shift in seconds or as a percent of the sliding window width.

Shift (sec) If Shift Type is Absolute, specifies how much sliding window is shifted eachtime (in seconds).

Shift (window %) If Shift Type is Window Percent, specifies how much sliding window isshifted each time as a percent of the overall sliding window width.

Number of Shifts total number of sliding windows.

Show Freq. From An option to show a subset of frequencies. Specifies minimum frequency tobe displayed.

Show Freq. To An option to show a subset of frequencies. Specifies maximum frequency tobe displayed.

X Axis Allows to specify what values are shown in the sliding window X axis. Thereare two options: Start of Window and Center of Window.  Suppose your data has the strongest spectral value at 5 seconds. Thismeans that the window that has 5 seconds as its center will show the highestspectrum values. If the window width is 2 seconds, it will be the window [4,6].If you are using 'Start of window' option, you will see the peak at 4 instead of5 seconds. However, with 'Center of window' option, the peak will be at 5seconds.

Page 160

Page 163: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Log Vertical FrequencyScale

Option to draw logarithmic vertical frequency scale.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Smooth Option to smooth the spectrum after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Add to Results / Bin left An option to add an additional vector (containing a left edge of eachfrequency bin) to the matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a center of each frequencybin) to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of eachfrequency bin) to the matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Y Min Y axis minimum.

Y Max Y axis maximum.

Color Scale Min Color scale minimum.

Color Scale Max Color scale maximum.

Page 161

Page 164: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Max Frequency Used Maximum frequency of the FFTs used.

Rate Histogram Bin Rate histogram bin size in seconds (if used).

Number of Ref. Events Number of reference events.

Window width FFT window width (seconds).

Actual shift Actual window shift used in analysis.

Number of Bins In Shift Number of rate histogram bins in shift (if rate histograms were used).

Algorithm Perievent spectrogram is an average of multiple regular spectrograms. For each timestamp of thereference event, a regular spectrogram is calculated, then these spectrograms are averaged over allselected reference timestamps. If Skip ref. events with missing cont. data option is selected, and there is no continuous data for anypart of time interval [RefTimestamp+StartTime, RefTimestamp+StartTime+Shift*NumberOfShifts], thespectrogram for RefTimestamp is not calculated.  

Page 162

Page 165: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.35. Joint ISI Distribution For each spike, a point is calculated where the X coordinate of the point is the current interspike intervaland Y coordinate of the point is the preceding interspike interval. The density of these points is shown inthe graph.

Parameters

Parameter Description

Min Interval Time axis minimum in seconds.

Max Interval Time axis maximum in seconds

Bin Bin size in seconds.

Log Axis Scale An option to use Log10 axis scales.

Matrix Scale Matrix color scale.

Smooth Matrix An option to smooth matrix after calculation.

Smooth Radius Radius of the smooth filter (in bins).

Smooth Colors An option to smooth colors using bicubic splines.

Log Color Scale An option to use Log10 color scale.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Add to Results / Bin left An option to add an additional vector (containing a left edge of each bin) tothe matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a middle point of each bin)to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of each bin) tothe matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

Page 163

Page 166: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

 

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Y axis minimum.

YMax Y axis maximum.

Color Scale Min Color scale minimum.

Color Scale Max Color scale maximum.    

Algorithm If Use Log Bins and Axes option is not selected:   Matrix of binCounts[x,y] is created. Each element of the matrix is initialized as zero. For each spike that occurred at time t[i], the following values are calculated: Interval_I = t[i] - t[i-1] binX = (Interval_I – MinInterval)/Bin Interval_I_Plus_1 = t[i+1] - t[i] binY = (Interval_I_Plus_1 – MinInterval)/Bin Then, the corresponding bin count is incremented: binCounts[binX, binY] = binCounts[binX, binY] + 1 The graph shows binCounts matrix values using color scale.   If Use Log Bins and Axes option is selected: The i-th bin (i=1,2,...) on each axis is [IntMin * 10 ^ ((i -1)/D), IntMin * 10 ^ (i/D)), where D is Number ofBins Per Decade. binX and binY are calculated accordingly:  binX = ( log10(Interval_I) – log10(MinInterval) )* NumBinsPerDecade  

Reference For discussion on using logarithm of interspike intervals, see: Alan D. Dorval, Probability distributions of the logarithm of inter-spike intervals yield accurate entropyestimates from small datasets. Journal of Neuroscience Methods 173 (2008) 129–139

Page 164

Page 167: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.36. Autocorrelograms Versus Time This analysis shows the dynamics of the autocorrelograms over time. It calculates multipleautocorrelograms using a "sliding window" in time. Each autocorrelogram is shown as a vertical stripewith colors representing the bin counts. Horizontal axis represents the position of the sliding window intime.

Parameters

Parameter Description

XMin AutoCorr Autocorrelogram time axis minimum in seconds.

XMax AutoCorr Autocorrelogram time axis maximum in seconds.

Bin AutoCorr Autocorrelogram bin size in seconds.

Normalization Histogram units (Counts/Bin, Probability or Spikes/Second). See Algorithmbelow.

Start Start of the first sliding window in seconds.

Duration Duration of the sliding window in seconds.

Shift How much sliding window is shifted each time.

Number of shifts The number of sliding windows to be used.

Matrix Scale Specifies color scale for drawing matrix.

X Axis (Sliding windowaxis alignment)

Allows to specify what values are shown in the sliding window axis. There aretwo options: Start of Window and Center of Window.  Suppose your data has the strongest correlation at 50 seconds. This meansthat the window that has 50 seconds as its center will show the highestautocorrelation values. If the window width is 20 seconds, it will be thewindow [40,60]. If you are using 'Start of window' option, you will see thepeak at 40 instead of 50 seconds. However, with 'Center of window' option,the peak will be at 50 seconds.

Smooth Option to smooth the histogram after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Page 165

Page 168: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Y axis minimum.

YMax Y axis maximum.

Color Scale Min Color scale minimum.

Color Scale Max Color scale maximum.

Spikes Number of spikes used.

Algorithm NeuroExplorer calculates here multiple autocorrelograms (see Autocorrelograms for more information on

how each autocorrelogram is calculated). Each autocorrelogram is calculated for a different interval

(window) in time: [window_start[i], window_end[i]], i = 1,..., Number of Shifts. That is, for each autocorrelogram only the timestamps that are within the window are used. The following rules are used to calculate the windows: window_start[1] = Start window_end[1] = Start + Duration window_start[2] = Start + Shift window_end[2] = Start + Shift + Duration ...

Page 166

Page 169: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.37. Perievent Rasters for Continuous This analysis shows the traces of the selected continuous variable relative to the timestamps of thereference variable.

Parameters

Parameter Description

Reference Specifies a reference neuron or event.

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds

Use last ref. event An option to draw the trace only for the last reference event.

Round ref. timestamp An option to align reference event timestamps to the timestamps of thecontinuous variable. This option is valid only if XMin <0 and XMax >0.

Draw Variation An option to draw variation around the mean as a colored background.

Variation (standarddeviations)

Number of standard deviations in the colored background around the mean.

Variation BackgroundColor

The color to be used for drawing of the colored background around the mean.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results

Page 167

Page 170: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Reference Reference variable name.

NumRefEvents The number of reference events used in calculation.

YMin Minimum of the average trace shown at the bottom.

YMax Minimum of the average trace shown at the bottom.

Algorithm Let ref[i] be the array of timestamps of the reference event. For each timestamp ref[k], NeuroExplorer draws the values of continuous variable with timestamps fromref[k] + XMin to ref[k] + XMax. The timestamps of the continuous variables are shown as relative to theref[k]: if the timestamp of continuous variable data point is cont_ts[i], the timestamp shown in NumericalResults is relative_ts[i] = cont_ts[i] - ref[k]. If Round ref. timestamp option is used, NeuroExplorer shifts the relative timestamps of the continuousvariable. For example, if round to previous timestamp option is used, the program finds the lasttimestamp cont_ts[j] of the continuous variable before ref[k]. Then, the program adjusts the relativetimestamps of the continuous variable so that relative_ts_adjusted[j] = ref[k] If diff = ref[k] - cont_ts[j] then relative_ts_adjusted[i] = relative_ts[i] + diff. Mean values of the perievent raster shown at the bottom graph are calculated using linear interpolation.

Page 168

Page 171: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.38. Power Spectra for Continuous This analysis captures the frequency content of continuous variables.

Parameters

Parameter Description

Number of Fr. Values Number of values in the spectrum.

Window Overlap (%) Window (segment) overlap in percent (from 0 to 90).

Window Preprocessing Preprocessing to be done for each window before calculating the spectrum ofthe window.

Windowing Function Windowing Function to be applied to each window before calculating thespectrum of the window.

Discard IncompleteWindows

Option to discard the last window if it contains less than the expected numberof data points (less than NumberOfFrValues*2 points).

Concatenate SelectedData Points

If this option is selected, data points that are selected for analysis (that is,points inside time interval filter) are concatenated and then the PSD of theconcatenated signal is calculated. This means that the signal from twoadjacent time intervals can be in the same data segment used to calculateFFT. If this option is not selected and interval filter is specified, datasegments used to calculate FFT (see Algorithm below) are guaranteed tocontain data points from one interval of the interval filter. For each timeinterval, the first data segment in the interval is aligned with the interval start.

Use Multitaper Algorithm Option to use multi-taper algorithm.

Time-Bandwidth Product Time-Bandwidth Product when using multi-taper algorithm.

Number of Tapers Number of Tapers when using multi-taper algorithm.

Show Frequency From Minimum frequency to be shown in the spectrum graph.

Show Frequency To Maximum frequency to be shown in the spectrum graph.

Normalization Spectrum normalization. See Algorithm below.

Frequency Bands Percent of spectrum values and the sum of spectrum values will becalculated for each of the specified frequency bands. If Log of PSDNormalization is specified, band percents will be calculated BEFOREapplying log() transform.

Log Frequency Scale An option show Log10 frequency scale.

Smooth Option to smooth the spectrum after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Page 169

Page 172: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Add Freq. Values toResults

An option to add an additional vector of frequency values to the matrix ofnumerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

   

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Spectrum minimum.

YMax Spectrum maximum.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Number of FFT windows Number of FFT windows used in analysis.

Frequency of Minimum The position of the minimum of the displayed spectrum (in Hz). If there aremultiple bins in the spectrum where the spectrum value is equal to thespectrum minimum, this value represents the frequency of the first such bin. If you need to calculate spectrum peaks, go to Post-processing tab, pressPost-processing Script Options button and select PostAnalysis_Peaks.py

Frequency of Maximum The position of the maximum of the displayed spectrum (in Hz). If there aremultiple bins in the spectrum where the spectrum value is equal to thespectrum maximum, this value represents the frequency of the first such bin. If you need to calculate spectrum peaks, go to Post-processing tab, pressPost-processing Script Options button and select PostAnalysis_Peaks.py

 

Page 170

Page 173: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Algorithm For each selected continuous variable, a standard or multi-taper power spectrum is calculated. In each case, a Welsh periodogram method is used: The original data array is split up into data segments (or windows) of length 2*Nf (where Nf is theNumber of Frequency Values), overlapping by D points. If overlap is 50%, then D is (2*Nf)/2=Nf. For each segment, the signal is preprocessed according to Window Preprocessing parameter. Forexample, if Subtract Mean is selected, ProcessedSignal[i] = Signal[i] - meanOfSignalInSegment. The overlapping segments are then windowed: after the data is split up into overlapping segments, theindividual data segments have a window applied to them (that is, ProcessedWindowedSignal[i] =ProcessedSignal[i]*WindowValue[i]; the window is specified by the Windowing Function). Most window functions afford more influence to the data at the center of the segment than to data at theedges, which represents a loss of information. To mitigate that loss, the individual data segments arecommonly overlapped in time (as in the above step). After doing the above, the periodogram is calculated by computing the discrete Fourier transform, andthen computing the squared magnitude of the result. The individual periodograms are then time-averaged, which reduces the variance of the individual power measurements. The end result is an arrayof power measurements vs. frequency "bin". For multi-taper spectral estimate, several periodograms (tapers) are calculated for each segment. Eachtaper is calculated by applying a specially designed windowing function (Slepian function, see

http://en.wikipedia.org/wiki/Multitaper ). All the tapers for a given segment are then averaged to form the

periodogram of the segment. The individual segment periodograms are then time-averaged. See  http://www.spectraworks.com/Help/mtmtheory.html for a discussion on selecting Multi-Taper

parameters. Normalization If Normalization is Raw PSD (Numerical Recipes), the power spectrum is normalized so that the sum ofall the spectrum values is equal to the mean squared value of the rate histogram. The formulas (13.4.10)of Numerical Recipes in C are used (squared fft values are divided by N^2 where N is the number ofvalues in data window). (Numerical Recipes in C, Press, Flannery, et al. (Cambridge University Press,1992)). The units are signal_units^2 (mV^2 in NeuroExplorer). If Normalization is % of Total PSD (Numerical Recipes), the power spectrum is normalized so that thesum of all the spectrum values equals 100. If Normalization is Log of PSD (Numerical Recipes), the power spectrum is calculated using the formula: power_spectrum[i] = 10.*log10(raw_spectrum[i]) where raw_spectrum is calculated as described above in Raw PSD (Numerical Recipes). If Normalization is Raw PSD (Matlab), the power spectrum is normalized as described in

http://www.mathworks.com/help/signal/ug/psd-estimate-using-fft.html (squared fft values are divided by

Fs*N, where Fs is sampling rate, N is the number of values in window, see Matlab code below). The units

are signal_units^2/Hz (mV^2/Hz in NeuroExplorer). If Normalization is Log of PSD (Matlab), the power spectrum is calculated using the formula: power_spectrum[i] = 10.*log10(raw_spectrum_matlab[i])

Page 171

Page 174: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

where raw_spectrum_matlab is calculated as described above in Raw PSD (Matlab). The units aredB/Hz. In Matlab: Fs = 1000;t = 0:1/Fs:1-1/Fs;x = cos(2*pi*100*t) + randn(size(t));xdft = fft(x);N = length(x);xdft = xdft(1:N/2+1); % psdx below corresponds to Raw PSD (Matlab) normalization% the units are signal_units^2/Hz (mV^2/Hz in NeuroExplorer)% note that we divide squared fft by (Fs*N) psdx = (1/(Fs*N)) * abs(xdft).^2;psdx(2:end-1) = 2*psdx(2:end-1); % psdDb below corresponds to Log of Raw PSD (Matlab) normalization psdDb = 10*log10(psdx) freq = 0:Fs/length(x):Fs/2; plot(freq,psDb)title('Periodogram Using FFT')xlabel('Frequency (Hz)')ylabel('Power/Frequency (dB/Hz)') Here is how you can verify that calculations in NeuroExplorer produce the same values as spectrumcalculations in Matlab: - Open the file TestDataFile5.nex - Deselect all neuronal variables - Select ContChannel01 variable - Select Matlab | Send Selected Variables to Matlab menu command - Select Power Spectra for Continuous analysis - Specify the following parameters:

Page 172

Page 175: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

- Make sure that Add columns(s) with frequency values option is disabled in Post-Processing tab ofAnalysis Properties dialog - Run the analysis - Select Matlab | Send Numerical Results to Matlab menu command - In Matlab, execute: p=pwelch(ContChannel01(:,1), hann(256), 128, 256, 10000); maxDiff = max(abs(p-nex(:,1))) - You will see the following result: 1.3500e-13 This means that at least the first 11 decimal places of the PSD values calculated in NeuroExplorer and inMatlab are identical.

Page 173

Page 176: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.39. Coherence for Continuous Coherence is a measure of the degree of relationship, as a function of frequency, between two timeseries.

Parameters

Parameter Description

Reference Specifies a reference variable.

Number of Fr. Values Number of values in the spectrum.

Window Overlap (%) Window overlap in percent (from 0 to 90).

Window Preprocessing Preprocessing to be done for each window before calculating the spectrum ofthe window.

Windowing Function Windowing Function to be applied to each window before calculating thespectrum of the window.

Discard IncompleteWindows

Option to discard the last window if it contains less than the expected numberof data points (less than NumberOfFrValues*2 points).

Use Multitaper Algorithm Option to use multi-taper algorithm.

Time-Bandwidth Product Time-Bandwidth Product when using multi-taper algorithm.

Number of Tapers Number of Tapers when using multi-taper algorithm.

Show Freq. From An option to show a subset of frequencies. Specifies minimum frequency tobe displayed.

Show Freq. To An option to show a subset of frequencies. Specifies maximum frequency tobe displayed.

Calculate Specifies whether coherence values or coherence phases are calculated.

Confidence Level (%) Confidence level (percent) for the coherence values. Can only be calculated ifa single-taper algorithm is used. See Confidence Level Calculation below fordetails.

Draw confidence level An option to draw the confidence level. Confidence level is not drawn ifcoherence phases are specified in Calculate parameter or if a multi-taperalgorithm is used.

Conf. line style Line style for drawing confidence level.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Add to Results / Bin left An option to add an additional vector (containing a left edge of eachfrequency bin) to the matrix of numerical results.

Page 174

Page 177: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Add to Results / Binmiddle

An option to add an additional vector (containing a center of each frequencybin) to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of eachfrequency bin) to the matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Y Min Y axis minimum.

Y Max Y axis maximum.

Filter Length The length of the interval filter.

Confidence Level Confidence level for the coherence values.

Algorithm The FFTs of variable values (after specified preprocessing and applying the specified tapering window)are calculated. Then, individual and cross-densities are calculated: Pxx = FFT(X)*Conj(FFT(X)), Pyy = FFT(Y)*Conj(FFT(Y)) Pxy = FFT(X)*Conj(FFT(Y)). Here Conj(z) is a complex conjugate of z. Pxx, Pyy and Pxy values are averaged across all intervals andcoherence values are calculated as Mean(Pxy)*Mean(Pxy) / (Mean(Pxx)*Mean(Pyy)). Coherence phase values are calculated as phase of Mean(Pxy).    

Page 175

Page 178: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Calculation of the Confidence Level Confidence levels can only be calculated if a single-taper algorithm is used. Confidence levels are calculated as described in Kattla and Lowery (2010). The confidence level Z iscalculated as Z = 1 - pow(alpha, 1/(w*L - 1)) where pow(x,y) returns x to the power of y, alpha = 1 - Confidence_Level*0.01, L is the number of overlapped windows w is the correction due to the Hanning window tapering (see eq. (5) and (6) in Kattla and Lowery (2010)).   Reference Kattla S, Lowery MM. Fatigue related changes in electromyographic coherence between synergistic handmuscles. Exp Brain Res. 2010 Apr; 202(1):89-99. Epub 2009 Dec 12.

Page 176

Page 179: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.40. Analysis of Head Direction Cells This analysis estimates the frequency of neuronal firing as a function of a head direction of an animal.The head direction should be described by two pairs of continuously recorded variables (head base Xand Y and nose X and Y).

Parameters

Parameter Description

Head Base X Position Continuous variable that describes X position of the head base of the animal.

Head Base Y Position Continuous variable that describes Y position of the head base of the animal.

Nose X Position Continuous variable that describes X position of the nose of the animal.

Nose Y Position Continuous variable that describes Y position of the nose of the animal.

Bad Position Value When LED is obscured by the wires, both position variables may suddenlyjump to 0 and then jump back to the previous position. All the data pointswhere BaseX, BaseY, NoseX or NoseY is equal to Bad Bad Position Valueare ignored.

Min Distance betweenLEDs

All the data points where the distance between base and nose LEDs issmaller than this value are ignored.

Direction Bin (degrees) Head direction is measured in degrees (from 0 to 360). This parameterrepresents the size of the head direction bin in degrees.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results

Page 177

Page 180: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Histogram minimum.

YMax Histogram maximum.

Mean Hist. The mean of the histogram bin values.

St. Dev. Hist. The standard deviation of the histogram bin values.

Algorithm NeuroExplorer will ignore position points that have coordinates that are within 0.001 of the specified 'bad'X and X values. For all valid data points, head directions are calculated. Then, intervals in time are calculated where headdirection is in one of the direction bins. Then, we calculate the number of of spikes in all the intervalswhere head direction was in a specific bin (for example, from 0 to 10 degrees). The number of spike isthen divided by the duration of the intervals for this bin to get the firing rate at the bin's head direction.

Page 178

Page 181: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.41. Single Trial Spectrum Analysis This analysis captures the frequency content of continuous variables for a single trial.

Parameters

Parameter Description

Reference Specifies a reference neuron or event.

XMin Time window minimum in seconds.

XMax Time window maximum in seconds

Ref. Timestamp Number Reference timestamp number.

Number of Fr. Values Number of values in the spectrum.

Window Overlap (%) Window overlap in percent (from 0 to 90).

Window Preprocessing Preprocessing to be done for each window before calculating the spectrum ofthe window.

Windowing Function Windowing Function to be applied to each window before calculating thespectrum of the window.

Discard IncompleteWindows

Option to discard the last window if it contains less than the expected numberof data points (less than NumberOfFrValues*2 points).

Use Multitaper Algorithm Option to use multi-taper algorithm.

Time-Bandwidth Product Time-Bandwidth Product when using multi-taper algorithm.

Number of Tapers Number of Tapers when using multi-taper algorithm.

Show Frequency From Minimum frequency to be shown in the spectrum graph.

Show Frequency To Maximum frequency to be shown in the spectrum graph.

Normalization Spectrum normalization. See Algorithm below.

Log Frequency Scale An option show Log10 frequency scale.

Smooth Option to smooth the spectrum after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Add Freq. Values toResults

An option to add an additional vector of frequency values to the matrix ofnumerical results.

Page 179

Page 182: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

   

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Spectrum minimum.

YMax Spectrum maximum.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Number of FFT windows Number of FFT windows used in analysis.

Frequency of Minimum The position of the minimum of the displayed spectrum (in Hz). If there aremultiple bins in the spectrum where the spectrum value is equal to thespectrum minimum, this value represents the frequency of the first such bin.

Frequency of Maximum The position of the maximum of the displayed spectrum (in Hz). If there aremultiple bins in the spectrum where the spectrum value is equal to thespectrum maximum, this value represents the frequency of the first such bin.

 

Algorithm For each selected continuous variable, a standard or multi-taper power spectrum is calculated.   Normalization If Normalization is Raw PSD, the power spectrum is normalized so that the sum of all the spectrumvalues is equal to the mean squared value of the rate histogram. If Normalization is % of Total PSD, the power spectrum is normalized so that the sum of all thespectrum values equals 100.

Page 180

Page 183: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

If Normalization is Log of PSD, the power spectrum is calculated using the formula: power_spectrum[i] = 10.*log10(raw_spectrum[i])

Page 181

Page 184: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.42. Phase Analysis via Hilbert Transform This analysis graphs amplitude and phase of a continuous signal in a single trial.

Parameters

Parameter Description

Reference Specifies a reference neuron or event.

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds

Ref. Timestamp Number Reference timestamp number.

Bandpass Filter From(Hz)

Minimum frequency for the bandpass filter.

Bandpass Filter To (Hz) Maximum frequency for the bandpass filter.

Bandpass Filter Type The type of the bandpass filter.

FIR Filter Order The order of the bandpass filter.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Graph minimum.

YMax Graph maximum.

Algorithm The signal for the specified trial is bandpass filtered and the analytic signal of the result is calculated viaHilbert transform.

Page 182

Page 185: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

The original signal is drawn in light gray, the filtered signal is drawn in dark gray, the amplitude of thefiltered signal is drawn in green and the phase is drawn in red.

Page 183

Page 186: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.43. Waveform Comparison This analysis displays means and standard deviations of waveform variables in specified time intervals.This analysis can also display waveforms in the Principal Component space.

Parameters

Parameter Description

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

What to Draw Specifies graphics output (means and standard deviations of waveforms orprojections in the Principal Component space).

Draw Variation An option to draw waveform variation as a colored background.

Variation (standarddeviations)

Number of standard deviations in the colored background around waveformmean.

Variation BackgroundColor

The color to be used for drawing of the colored background around waveformmean.

PC X Axis Which principal component to use for X axis for the Principal Componentprojections display.

PC Y Axis Which principal component to use for Y axis for the Principal Componentprojections display.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Y Axis minimum.

YMax Y Axis maximum.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Waveform Min Minimum of the mean waveform.

Mean Waveform Max Maximum of the mean waveform.

Algorithm

Page 184

Page 187: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

The program selects waveforms in the specified time range and the interval filter(s) and calculates themean and the standard deviation of the selected waveforms. Principal components are calculated from all the waveforms of the given waveform variable. First, the matrix of correlations between waveform points ( c[t, s] ) is calculated: c[t, s] = correlation between vectors waveform_value[t, *] and waveform_value[s,*], s, t = 1, ..., number ofpoints in each waveform. Then, the eigenvalues and eigenvectors are calculated for the matrix c[t, s]. The eigenvectors (principalcomponents) are sorted according to their eigenvalues. The first principal component has the largesteigenvalue. PCA projection display shows scatter plots where x and y are projections of a waveform to the specifiedprincipal components (projection is a sum of products waveform_value[t]*principal_component_value[t] ).

Page 185

Page 188: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.44. Hazard Analysis This analysis calculates a hazard function -- the conditional probability of a spike at time t0+t on thecondition that there is a spike at time t0 and there are no spikes in the interval [t0, t0+t).

Parameters

Parameter Description

Max IIH Interval (sec) Maximum interspike interval used in calculation of interspike intervalhistogram (see Algorithm below).

Hazard Time Max (sec) Time axis maximum in seconds. This parameter is expected to be smallerthan Max IIH Interval (sec). See Algorithm below.

Bin Bin size in seconds.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Int. filter type Specifies if the analysis will use a single or multiple interval filters.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Create filter on-the-fly Specifies if a temporary interval filter needs to be created (and used topreselect data).

Create filter around Specifies an event that will be used to create a temporary filter.

Start offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the start of interval for the temporary filter.

End offset Offset (in seconds, relative to the event specified in Create filter aroundparameter) for the end of interval for the temporary filter.

Fix overlaps An option to automatically merge the overlapping intervals in the temporaryfilter.

Overlay Graphs An option to draw several histograms in each graph. This option requires thatInt. filter type specifies that multiple interval filters will be used (either Table(row) or Table (col)).

Smooth Option to smooth the histogram after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Add to Results / Bin left An option to add an additional vector (containing a left edge of each bin) tothe matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a middle point of each bin)to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of each bin) to

Page 186

Page 189: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

the matrix of numerical results.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Hazard minimum.

YMax Hazard maximum.

Spikes The number of spikes used in calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

Mean Freq. Mean firing rate (Spikes/Filter_Length).

Mean Hazard. The mean of the hazard values.

Algorithm First, the program calculates the interspike interval histogram using interspike intervals that are less thanMax IIH Interval. The hazard function is then calculated according to the following formula (N.Sabatier, et.al., Phasic spikepatterning in rat supraoptic neurones in vivo and in vitro, J. Physiol. 558.1 (2004) pp 161-180): (hazard in bin [t, t+dt]) = (number of intervals in bin [t,t+dt])/(number of intervals of length > t) where dt is the bin size. Hazard Time Max (which specifies the last bin of the hazard function) is expected to be smaller thanMax IIH Interval. If Hazard Time Max = Max IIH Interval, the hazard value for the last bin is always 1.Then the maximum of Y axis is set to 1 and smaller hazard values are scaled down. We want to avoidthis.

Page 187

Page 190: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.45. Perievent Firing Rates This analysis is similar to Perievent Histograms, but instead of counting numbers of spikes in bins, thisanalysis uses method based on convolution of a spike train with a fixed kernel function.

[Figure provided by Dr. Maureen McCall, University of Louisville School of Medicine]

Parameters

Parameter Description

Reference Specifies a reference neuron or event.

XMin Time axis minimum in seconds.

XMax Time axis maximum in seconds

Kernel Type The type of kernel to be used (Boxcar, Triangle, Gaussian or Exponential)

Kernel Width (sec) Kernel width in seconds

Draw Variation An option to draw variation of firing across reference events as a coloredbackground.

Variation (st. err. mean) Number of standard errors of mean in the colored background around firingrate mean.

Variation BackgroundColor

The color to be used for drawing of the colored background around firing ratemean.

Draw Mean andStandard Error of Mean

An option to draw expected mean firing rate and plus/minus Variation *S.E.M.

Calculate ResponseStatistics

An option to calculate response statistics.

Spontaneous ActivityInterval Filter

The interval variable used to calculate spontaneous activity mean and S.E.M.

Peak Time Frame Start(seconds)

The start of the time interval (relative to reference) used to calculate peakfiring rate.

Page 188

Page 191: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Peak Time Frame End(seconds)

The end of the time interval (relative to reference) used to calculate peakfiring rate.

Maintained Firing RateTime Frame Start(seconds)

The start of the time interval (relative to reference) used to calculatemaintained firing rate.

Maintained Firing RateTime Frame End(seconds)

The end of the time interval (relative to reference) used to calculatemaintained firing rate.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

XMin Time axis minimum.

XMax Time axis maximum.

YMin Y axis minimum.

YMax Y axis maximum.

FiringRateMin Firing rate minimum.

FiringRateMax Firing rate maximum.

NumRefEvents The number of reference events used in calculation.

Page 189

Page 192: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

NumSpikes The number of spikes used in calculation.

Filter Length The length of all the intervals of the interval filter (if a filter was used) or thelength or the recording session (in seconds).

ResponsePresent 1 if firing rate exceeded SpontaneuousMean + Variation*S.E.M.

PeakRate Peak firing rate (max. of firing rate in Peak Time Frame).

PeakPosition Peak firing rate position in seconds.

MaintainedRate Mean firing rate in Maintained Time Frame.

ResponseDuration Response duration in seconds.

SupressionStart Suppression start time in seconds.

SupressionEnd Suppression end time in seconds.

Algorithm The firing rate is estimated using convolution of a spike train with a fixed kernel function: FiringRate(t) = sum of K(t-t[i]), where K(t) is a kernel function, t[i] are spike occurrence times. The following kernel functions are used Boxcar(t) = 1/(2*sqrt(3)*w), t in interval [-sqrt(3)*w, sqrt(3)*w] Triangle(t) = (sqrt(6)*w - abs(t))/(6*w*w), t in interval [-sqrt(6)*w, sqrt(6)*w] Gaussian(t) = exp(-t*t/(2*w*w))/(sqrt(2*PI)*w), t in interval [-5*w, 5*w] Exponential(t) = exp(-sqrt(2)*abs(t)/w/(sqrt(2)*w), t in interval [-5*w, 5*w] w is a kernel width parameter (square root of the integral of t square times kernel equals w). It isspecified as Kernel Width analysis parameter.   For each reference event at time Ref[k], FiringRate(t) is calculated for the spikes within time interval [Ref[k]+ XMin, Ref[k]+ XMax ] The average firing rate across all reference event is then calculated and displayed.   To calculate response statistics, spontaneous mean and standard error of mean (S.E.M) are calculated: For each interval in interval variable (specified in Spontaneous Activity Interval Filter), the mean firingrate is calculated. Spontaneous mean is the average of mean rates over all the intervals. S.E.M. is thestandard error of mean over all the intervals. If perievent firing rate exceeded SpontaneuousMean + Variation*S.E.M, ResponsePresent is set to to 1. ResponseDuration is the time when perievent firing rate drops below SpontaneuousMean. SupressionStart is the time when perievent firing rate drops below SpontaneuousMean -Variation*S.E.M. SupressionEnd is the time when perievent firing rate returns to SpontaneuousMean. SuppressionRate is the minimum firing rate in the interval [SupressionStart, SupressionEnd]

Page 190

Page 193: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

References Nawrot, Martin, Ad Aertsen, and Stefan Rotter. Single-trial estimation of neuronal firing rates: from single-neuron spike trains to population activity. Journal of neuroscience methods 94.1 (1999): 81-92. Shigeru Shinomoto. Estimating the Firing Rate. Analysis of Parallel Spike Trains. Springer Series inComputational Neuroscience, Volume 7, 2010, pp 21-35

Page 191

Page 194: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.46. Find Oscillations This analysis identifies episodes of oscillatory activity in the specified frequency band in recorded analogsignals.

Parameters

Parameter Description

XMin (sec) Analysis is run on the data from a specific time range [XMin, XMax]. XMinspecifies time range minimum in seconds.

XMax (sec) Analysis is run on the data from a specific time range [XMin, XMax]. XMaxspecifies time range maximum in seconds.

Window Width (sec) Frequency power ratios are calculated in consecutive time windows. Thisparameter specifies the width of each window in seconds.

Use Custom WindowShift

By default (if Use Custom Window Shift is not checked), window shift isequal to Window Width (sec) (so the analysis is done over consecutive non-overlapping windows). If Use Custom Window Shift option is selected, theshift is specified by Window Shift (sec) parameter.

Window Shift (sec) If Use Custom Window Shift is not checked, window shift is equal toWindow Width (sec) and this parameter is ignored. If Use Custom WindowShift option is selected, the shift is specified by Window Shift (sec)parameter.

Main Band Min Freq(Hz)

Specifies minimum of the main frequency band in Hz (for example, 3 Hz fortheta band).

Main Band Max Freq(Hz)

Specifies maximum of the main frequency band in Hz (for example, 6 Hz fortheta band).

Method Specifies what method to use to identify periods with oscillations. There aretwo method options: Use Ratio to Other Band or Use Percent of MainBand.

Second Band Min Freq(Hz)

Specifies minimum of the second frequency band in Hz (for example, 2 Hz fordelta band). If Method is Use Percent of Main Band, this parameter isignored.

Second Band Max Freq(Hz)

Specifies maximum of the second frequency band in Hz (for example, 3 Hzfor delta band). If Method is Use Percent of Main Band, this parameter isignored.

Min Power Ratio Ratio of the power of the main frequency to the power of the secondfrequency must exceed this value. If Method is Use Percent of Main Band,this parameter is ignored.

Min Percent Percent of spectrum energy of the main band must exceed this value. IfMethod is Use Ratio to Other Band, this parameter is ignored.

Min Number of Windows If Method is Use Ratio to Other Band, the Ratio must exceed Min PowerRatio in a number of consecutive windows. This parameter specifiesminimum number of consecutive windows. If Method is Use Percent of Main Band, the Percent of spectrum energy ofthe main band must exceed Min Percent in a number of consecutivewindows. This parameter specifies minimum number of consecutive windows.

Page 192

Page 195: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Filter Type The type of the frequency filter.

Filter Order The order of the frequency filter.

Result Prefix The prefix for generating names of the results. For example, if we analyzevariable LFP and the prefix is Theta, the results will have namesLFP_Theta_Epochs, LFP_Theta_Filtered and LFP_Theta_ZeroPhase.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Analysis Results This analysis adds several new variables to the data file. For example, if we analyze continuous variableLFP and the Result Prefix is Theta, this analysis will add the following new variables to the file: - LFP_Theta_Epochs (interval variable that specifies beginning and end of each oscillatory episode) - LFP_Theta_ZeroPhase (event variable containing timestamps of the starts of the oscillation cycles) - LFP_Theta_Filtered (continuous variable containing band-filtered LFP) Variables LFP_Theta_ZeroPhase and LFP_Theta_Epochs can then be used in Firing Phase analysis. Graphical results display the values of energy for each band (red line for main band energy and greenline for the second band energy) as well as the values of power ratio (black line). Y axis shows the scale for the band energy values. The scale for the power ratio is shown as a verticalline in the upper-right corner of the graph:

Page 193

Page 196: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

The gray background areas show the identified epochs of oscillatory activity.

Algorithm For each window, the spectrum of the signal in this window is calculated. If Method is Use Ratio to Other Band: - The power of each band is calculated as an average spectrum value for the frequencies in the band. - If Min Power Ratio is 4 and Min Number of Windows is 3, a ratio greater than 4 in at least 3 consecutivewindows is identified as a start of an oscillatory epoch. The subsequent windows are added to the epochif the band power ratio for each window is greater than 4. If Method is Use Percent of Main Band: - The percent or spectrum values in the Main Band is calculated. - If Min Percent is 2 and Min Number of Windows is 3, a percent of main band greater than 2 in at least 3consecutive windows is identified as a start of an oscillatory epoch. The subsequent windows are addedto the epoch if the percent of the main band for each window is greater than 2.   After the oscillatory epochs are identified, the continuous variable is band-filtered within these epochs(with filter band specified as [Main Band Min Freq, Main Band Max Freq]). Hilbert transform is thenapplied to the filtered signal. The jumps of the phase of the Hilbert transform from 360 degrees to zeroare identified as starts of the oscillation cycles.

References Klausberger et al. Brain-state- and cell-type-specific firing of hippocampal interneurons in vivo. Nature.2003 Feb 20;421(6925):844-8

Page 194

Page 197: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.47. Firing Phase This analysis determines phase relationships between single cell and continuous signal activity.

Parameters

Parameter Description

Zero Phase Event Specifies an event variable containing timestamps of the starts of theoscillation cycles. Usually, this variable is created by running Find Oscillations analysis.

Oscillation Epochs Specifies an interval variable that specifies beginning and end of eachoscillatory episode. Usually, this variable is created by running Find

Oscillations analysis.

Number of Phase Bins Number of bins in [0,360] degrees phase range.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Smooth Option to smooth the result after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Page 195

Page 198: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

YMin Y axis minimum.

YMax Y axis maximum.

NumSpikes The number of spikes used in calculation.

CyclesUsed The number of oscillation cycles used in calculation.

Algorithm For each interval of the Oscillation Epochs variable: - Timestamps of Zero Phase Event in this interval are selected - For each oscillation cycle (a pair of selected Zero Phase Event timestamps (zero_phase[i],zero_phase[i+1]): - Spikes in the oscillation cycle [zero_phase[i], zero_phase[i+1]) are selected - For each selected spike, spike phase is calculated as 360*(spike_time - zero_phase[i)/(zero_phase[i+1] - zero_phase[i])   A histogram of spike phases is calculated. Histogram bin counts are divided by the number of spikes inall oscillation cycles.  

References Klausberger et al. Brain-state- and cell-type-specific firing of hippocampal interneurons in vivo. Nature.2003 Feb 20;421(6925):844-8

Page 196

Page 199: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.48. Detect Spikes This analysis optionally subtracts reference channel, band-pass filters continuous variables and detectsspikes using threshold crossing algorithm. Detected spikes are added to current data file as newwaveform variables.

Parameters

Parameter Description

Subtract Reference An option to subtract reference channel before filtering and spike detection.

Reference Channel Reference Channel to subtract before filtering and spike detection.

Filter Before Detection An option to band-pass filter continuous variables (using Butterworth filter)before spike detection.

Filter Order The Butterworth filter order.

Filter Frequency From Minimum frequency (Hz) of the band-pass filter.

Filter Frequency To Maximum frequency (Hz) of the band-pass filter.

Threshold type An option specifying how the threshold is calculated (see Algorithm below).

Custom Threshold Threshold value or number of standard deviations (can be negative, seeAlgorithm below).

Threshold CrossingType

Type of threshold crossing to use. Auto (if threshold is nonnegative, detect aspike when the signal crosses the threshold when signal is going up, ifthreshold is negative, detect a spike when the signal crosses the thresholdwhen signal is going down); Up (detect a spike when the signal crosses thethreshold when signal is going up); Down (detect a spike when the signalcrosses the threshold when signal is going down).

Segment BeforeThreshold (mS)

Signal segment before threshold to include into spike waveform.

Segment AfterThreshold (mS)

Signal segment after threshold to include into spike waveform.

Minimum Time BetweenSpikes

Minimum time between spikes.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

 

Summary of Numerical Results

Page 197

Page 200: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

YMin Y axis minimum.

YMax Y axis maximum.

Threshold The threshold value used to detect spikes (in mV).

Spikes Detected The number of spikes detected.  

Algorithm The standard deviation of the signal (SD) and the median of the signal absolute values (MA) arecalculated. 'Median Sigma' (MS) is equal to MA/0.6745 (see eq. 3.1 in Reference). If threshold type is Auto, the threshold is equal to -4.0*MS (see eq. 3.1 in Reference). If threshold type is Number of Median Sigma, the threshold is equal to Custom_Threshold*MS. If threshold type is Number of Standard Deviations, the threshold is equal to Custom_Threshold*SD. If threshold type is Absolute, the threshold is equal to Custom_Threshold. The spike is detected if the signal crosses the threshold when signal is going up or down (depending onthe value of the Threshold Crossing Type parameter).

Reference Neural Comput. 2004 Aug;16(8):1661-87. Unsupervised spike detection and sorting with wavelets andsuperparamagnetic clustering. Quiroga R, Nadasdy Z, Ben-Shaul Y.

Page 198

Page 201: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.49. Python-based Analysis This analysis uses a Python script to calculate analysis results.

Parameters

Parameter Description

Script Path Python script path.

Script Parameters asJSON

Script Parameters as JSON string.

Select Data If Select Data is From Time Range, only the data from the specified (bySelect Data From and Select Data To parameters) time range will be used inanalysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter(s) that will be used to preselect data beforeanalysis. See also Data Selection Options.

Algorithm For each selected data variable, NeuroExplorer will execute the specified Python script. The script can specify script parameters in the comment lines at the top of the script file. Use doc.GetPythonAnalysisInput() to get information about the current data variable and to get thevalues of analysis parameters. Use doc.SetPythonAnalysisOutput() to specify numerical results of the analysis as JSON string. The results object should be a dictionary with 'XValues' and 'YValues' properties containing Python listsof numeric values (see lines with result['XValues'] and result['YValues'] in the script below). Here is a script that calculates a DFT-based spectrum for a specified Continuous variable:   #Description: calculates the spectrum of the selected signal RANGE via DFTs# Range selection is done using Select Data, From, To in Data Selection tab# Assumes that less than 100,000 data points are selected.#Parameter:name=Show Frequency From;default=0#Parameter:name=Show Frequency To;default=100000import neximport jsonimport math # helper function to select data from specified time rangedef IntervalFilterVarIfNeeded( doc, var, pars ): selData = pars['Select Data'] theFilter = pars['Interval Filter'] if selData == 'All' and theFilter == 'None': # no need to filter return var mainFrom = 0.0

Page 199

Page 202: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

mainTo = nex.GetDocEndTime(doc) if selData == 'From Time Range': mainFrom = float(pars['Select Data From (sec)']) mainTo = float(pars['Select Data To (sec)']) tempInt = nex.NewIntEvent(doc, 0) nex.AddInterval(tempInt, mainFrom, mainTo) if theFilter == 'None': return nex.IntervalFilter(var, tempInt) else: tempInt1 = nex.IntAnd(tempInt, doc[theFilter]) return nex.IntervalFilter(var, tempInt1) # main calculate function of the script# called in the last line of the script below def Calculate(): doc = nex.GetActiveDocument() # get the variable info and values of script parameters inputJson = doc.GetPythonAnalysisInput() inputPars = json.loads(inputJson) # get all analysis parameters (we need to get data selection options) parsJson = doc.GetAllAnalysisParameters() pars = json.loads(parsJson) variable = inputPars['Variable'] if variable['Type'] != 'Continuous': raise ValueError('This analysis can only analyze Continuous variables') filteredVar = IntervalFilterVarIfNeeded(doc, doc[variable['Name']], pars) v = filteredVar.ContinuousValues() numberOfContValues = len(v) if numberOfContValues > 100000: raise ValueError('Too many Continuous values') freqFrom = float(inputPars['ScriptParameters']['Show Frequency From']) freqTo = float(inputPars['ScriptParameters']['Show Frequency To']) samplingRate = float(variable['SamplingRate']) spectrumStep = samplingRate/numberOfContValues spectrum = nex.Spectrum(v) s = sum(spectrum) result = {} result['XAxisLabel'] = 'Frequency (Hz)' result['YAxisLabel'] = 'Spectrum (%)' result['XValues'] = [] result['YValues'] = [] for i in range(len(spectrum)): freq = i*spectrumStep if freq >= freqFrom and freq <= freqTo: result['XValues'].append(freq) result['YValues'].append(100.0*spectrum[i]/s)

Page 200

Page 203: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

if len(result['XValues']) == 0: raise ValueError('Frequency range is too narrow: frequency step = ' +str(spectrumStep)) doc.SetPythonAnalysisOutput(json.dumps(result)) # call Calculate() Calculate()

Page 201

Page 204: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.50. CV2 Analysis CV2 Analysis evaluates variability of interspike intervals by comparing only adjacent interspike intervals.CV2 statistic is less sensitive to rate variations than other measures such as the coefficient of variation ofinterspike intervals.

Parameters

Parameter Description

Time Min (sec) Only the timestamps in time interval [Time Min, Time Max] will be selected foranalysis.

Time Max (sec) Only the timestamps in time interval [Time Min, Time Max] will be selected foranalysis.

Max Mean of ISI Pair(sec)

CV2 graph shows ISI variability versus Mean of ISI Pair. Max Mean of ISIPair specifies maximum of X axis in CV2 graphs

Mean of ISI Pair Bin(sec)

Bin size for calculation of CV2 mean and Standard Error of Mean.

Dot Size (pts) Specifies the size of the dots shown at (Mean of ISI Pair, CV2) coordinates.  

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

CV2 Min Y axis minimum.

CV2 Max Y axis maximum.

Time Min Minimum of the time interval that was used to select spikes.

Time Max Minimum of the time interval that was used to select spikes.

CV2 Mean Average of all CV2 values.

Spikes The number of spikes used in calculation.

Mean Firing Rate Mean firing rate of the spikes used in analysis.

Algorithm If the spikes in a train occur at times t[i] (i = 1, 2, ..., N) then the ISIs will be isi[i] = t[i] - t[i-1] (i = 2, 3, ...,N) CV2 is then calculated as CV2[i] = 2*abs(isi[i+1] - isi[i]) / (isi[i+1] - isi[i]) Dots in CV2 graph are drawn at (X,Y) locations ( ISIPairMean[i], CV2[i] ) where ISIPairMean[i] = (isi[i+1]- isi[i]) / 2. X (ISI pair mean) axis is divided into bins. For each bin, the mean of CV2 values and the Standard Errorof Mean of CV2 values are calculated.

Page 202

Page 205: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Reference Holt, Gary R., William R. Softky, Christof Koch, and Rodney J. Douglas. "Comparison of dischargevariability in vitro and in vivo in cat visual cortex neurons." Journal of Neurophysiology 75, no. 5 (1996):1806-1814.

Page 203

Page 206: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.51. Firing Rates Analysis Firing Rates analysis calculates and displays firing rates in specified time intervals or series of timeintervals.

Parameters

Parameter Description

Time Period 1 Type How period 1 is specified (None, Single Interval or Interval Variable).

Period 1 From (sec) If period 1 type is Single Interval, interval start in seconds.

Period 1 To (sec) If period 1 type is Single Interval, interval end in seconds.

Period 1 Interval Var. If period 1 type is Interval Variable, selected interval variable.

Period 1 Inside/Outside An option to calculate firing rates inside or outside specified time interval(s).

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Summary of Numerical Results The following information is available in the Summary of Numerical Results

Column Description

Variable Variable name.

Period Spec 1 Period 1 specification.

Period Length 1 Length of period 1 in seconds.

Spikes in Period 1 The number of spikes in period 1.

Firing rate in Period 1 Firing Rate in period 1 (spikes per second).

Algorithm For each specified interval or interval variable (series of time intervals), the number of events(timestamps) within the time interval(s) is calculated. The number of timestamps is then divided by theduration of the intervals(s).

Page 204

Page 207: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

3.52. Band Energy versus Time Analysis This analysis calculates energy of a specified frequency band over time.

Parameters

Parameter Description

XMin (sec) Analysis is run on the data from a specific time range [XMin, XMax]. XMinspecifies time range minimum in seconds.

XMax (sec) Analysis is run on the data from a specific time range [XMin, XMax]. XMaxspecifies time range maximum in seconds.

Window Width (sec) Band energies are calculated in consecutive time windows. This parameterspecifies the width of each window in seconds.

Use Custom WindowShift

By default (if Use Custom Window Shift is not checked), window shift isequal to Window Width (sec) (so the analysis is done over consecutive non-overlapping windows). If Use Custom Window Shift option is selected, theshift is specified by Window Shift (sec) parameter.

Window Shift (sec) If Use Custom Window Shift is not checked, window shift is equal toWindow Width (sec) and this parameter is ignored. If Use Custom WindowShift option is selected, the shift is specified by Window Shift (sec)parameter.

Normalization Spectrum units (see Normalization below).

Min. Freq. (Hz) Specifies minimum of the frequency band in Hz (for example, 3 Hz for thetaband).

Max. Freq. (Hz) Specifies maximum of the frequency band in Hz (for example, 6 Hz for thetaband).

Select Data If Select Data is From Time Range, only the data from the specified timerange will be used in analysis. See also Data Selection Options.

Select Data From Start of the time range in seconds.

Select Data To End of the time range in seconds.

Interval filter Specifies the interval filter that will be used to preselect data before analysis.See also Data Selection Options.

Smooth Option to smooth the result after the calculation. See Post-Processing

Options for details.

Smooth Filter Width The width of the smooth filter. See Post-Processing Options for details.

Add to Results / Bin left An option to add an additional vector (containing a left edge of eachfrequency bin) to the matrix of numerical results.

Add to Results / Binmiddle

An option to add an additional vector (containing a center of each frequencybin) to the matrix of numerical results.

Add to Results / Bin right An option to add an additional vector (containing a right edge of eachfrequency bin) to the matrix of numerical results.

Result Prefix The prefix for generating names of the continuous variables. For example, if

Page 205

Page 208: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

we analyze variable LFP and the prefix is Theta, the generated continuousvariable will be named Theta_LFP.

Send to Matlab An option to send the matrix of numerical results to Matlab. See also Matlab

Options.

Matrix Name Specifies the name of the results matrix in Matlab workspace.

Matlab command Specifies a Matlab command that is executed after the numerical results aresent to Matlab.

Send to Excel An option to send numerical results or summary of numerical results to Excel.See also Excel Options.

Sheet Name The name of the worksheet in Excel where to copy the numerical results.

TopLeft Specifies the Excel cell where the results are copied. Should be in the formCR where C is Excel column name, R is the row number. For example, A1 isthe top-left cell in the worksheet.

Algorithm For each window, the spectrum of the signal in this window is calculated. For the values of the specifiedfrequency band, average, sum or percent of these values is calculated.

Normalization If Normalization is Raw PSD (Numerical Recipes), the power spectrum is normalized so that the sum ofall the spectrum values is equal to the mean squared value of the rate histogram. The formulas (13.4.10)of Numerical Recipes in C are used. (Numerical Recipes in C, Press, Flannery, et al. (CambridgeUniversity Press, 1992)) If Normalization is % of Total PSD (Numerical Recipes), the power spectrum is normalized so that thesum of all the spectrum values equals 100. If Normalization is Log of PSD (Numerical Recipes), the power spectrum is calculated using the formula: power_spectrum[i] = 10.*log10(raw_spectrum[i]) where raw_spectrum is calculated as described above in Raw PSD (Numerical Recipes). If Normalization is Raw PSD (Matlab), the power spectrum is normalized as described in

http://www.mathworks.com/help/signal/ug/psd-estimate-using-fft.html If Normalization is Log of PSD (Matlab), the power spectrum is calculated using the formula: power_spectrum[i] = 10.*log10(raw_spectrum_matlab[i]) where raw_spectrum_matlab is calculated as described above in Raw PSD (Matlab).

Page 206

Page 209: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

4. Working with Graphics Graphical analysis results in NeuroExplorer can be adjusted by the user to include custom labels, linesand arrows. The topics in this section describe the graphics elements, list the attributes that you can usewith them, and show how to customize NeuroExplorer graphics output.  

Page 207

Page 210: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

4.1. NeuroExplorer Graphics NeuroExplorer Graph Window shows the graphs as they will be printed on a page. If you press Zoom Outbutton several times, you'll see the whole page with the graphs, header and footer:

NeuroExplorer Graph Window shows one or more graphics objects. The page above has only one object- a block of graphs. You can add more objects by using Insert menu commands. For example, to add a label to the NeuroExplorer Graph Window:

select Insert | Text menu commandclick in the Graph window where you want the new label to be placededit the label properties in the Text Dialog

Here is the page shown above with an additional Text object ("Crosscorrelograms" label):

Page 208

Page 211: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

4.2. Graphics Modes The standard display of the NeuroExplorer Graph Window shows the graphics in the Page Mode:

In this mode, you can add, delete and edit page graphics objects, i.e. the graphics elements that youwant to have on the page. Each graph in the page, however, has its own set of graphics objects. Thus, the default graph usuallycontains the text label that displays the variable name (Neuron04a in this picture):

To edit the properties of the graphical objects (like the label "Neuron04a" above) that belong to the graph, you need to switch the Graph Window to the Graph Mode. Use Graphics | Edit Graphics | Graph Layout Mode and Graphics | Edit Graphics | Page LayoutMode menu commands to switch the graphics mode in NeuroExplorer. You can also use the followingtoolbar buttons to switch the graphics modes:

The left button will switch the Graph Window to the Page Mode, the right button will switch it to the GraphMode. Here is the typical picture in Graph Mode:

Only one graph is visible in this mode. While in the Graph Mode, you can select, drag, resize and edit thegraphical objects that will appear in every graph. For example, to move the variable name label to a different position relative to the graph:

Switch to the Graph Mode as described above

Page 209

Page 212: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

Click on the text label to select itDrag the label to a different position:

Switch back to the Page Mode:

Note that the labels of all graphs are now in new positions.

Page 210

Page 213: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

4.3. Positioning the Graphics Objects Every graphical object in NeuroExplorer has its parent. Thus, the Block of Graphs is a parent of all thepage graphics objects. The Graph is a parent of all the objects inside the graph (X and Y axes, variablelabel, etc.). A position of any graphics object is always specified relative to its parent. When you move or resize theowner, other objects will move together with their parent. There are several types of coordinates units that you can use to position the objects. For X coordinates, NeuroExplorer has the following options: Graph Width. With these coordinate units, 0.0 corresponds to the left edge of the owner, 1.0corresponds to the right edge of the parent. Inches From Left. Here 0.0 corresponds to the left edge of the parent. If you want on object to be 0.3inches to the left of the parent, specify X as -0.3. Inches From Right. Here 0.0 corresponds to the right edge of the parent. If you want on object to be 0.3inches to the right of the parent, specify X as 0.3. Graph Data. With these coordinate units, X coordinate corresponds to the graph X axis. For Y coordinates, NeuroExplorer has the following options: Graph Height. With these coordinate units, 0.0 corresponds to the bottom edge of the parent, 1.0corresponds to the top edge of the parent. Inches From Bottom. Here 0.0 corresponds to the bottom edge of the parent. If you want on object tobe 0.3 inches below of the parent, specify Y as -0.3. Inches From Top. Here 0.0 corresponds to the top edge of the parent. If you want on object to be 0.3inches above the parent, specify Y as 0.3. Graph Data. With these coordinate units, Y coordinate corresponds to the graph Y axis. Use Location tab in the graphics object Edit dialog to specify the object's position:

Coordinates and alignment options shown in this dialog are for the text label in the following graph:

Page 211

Page 214: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

This text object is located to the right of the graph, so the X coordinate is 1.05 with the Graph Size unitsand horizontal alignment Left. The object is centered vertically relative to the graph, so its Y coordinate is 0.5 with the Graph Size unitsand vertical alignment Center.

Page 212

Page 215: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

••

4.4. Text Labels To add a label in the NeuroExplorer Graph Window:

Select Insert | Text menu commandMove the mouse pointer to the Graph Window. Note that the cursor changes to the picture of ahandClick in the Graph window where you want the new label to be placedEdit the label properties in the displayed Text Dialog

To specify the font, press Change Font button. To specify the exact position of the text object, use the Location page of the dialog. See Positioning the

Graphics Objects for details. To specify the text of the label, type the text of the label in the Text field. In many cases there is a need to specify a text that depends on the opened data file, the variable in thegraph, etc. NeuroExplorer uses Template Strings to accomplish this task. Template String is a string enclosed in brackets (for example, <VarName> ). During the drawingprocess, NeuroExplorer tries to find the actual string for each of the template strings. If the actual string isfound, the template string is replaced by the actual string. For example, if the variable used in the graphis Neuron04a, the <VarName> string in the text object is replaced by Neuron04a. Insert button in the Text Edit Dialog opens a menu that allows you to insert various Template Strings intothe text object. You can also manually type in the template strings into the text field of the dialog. Here is the list of available template strings: <VarName> - replaced by the name of the variable used in a graph. Works in the graph labels only. <ColVarName> - replaced by the name of the variable used for a column of graphs. Works in the pagelabels only when the analysis has a reference variable and the reference type is Table. <RowVarName> - replaced by the name of the variable used for a row of graphs. Works in the pagelabels only when the analysis has a reference variable and the reference type is Table. <Bin> - replaced by the bin value in seconds. <BinMS> - replaced by the bin value in milliseconds. <RefName> - replaced by the name of the reference variable. Works only when the analysis has areference variable. <NumRef> - replaced by the number of reference events. Works only when the analysis has a referencevariable. <FileName> - replaced with the name of the data file. <FilePath> - replaced with the full path of the data file. <Date> - replaced with current date. <Time> - replaced with current time. <Smooth> - replaced with one of the three strings "None", "Boxcar" or "Gaussian", depending of thecurrent smooth selection. Works with histogram-type analyses only. <SmoothWidth> - replaced with the smooth filter width. Works with histogram-type analyses only. <IntFilter> - replaced with the name of the Interval Filter.

Page 213

Page 216: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

<FirstInt> - replaced with the first interval of the Interval Filter (if Interval Filter is specified), or theinterval from 0 to the end of experiment (if the filter is not specified).

Page 214

Page 217: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

••

4.5. Lines To add a line in the NeuroExplorer Graph Window:

Select Insert | Line menu commandMove the mouse pointer to the Graph Window. Note that the cursor changes to the picture of ahandClick in the Graph window where you want the new line to start and keep the left mouse buttondownDrag the mouse pointer to the place where you want the new line to endRelease mouse button

To edit the properties of the line, double-click at the line. The following dialog will be displayed:

Line thickness and the size of the arrow are specified in points (1/72th of the inch). To specify the exact position of the line, use the Location page of the dialog. See Positioning the

Graphics Objects for details.

Page 215

Page 218: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

•••

4.6. Rectangles To add a rectangle in the NeuroExplorer Graph Window:

Select Insert | Rectangle menu commandMove mouse pointer to the Graph Window. Note that the cursor changes to the picture of a handClick in the Graph window where you want to position the top-left corner of the new rectangle andkeep the left mouse button downDrag the mouse pointer to the place where you want to position the bottom-right corner of the newrectangleRelease mouse button

To edit the properties of the rectangle, double-click anywhere in the rectangle and specify rectangleparameters in Rectangle Properties dialog. To specify the exact position of the rectangle, use the Location page of the dialog. See Positioning the

Graphics Objects for details.

Page 216

Page 219: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

5. Working with 3D Graphics NeuroExplorer 3D Graphics Module adds high quality 3D graphics to NeuroExplorer. It was alwayspossible before to export the analysis results from NeuroExplorer to Matlab and then create the 3Dgraphs in Matlab. However, it would require a considerable amount of time and effort to create theproperly labeled 3D graph in Matlab. In NeuroExplorer version 3 and higher, a single click of a button willdisplay in NeuroExplorer a highly customizable and properly labeled 3D graph. You can easily change dozens of graph parameters and options using the Properties Window or dialogs.You can even rotate the graph with the mouse in all 3 dimensions. As with the NeuroExplorer Analysis Templates, any set or 3D graph parameters can be saved as atemplate. For example, you may save one set of color preferences for slide presentations and anotherset of colors for printed materials. NeuroExplorer also enables you to display a "movie" of the concurrent activity of a neuronal network.You can specify a position of each recorded neuron in a plane (using Edit | Positions.. menu command)and then display the animation of the activity of the neurons over time. Here is an example of a 3D graph in NeuroExplorer. Multiple perievent histograms are shown side-by-side in 3 dimensions:

Page 217

Page 220: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

5.1. Viewing Multiple Histograms in 3D To view a set of histograms in 3 dimensions:

Calculate the histograms by applying any of the histogram analyses (Rate Histograms, InterspikeInterval Histograms, Auto- and Cross-correlograms, Perievent Histograms, etc.)Select 3D | View Histograms in 3D menu command.

NeuroExplorer will open the 3D Viewer window and all the histograms in the NeuroExplorer graphicsview will be shown in a 3D graph:

Note that all the histograms are shown in the same scale. However, neurons often have very differentfiring rates so that the histograms for the slow firing neurons may be displayed as having almost zerovalues. If you would like to view the variations of the histograms around their respective means, you can use aseparate menu command, 3D | View Histogram Variations in 3D. This option will allow you to view thez-scores of histograms instead of the raw histogram values. z-score is calculated as: z = (histogram_value - histogram_mean)/histogram_standard_deviation Here is the same set of histograms as above shown using 3D | View Histogram Variations in 3D menucommand (the graph type is also changed from 'Stripes' to 'Walls'):

For more information on 3D Viewer options and parameters, see 3D Graphics Parameters.

Page 218

Page 221: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

5.2. 3D Graphics Parameters 3D Template - allows you to choose the 3D Template. When you start using 3D capabilities inNeuroExplorer, only one 3D Template, Default is available. You can add templates by saving any set of3D graphics parameters as a new template (to do this, use 3DView | Save As New 3D Template menucommand). Graph Type - allows you to choose the graph type. Draw Lines - an option to draw mesh or contour lines. Z Color Scale - an option to use color scale in the graph. Light - an option to use lighting effects in the graph. Smooth - an option to smooth the graph using a 2D Gaussian filter. Smooth Radius - smooth filter radius in mesh points. Z Min, Z Max - overwritable minimum and maximum of the Z Axis. Distance From Camera - this parameter determines the size of the graph in the window. The distanceshould be between 1 and 10. Draw Labels - an option to draw axes labels. Title - 3D graph title. Title Font Size, Label Font Size - font sizes relative to the 3D graph "cube" size. Light X, Y, Z - position of the light source.

Page 219

Page 222: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

••

••

5.3. Viewing the Neuronal Activity "Movie" To view a 'movie' of neuronal activity:

Open the data file. Next, you need to specify the positions of neurons. Neuron positions are saved in a NeuroExplorer datafile, so you only need to do this once.

Select Edit | Set Positions of the Neurons menu command Specify the positions of neurons in the Positions Dialog Box. NeuroExplorer assumes that all theneurons are located on a plane with X and Y coordinates ranging from 0 to 100:

Select 3D | Activity Animation menu command.Use the buttons in the Properties Panel to start and stop the animation.

You can save animation to an AVI file. To do this, press "Save Animation" button in the control panel:

Page 220

Page 223: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

You may want to change the 3D graph properties to get the smooth surface shown above. To change thegraph properties, right-click in the 3D Viewer window and select Graphics Parameters menu command.Select Surface plot type and enable Gaussian Smoothing. For more information on 3D Viewer options and parameters, see 3D Graphics Parameters. For more information on Activity Animation options and parameters, see Activity Animation Parameters.

Page 221

Page 224: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

5.4. Activity Animation Parameters Animation Template - allows you to choose the Animation Template. When you start using 3Dcapabilities of NeuroExplorer, only one Animation Template, Default is available. You can add templatesby saving any set of Animation parameters as a new template (to do this, use 3DView | Save As NewAnimation Template menu command). Reference - if this parameter is None, NeuroExplorer shows the rate histograms-based animation (thatis, neuronal activity in real time). If this parameter is not None, NeuroExplorer calculates the perieventhistograms for the specified reference and shows neural network activity around the specified event. NeuroExplorer uses a sliding window to calculate the firing rates of the neurons. The window has thewidth equal to the Bin. The first window begins at Start time. The second window begins at Start+Shiftand ends at Start+Shift+Bin, etc. For each of the windows, the number of spikes that each neuron hasinside this window is calculated. Then for each neuron the point (X_position, Y_position, Spike_Count) isshown in a 3D graph. Start - beginning of the first sliding window. Bin - width of the sliding window. Shift - sliding window shift. Number of shifts - number of windows (frames). Time Smooth - allows you to enable or disable time smoothing of the spike counts. Time Smooth Width - sigma of the Gaussian filter used for smoothing over time. See Post-Processing

Options for more information about smoothing the histograms. Matrix NX - the number of points in the mesh in X direction. Matrix NY - the number of points in the mesh in Y direction. Neuron Size - the size of the square (in mesh points) that represents a single neuron. Loop - an option to show the animation in a "loop" mode (after all the frames are shown, animation goesback to the first frame and starts again).

Page 222

Page 225: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6. Programming with Python and NexScript Starting with version 5.022, NeuroExplorer scripts can be written using a powerful and well-documentedPython language. NeuroExplorer uses Python 2.7.10 and there is no need to install Python -- all thePython files needed for scripting are installed by NeuroExplorer setup program.   The new scripting capabilities in NeuroExplorer can only be used from Python. It is recommended thatyou use Python for all new scripts. Starting with version 5.036, you can also run Python scripts communicating with NeuroExplorer using aPython development environment of your choice (for example, PyCharm is an excellent free Python

development environment with debugging and auto-completion). To use PyCharm, install Anaconda

Python distribution, install PyCharms, then invoke View | Options menu commands, go to Python tab,

enable Start TCP Server and restart NeuroExplorer:  

If you are using Python via NeuroExplorer TCP server, all you need to do to connect to the server andrun NeuroExplorer commands is to add the following 3 lines to your script: import syssys.path.append('C:\\ProgramData\\Nex Technologies\\NeuroExplorer 5 x64')import nex

Page 223

Page 226: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

  You can convert existing NexScript scripts to Python using Tools | Convert to Python menu command inNexScript editor.   Python is a very popular language and you can find an extensive documentation on any Python featureon the Web. One of the best introductions to Python is a book ' A Byte of Python '. You can read thisbook here: http://www.swaroopch.com/notes/python/.   NeuroExplorer also has a less powerful internal scripting language (NexScript) resembling the Matlablanguage.   To create a script, select the Script | New Script menu command. To open existing script, double-clickat the script name in the Scripts View. NeuroExplorer will open NexScript editor:

NexScript editor has two docked panels: Functions Panel and Output Panel. In the Functions Panel, youcal click at the function name to display function description. You can also double-click at the functionname to insert the function into the script. The Output Panel displays compiler messages and debugoutput (generated using print function in Python or Trace function in NexScript).

Scripts Each script is a text file that has an extension .py (for Python script) or extension .nsc (for NexScriptscript). Scripts are usually saved in user's Documents directory in NeuroExplorer 5\Scripts folder. Note that you can create subfolders in the scripts folder. The scripts tree shown in the Scripts View is acopy of the scripts directory specified above. You can create subfolders in your scripts directory and thenNeuroExplorer will allow you to navigate through the scripts directory tree within the Scripts View.

Lines and Comments in Python Python is a very popular language and you can find an extensive documentation on any Python featureon the Web. One of the best introductions to Python is a book ' A Byte of Python '. You can read thisbook here: http://www.swaroopch.com/notes/python/.

Page 224

Page 227: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

The hash symbol (#) marks the beginning of a comment in Python, for example: # this is a comment line in Pythonx = 0 # this is also a comment in Python

Variables and Expressions in Python See http://www.swaroopch.com/notes/python/#op_exp.

Flow Control in Python See http://www.swaroopch.com/notes/python/#control_flow.  

Lines and Comments in NexScript Each line of the script may contain only one statement, for example: x = 0 If the statement is very long, you can use the line continuation symbol (backslash \) to indicate that thenext line contains the continuation of the current line. For example, instead of: Dialog(doc, "D:\Plexon\data\mydata\*.plx", "Filter", "string") you can write: Dialog(doc, "D:\Plexon\data\mydata\*.plx",\"Filter"", "string") The percent symbol (%) marks the beginning of a comment in NexScript, for example: % this is a comment linex = 0 % this is also a comment

Variables and Expressions in NexScript NexScript supports numeric variables and standard expressions: xmean = (xmax - xmin)/2. strings: name = "SPK" + "01" You can also query and modify file variables (spike trains, intervals, continuous variables, etc.). See Variables and Expressions to learn more about the basics of NexScript.

Flow Control in NexScript for loops, while loops and if … else constructs can be used for flow control: imax = 0doc = GetActiveDocument()for i = 2 to n interval = doc["SPK01a"][i] - doc["SPK01a"][i-1] if interval > imax imax = interval endend See Flow Control for more information.

Functions

Page 225

Page 228: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

NeuroExplorer Python and NexScript interfaces offer more than 190 functions that allow you to edit data,open and close files, perform analyses, save the results and send results to Matlab of Excel. See

Functions for more information.

Page 226

Page 229: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.1. Script Variables

Variable Names The variable name in NexScript should begin with a letter and contain only letters, digits and theunderscore sign. The following names are valid: Neuron01      Bar_press    Nr_1a       SPK02b These variable names cannot be used in NexScript: 2Neuron Bar-press The variables from the opened data file can be accessed using the document reference with the variablename specified in the square brackets. For example, the spike train SPK01a from the active documentcan be addressed as: doc["SPK01a"] where doc is a reference to the document. You can get this reference by calling GetActiveDocument orcalling OpenDocument. An alternative way to access file variable is by getting a reference to the variable: SPK01a = GetVarByName(doc, "SPK01a") See Also File Variables

Variable Types NexScript supports numeric variables: xmean = (xmax - xmin)/2. and strings: name = "SPK" + "01" A variable can also be a reference to the existing variable in the file: neuron1 = GetVar(doc, 1, "neuron") or a reference to the opened document: doc = GetActiveDocument() A variable type can be changed if the right-hand side of the assignment has a different type. Forexample: x = 0.005 % x now is a numeric variablex = "SPK" % after this statement, x is a string

Global Variables A variable can be declared global so that it can be accessed from several scripts: Global name Global statements should be placed at the beginning of the script. See Also File Variables

Page 227

Page 230: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.2. File Variables The variables from the opened data file can be accessed using the document reference with the variablename specified in the square brackets. For example, the spike train SPK01a from the active documentcan be addressed as: doc["SPK01a"] where doc is a reference to the document. You can get this reference by calling GetActiveDocument orcalling OpenDocument. An alternative way to access a file variable is by getting a reference to the variable: spikeTrain = GetVarByName(doc, "SPK01a") You can also use a string variable to specify the variable name using doc[VariableName] notation: name = "SPK01b"spikeTrainB = doc[name] This way you can generate the new variable names in the script. For example, to create new variablescontaining only the spikes of neuron variables that are within the intervals of the interval variableCorrectTrials, you can write: doc = GetActiveDocument()numNeurons = GetVarCount(doc, "neuron")for i = 1 to numNeurons % generate the name for the new variable newName = GetVarName(doc, i, "neuron") + "Filtered" % run IntervalFilter operation doc[newName] = IntervalFilter(GetVar(doc, i, "neuron"), doc["CorrectTrials"])end

Assignments Involving File Variables If the left-hand side of the assignment is not a file variable: v = doc["Neuron01"] the script variable v will contain a reference (a shortcut) to the file variable Neuron01 and Neuron01 spiketimes will not be copied to v. If the left-hand side of the assignment is a file variable: doc["ContVarCopy"] = doc["ContChannel01"] all the data of the file variable ContChannel01 will be copied to the new file variable ContVarCopy. For example, to create a new continuous variable containing rectified signal of continuous variable FP01,we can write the following code: doc["FP01_Rectified"] = NewContVarWithFloats(doc, 10000)for i=1 to GetContNumDataPoints(doc["FP01"]) t = doc["FP01"][i,1] v = abs(doc["FP01"][i,2]) AddContValue(doc["FP01_Rectified"], t, v)end We can achieve the same result using variable references and copying data to a new variable (and thecode below will run more than 7 times faster than the code above): doc["FP01_Rectified"] = doc["FP01"]rectified = doc["FP01_Rectified"]ContVarStoreValuesAsFloats( rectified )n = GetContNumDataPoints( rectified )

Page 228

Page 231: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

for i=1 to n rectified[i,2] = abs( rectified[i,2] )end

Access to the Data in File Variables

Timestamped Variables You can access the timestamp value by specifying the timestamp index (1-based, i.e. the first timestamphas index 1) in square brackets: doc = GetActiveDocument()% first option: use doc["VarName"] notationtimestamp = doc["SPK01a"][3]% second option: get variable by name and then use the variable directlyspikeTrain = GetVarByName(doc, "SPK01a")timestamp = spikeTrain[3] You can assign a new value for any timestamp in the current file. For example, to assign the value 0.5(sec) to the third timestamp of the variable SPK01a, you can use this script: doc = GetActiveDocument()doc["SPK01a"][3] = 0.5 You can also add timestamps to a variable using NexScript functions. See Properties of Variables and

Adding Data to Variables for details.

Interval Variables IntVar[i,1] gives you read/write access to the start of the i-th interval, IntVar[i,2] gives you read/writeaccess to the end of the i-th interval. For example, to assign the value 27.5 seconds to the end of the first interval of interval variable Frame,you would use this script: doc = GetActiveDocument()doc["Frame"][1,2] = 27.5 You can also add intervals to an interval variable using NexScript functions. See Properties of Variables

and Adding Data to Variables for details.

Continuous Variables ContVar[i,1] gives you read-only access to the timestamp of the i-th data point. ContVar[i,2] gives you read-write access to the value of the i-th data point. For example, the following script prints the timestamp and the value of the fifth data point in variableContChannel01: Trace("ts = ", doc["ContChannel01"][5,1], "value =" ,doc["ContChannel01"][5,2]) The following script line assigns the value of 100 to the fifth data point: doc["ContChannel01"][5,2] = 100.0 Note that when you assign a value to a continuous variable that was imported from a file created by adata acquisition system, the assigned value might be clipped. Data acquisition systems usually store continuous values as 2-byte integers. NeuroExplorer also storesimported analog data as 2-byte integers with some scaling factors. For example, if analog to digital converter has input range from -1000mV to +1000mV, then maximum 2-byte value 32767 corresponds to 1000mV and the scaling factor is 1000/32768. If we try to assign the

Page 229

Page 232: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

value that is outside the original input range, the value has to be clipped so that it could be stored as a 2-byte integer (for example, if we try to assign 2000mV, the stored value will be 32767 or 1000mV). To avoid data clipping, use ContVarStoreValuesAsFloats function to convert 2-byte integer storage to 4-

byte float storage that does not have clipping problems. You can add new data points to a continuous variable using NexScript functions. See Properties of

Variables and Adding Data to Variables for details.

Marker Variables MarkerVar[i,1] gives you read-only access to the timestamp of the i-th marker. MarkerVar[i,2] gives you read-only access to the value of the first field of the i-th marker. Note thatmarker field values are stored as strings, so you will need to use StrToNum() function to convert thesevalues to numbers. For example, the following script prints the timestamp and the first field value of the fifth marker invariable Strobed: Trace("ts = ", doc["Strobed"][5,1], "marker value =" ,doc["Strobed"]5,2])

Operations on Variables Many operations on data variables are available via Edit | Operations on Data Variables menu command.This menu command opens Operations dialog:

  The operation is specified in the top left corner of the dialog. When you select an operation, an operationdescription is shown in the central panel of the dialog. When you press Run the Operation button, thespecified operation is performed and a script line is added to the 'Operations Performed' window at thebottom of the dialog. You can save the list of operations in a NexScript file if you press the "Save.."button.

Page 230

Page 233: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

  See Also Document Variables and Adding New Variables See Also Operations on Document Variables

Page 231

Page 234: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.3. Expressions Standard algebraic expressions are supported: xmean = (xmax - xmin)/2. Addition operation can also be applied to the strings: name = "SPK" + "01" Logical expressions may be used in if and while statements: x = 2 if x >= 2 Trace("x is greater or equal to 2")End if x > 2 Trace("x > 2")End if x <= 2 Trace("x <= 2")end if x == 2 Trace("x equals 2")end if x <> 1 Trace("x is not equal to 1")end Logical expressions may be combined using logical AND (&) or logical OR (|) operators: if (x >= 2) & (y <4) Trace("x <=2 and y <4")end if (x >= 2) | (y <4) Trace("x <=2 or y <4")end

Page 232

Page 235: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.4. Flow Control

Loops NexScript supports two types of loops: for loops and while loops. for loop has the following syntax: for variable = expression to expression statements ...end Example: for i = 1 to 10 SelectVar(doc, i, "neuron")end   while loop has the following syntax: while logical_expression statements ...end Example: i = 1while i < 10 SelectVar(doc, i, "neuron") i = i + 1end

break break statement causes an immediate exit from the loop. The following loop for i = 1 to 10 Trace(i) if i == 5 break endend will produce output: 1 2 3 4 5

continue continue statement returns to the loop’s beginning skipping the statements that follow it. The following loop for i = 1 to 5 if i == 3 continue end Trace(i)end will produce output: 1 2 4 5

Page 233

Page 236: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

return return statement causes an immediate exit from the script.  

Conditional operators Operator if has the following syntax: if logical_expression statements ...  end or if logical_expression statements ... else statements ... end Example % select a variable if it has at lest one spike% otherwise, deselect the variable if GetVarCount(doc, i, "neuron") > 0 SelectVar(doc, i, "neuron")else DeselectVar(doc, i, "neuron")end

Page 234

Page 237: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5. Functions The following function categories are available in NexScript and Python

Category Description

File Read and Write Functions Functions to read data and text files, save data and results.

Document Properties Functions to access general document properties such as filename and comment.

Document Variables and Adding

New Variables

Functions to get the number of spike trains, etc. in the document;to get variable by name; to add new variables to the document.

Selecting Document Variables Functions to select variables for analysis.

Analysis Functions Functions to run analysis templates, modify templates, printresults.

Numerical Results Functions Functions to query and save numerical results.

Operations on Document Variables Functions to modify existing variables (for example, frequencyfilter) and to run calculations based on the variables (for example,find synchronous spikes).

Matlab Functions Functions to send data and results to Matlab and to read data fromMatlab.

Excel Functions Functions to send data and results to Excel.

PowerPoint Functions Functions to send graphical results to PowerPoint.

Running Script Functions Functions to run another script or to pause script.

Math Functions Various math functions (random numbers, bitwise operations,square root, etc.).

String Functions Functions related to stings (search in string, substrings, convertnumbers to strings, etc.).

Debug Functions Functions that are helpful in debugging (for example, print scriptvariables).

See Also Introduction to NexScript and Python Programming

Page 235

Page 238: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1. File Read and Write Functions The following file read and write functions are available in NexScript and Python

Function Description

GetFileCount Returns the number of files that match the specified file filter.

GetFileName Returns the file name for the specified index after GetFileCount()was called.

OpenFile Opens text file using the specified mode, returns file ID.

CloseFile Closes the file.

ReadLine Reads a line from the specified text file.

WriteLine Writes a line of text to the specified file.

OpenDocument Opens a data file with the specified path.

GetActiveDocument Returns a reference to currently active document.

NewDocument Opens a new document (data file) with the specified timestampfrequency.

CloseDocument Closes the specified document.

SaveDocument Saves the specified document.

SaveDocumentAs Saves the specified document in a file with the specified file path.

SaveNumResults Saves the numerical results to a text file with the specified name.

SaveNumSummary Saves the summary of numerical results to a text file with thespecified name.

SaveAsTextFile Saves the document in the text file with the specified file name.

MergeFiles Merges the specified files, returns the reference to the merged file.

ReadBinary Reads binary value of a specified type.

FileSeek Repositions file pointer by the specified offset.

SelectFile Returns the path of the file selected in File Open dialog.

SelectFiles Returns the paths of several files selected in File Open dialog.

OpenSavedResult Opens a saved result file with the specified path.

See Also Introduction to NexScript and Python Programming Function Categories

Page 236

Page 239: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.1. GetFileCount

GetFileCount Function Returns the number of files that match the file filter.

Syntax number GetFileCount(string fileFilter)

Parameters

Parameter Type Description

fileFilter string File filter specification. Can contain wildcards (*). Forexample, to get all .nex files in folder C:\data\, usefilter "C:\data\*.nex". 

Returns Returns the number of files that match file filter.

Comments In Python, use os.listdir() method: http://stackoverflow.com/questions/3964681/find-all-files-in-directory-

with-extension-txt-with-python.  

Usage

NexScript % repeat analysis for all .nex files in the folderfilefilter = "C:\Data\*.nex"n = GetFileCount(filefilter)for i=1 to n name = GetFileName(i) doc = OpenDocument(name) if doc > 0 % run the analysis, print results and close the file ApplyTemplate(doc, "Interspike Interval Histograms") PrintGraphics(doc) CloseDocument(doc) endend

Python import neximport os# repeat analysis for all .nex files in the folderdirectory = "C:\\Data\\"for name in os.listdir(directory): if name.endswith(".nex"): doc = nex.OpenDocument(directory + name) if doc > 0: nex.SelectAllEvents(doc)

Page 237

Page 240: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

# run the analysis, print results and close the file nex.ApplyTemplate(doc, "Auto") nex.PrintGraphics(doc) nex.CloseDocument(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 238

Page 241: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.2. GetFileName

GetFileName Function Returns the file name for the specified index after GetFileCount() was called.

Syntax string GetFileName(index)

Parameters

Parameter Type Description

index number Index of the file in the file list created by the last call toGetFileCount.

Returns Returns the file name (the full path of the file) for the specified index after GetFileCount() was called.

Comments In Python, use os.listdir() method: http://stackoverflow.com/questions/3964681/find-all-files-in-directory-

with-extension-txt-with-python.

Usage

NexScript % repeat analysis for all .nex files in the folderfilefilter = "C:\Data\*.nex"n = GetFileCount(filefilter)for i=1 to n name = GetFileName(i) doc = OpenDocument(name) if doc > 0 % run the analysis, print results and close the file ApplyTemplate(doc, "Interspike Interval Histograms") PrintGraphics(doc) CloseDocument(doc) endend

Python import neximport os# repeat analysis for all .nex files in the folderdirectory = "C:\\Data\\"for name in os.listdir(directory): if name.endswith(".nex"): doc = nex.OpenDocument(directory + name) if doc > 0: nex.SelectAllEvents(doc) # run the analysis, print results and close the file nex.ApplyTemplate(doc, "Auto") nex.PrintGraphics(doc) nex.CloseDocument(doc)

Page 239

Page 242: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

See Also Introduction to NexScript and Python Programming Function Categories

Page 240

Page 243: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.3. OpenFile

OpenFile Function Opens text file using the specified mode, returns file ID.

Syntax number OpenFile(filePath, mode)

Parameters

Parameter Type Description

filePath string Full path of the file.

mode string File open mode. Can be either "r", "rt" (read), "w" or"wt" (write) or "a" or "at" (append).

Returns Returns file ID.

Comments None

Usage

NexScript % open a file in read modefile = OpenFile("C:\Data\parameters.txt", "r")% read all the lines in the file and print themif file > 0 line = "" % make line a string variable while ReadLine(file, line) > 0 Trace(line) end CloseFile(file)end

Python import nex# open a file in read modefile = nex.OpenFile("C:\\Data\\parameters.txt", "r")# read all the lines in the file and print themif file > 0: line = "" # make line a string variable __wrapper = [] while nex.ReadLine(file, __wrapper) > 0: line = __wrapper[0] print(line) nex.CloseFile(file)

See Also

Page 241

Page 244: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Introduction to NexScript and Python Programming Function Categories

Page 242

Page 245: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.4. CloseFile

CloseFile Function Closes the specified file.

Syntax CloseFile(fileID)

Parameters

Parameter Type Description

fileID number File ID received from OpenFile function.

Returns None

Comments In Python, use Python native file close() method. See Python code below. In Python, backslash character (\) has a special meaning. When specifying a Windows path like"C:\Data\NexResults.xls" in Python, use either "C:/Data/NexResults.xls" or "C:\\Data\\NexResults.xls".

Usage

NexScript % open a file in read modefile = OpenFile("C:\Data\parameters.txt", "r")% read all the lines in the file and print themif file > 0 line = " " % make line a string variable while ReadLine(file, line) > 0 Trace(line) end CloseFile(file)end

Python # open a file in read modef = open("C:\\Data\\parameters.txt", "r")# read all the lines in the file and print themif f: lines = f.readlines() f.close() for line in lines: print(line.rstrip()) # rstrip() removes end-of-line character from line

See Also Introduction to NexScript and Python Programming Function Categories

Page 243

Page 246: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.5. ReadLine

ReadLine Function Reads a line from the text file.

Syntax number ReadLine(fileID, lineString)

Parameters

Parameter Type Description

fileID number File ID received from OpenFile function.

lineString string String that receives the text from the file.

Returns Returns 1 if more text to read is available in the file, otherwise, returns 0.

Comments In Python, use Python native file readlines() method. See Python code below. In Python, backslash character (\) has a special meaning. When specifying a Windows path like"C:\Data\NexResults.xls" in Python, use either "C:/Data/NexResults.xls" or "C:\\Data\\NexResults.xls".

Usage

NexScript % open a file in read modefile = OpenFile("C:\Data\parameters.txt", "r")% read all the lines in the file and print themif file > 0 line = " " % make line a string variable while ReadLine(file, line) > 0 Trace(line) end CloseFile(file)end

Python # open a file in read modef = open("C:\\Data\\parameters.txt", "r")# read all the lines in the file and print themif f: lines = f.readlines() f.close() for line in lines: print(line.rstrip()) # rstrip() removes end-of-line character from line

See Also Introduction to NexScript and Python Programming

Page 244

Page 247: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Function Categories

Page 245

Page 248: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.6. WriteLine

WriteLine Function Writes a line of text to a text file.

Syntax WriteLine(fileID, lineString)

Parameters

Parameter Type Description

fileID number File ID received from OpenFile function.

lineString string The string to be written to the file.

Returns None

Comments In Python, use file object writelines() method: http://www.tutorialspoint.com/python/file_writelines.htm.

Usage

NexScript % open a file in write modefileID = OpenFile("C:\Data\results.txt", "w")WriteLine(fileID, "first line")CloseFile(fileID)

Python import nex# open a file in write modefileID = nex.OpenFile("C:\\Data\\results.txt", "w")nex.WriteLine(fileID, "first line")nex.CloseFile(fileID)

See Also Introduction to NexScript and Python Programming Function Categories

Page 246

Page 249: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.7. OpenDocument

OpenDocument Function Opens a data file with the specified path. Returns a reference to the opened document.

Syntax documentReference OpenDocument(string filePath)

Parameters

Parameter Type Description

filePath string Full path of the file.

Returns Returns a reference to the opened document. The function returns zero (invalid document reference) ifOpenDocument operation failed.

Comments None

Usage

NexScript This function can be used to open all supported data file formats. For example: doc = OpenDocument("C:\Data\file1.plx")doc = OpenDocument("C:\Data\file1.map")doc = OpenDocument("C:\Data\file1.mcd")doc = OpenDocument("C:\Data\file1.txt")

Python import nexdoc = nex.OpenDocument("C:\\Data\\file1.plx")doc = nex.OpenDocument("C:\\Data\\file1.map")doc = nex.OpenDocument("C:\\Data\\file1.mcd")doc = nex.OpenDocument("C:\\Data\\file1.txt") Before opening a text file, specify text file options using View/Options menu command.

See Also Introduction to NexScript and Python Programming Function Categories

Page 247

Page 250: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.8. GetActiveDocument

GetActiveDocument Function Returns a reference to the currently active document.

Syntax documentReference GetActiveDocument()

Returns Returns a reference to the currently active document. The function returns zero (invalid documentreference) if there are no data files open.

Comments None

Usage

NexScript doc = GetActiveDocument()

Python import nexdoc = nex.GetActiveDocument()

See Also Introduction to NexScript and Python Programming Function Categories

Page 248

Page 251: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.9. NewDocument

NewDocument Function Creates a new document (data file) with the specified timestamp frequency.

Syntax documentReference NewDocument(frequency)

Parameters

Parameter Type Description

frequency number Timestamp frequency.

Returns Returns the reference to the new document.

Comments None

Usage

NexScript doc = NewDocument(25000.)

Python import nexdoc = nex.NewDocument(25000.)

See Also Introduction to NexScript and Python Programming Function Categories

Page 249

Page 252: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.10. CloseDocument

CloseDocument Function Closes the specified document.

Syntax CloseDocument(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns None

Comments None

Usage

NexScript % this script prints the number of variables in the filedoc = GetActiveDocument()Trace("document contains", GetVarCount(doc, "all"), "variables")CloseDocument(doc)

Python import nex# this script prints the number of variables in the filedoc = nex.GetActiveDocument()print("document contains "+str(nex.GetVarCount(doc,"all"))+ " variables")

See Also Introduction to NexScript and Python Programming Function Categories

Page 250

Page 253: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.11. SaveDocument

SaveDocument Function Saves the specified document.

Syntax SaveDocument(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns None

Comments Document is saved as a .nex file.

Usage

NexScript doc = GetActiveDocument()SaveDocument(doc)

Python import nexdoc = nex.GetActiveDocument()nex.SaveDocument(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 251

Page 254: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.12. SaveDocumentAs

SaveDocumentAs Function Saves the specified document (in .nex format) in a file with the specified file path.

Syntax SaveDocumentAs(doc, filePath)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

filePath string File path.

Returns None

Comments If filePath has extension '.nex', the document is save in .nex format. If filePath has extension '.nex5', thedocument is save in .nex5 format.

Usage

NexScript doc = GetActiveDocument()SaveDocumentAs(doc, "C:\Data\file1.nex")

Python import nexdoc = nex.GetActiveDocument() # save file in .nex5 formatnex.SaveDocumentAs(doc, "C:\\Data\\file1.nex5")

See Also Introduction to NexScript and Python Programming Function Categories

Page 252

Page 255: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.13. SaveNumResults

SaveNumResults Function Saves the numerical results to a text file with the specified name.

Syntax SaveNumResults(doc, fileName)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

fileName string File path for saved results.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()SaveNumResults(doc, "C:\Data\res1.txt")

Python import nexdoc = nex.GetActiveDocument()nex.SaveNumResults(doc, "C:\\Data\\res1.txt")

See Also Introduction to NexScript and Python Programming Function Categories

Page 253

Page 256: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.14. SaveNumSummary

SaveNumSummary Function Saves the summary of numerical results to a text file with the specified name.

Syntax SaveNumSummary(doc, filename)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

filename string File path for saved results.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()SaveNumSummary(doc, "C:\Data\res1summary.txt")

Python import nexdoc = nex.GetActiveDocument()nex.SaveNumSummary(doc, "C:\\Data\\res1summary.txt")

See Also Introduction to NexScript and Python Programming Function Categories

Page 254

Page 257: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.15. SaveAsTextFile

SaveAsTextFile Function Saves the document in the text file with the specified file name.

Syntax SaveAsTextFile(doc, filePath)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

filePath string Text file path.

Returns None

Comments This function uses options that were specified the last time the menu command File | Export Data | AsText File was executed.

Usage

NexScript doc = GetActiveDocument()SaveAsTextFile(doc, "C:\Data\dataFromNex.txt")

Python import nexdoc = nex.GetActiveDocument()nex.SaveAsTextFile(doc, "C:\\Data\\dataFromNex.txt")

See Also Introduction to NexScript and Python Programming Function Categories

Page 255

Page 258: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.16. MergeFiles

MergeFiles Function Opens and merges the specified files, returns the reference to the merged file.

Syntax documentReference MergeFiles(name_list, gap)

Parameters

Parameter Type Description

name_list string The list of files to be merged. File names should beseparated by commas.

gap number Gap between the files (in seconds). See commentsbelow.

Returns Returns the reference to the merged files.

Comments In merge process, the data (for the same variable) from the second file is appended to the data from thefirst file. Before appending, the timestamps of the variable in the second file are shifted by the valueequal to duration_of_the_first_file + gap. Since the function uses commas as separators between filenames, it is assumed that each file name does not contain commas. 

Usage

NexScript dataDir = "C:\Data\"file1 = dataDir + "file1.plx"file2 = dataDir + "file2.plx"file3 = dataDir + "file3.plx"mergeList = file1 + "," + file2 + "," + file3doc = MergeFiles(mergeList, 1.)

Python import nexdataDir = "C:\\Data\\"file1 = dataDir + "file1.plx"file2 = dataDir + "file2.plx"file3 = dataDir + "file3.plx"mergeList = file1 + "," + file2 + "," + file3doc = nex.MergeFiles(mergeList, 1.)

See Also Introduction to NexScript and Python Programming Function Categories

Page 256

Page 259: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.17. ReadBinary

ReadBinary Function Reads a binary value of a specified type from a file.

Syntax number ReadBinary(fileID, valueType)

Parameters

Parameter Type Description

fileID number File ID received from OpenFile function.

valueType string Binary type. Should be "char", "uchar", "short","ushort", "int", "uint", "int64", "uint64", "float" or"number".

Returns The value read from the file. 

Comments None

Usage

NexScript % open binary file in read modefile = OpenFile("C:\Data\binaryfile.dat", "r")% read short (2-byte signed) valueshortValue = ReadBinary(file, "short")CloseFile(file)

Python import nex# open binary file in read modefile = nex.OpenFile("C:\\Data\\binaryfile.dat", "r")# read short (2-byte signed) valueshortValue = nex.ReadBinary(file, "short")nex.CloseFile(file)

See Also Introduction to NexScript and Python Programming Function Categories

Page 257

Page 260: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.18. FileSeek

FileSeek Function Repositions file pointer by the specified offset.

Syntax number FileSeek(fileID, offset, type)

Parameters

Parameter Type Description

fileID number File ID received from OpenFile function.

offset number Number of bytes to move the file pointer.

type string Pointer movement mode. Should be "begin", "current"or "end".

Returns The new byte offset from the beginning of the file. 

Comments FileSeek(file,0,"end") returns file size in bytes. FileSeek(file,0,"current") returns current file position. In Python, you may want to use Python native file.seek()

http://www.tutorialspoint.com/python/file_seek.htm. In Python, backslash character (\) has a special meaning. When specifying a Windows path like"C:\Data\File.nex" in Python, use either "C:/Data/File.nex" or "C:\\Data\\File.nex".

Usage

NexScript % open binary file in read modefile = OpenFile("C:\Data\binaryfile.dat", "r")% get file lengthfileLength = FileSeek(file, 0, "end")% move pointer 4 bytes from the beginning of the filenewPosition = FileSeek(file, 4, "begin")% read short (2-byte signed) valueshortValue = ReadBinary(file, "short")CloseFile(file)

Python import nex# open binary file in read modefile = nex.OpenFile("C:\\Data\\binaryfile.dat", "r")# get file lengthfileLength = nex.FileSeek(file, 0, "end")# move pointer 4 bytes from the beginning of the filenewPosition = nex.FileSeek(file, 4, "begin")# read short (2-byte signed) value

Page 258

Page 261: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

shortValue = nex.ReadBinary(file, "short")nex.CloseFile(file)

See Also Introduction to NexScript and Python Programming Function Categories

Page 259

Page 262: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.19. SelectFile

SelectFile Function Opens File Open dialog and returns the path of the file selected in the dialog.

Syntax string SelectFile()

Returns Returns the path of the file selected in File Open dialog.

Comments None

Usage

NexScript path = SelectFile()% if the user pressed Cancel in file dialog, the returned path is emptyif StrLength(path) > 0 % open file for reading file = OpenFile(path, "r") line = "" % read the first line of the file ReadLine(file, line) Trace(line) CloseFile(file)end

Python import nexpath = nex.SelectFile()# if the user pressed Cancel in file dialog, the returned path is emptyif len(path) > 0: # open file for reading file = open(path, "r") # read the first line of the file line = file.readline() print(line) file.close()

See Also Introduction to NexScript and Python Programming Function Categories

Page 260

Page 263: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.20. SelectFiles

SelectFiles Function Opens File Open dialog with multiple selection option and returns the list of file paths selected in thedialog. To select multiple files in the dialog, use Ctrl+Mouse_Click or Shift+Mouse_Click

Syntax list SelectFiles(initialDirectory, extension)

Parameters

Parameter Type Description

initialDirectory string Optional parameter that specifies initial directory forFile Open dialog.

extension string Optional parameter that specifies file extension for FileOpen dialog.

Returns Returns the list of file paths selected in the File Open dialog. If the user pressed Cancel in File Opendialog, the returned list is empty.

Comments None

Usage

Python import nex# default initial directory and show all files in dialogfiles = nex.SelectFiles()# default initial directory and show only .nex5 files in dialogfiles = nex.SelectFiles(extension='nex5')# open files in directory 'C:/MyData' and show only .nex5 files in dialogfiles = nex.SelectFiles(initialDirectory='C:/MyData', extension='nex5') # run the same analysis (Detect Spikes) on all selected filesfor filePath in files: doc = nex.OpenDocument(filePath) nex.DeselectAll(doc) # select all continuous variables contNames = doc.ContinuousNames() for name in contNames: nex.Select(doc, doc[name]) # run DetectSpikes analysis nex.ApplyTemplate(doc, 'Default\\DetectSpikes') # save results in new .nex5 file newName = os.path.splitext(filePath)[0] + "_spikes.nex5" nex.SaveDocumentAs(doc, newName) nex.CloseDocument(doc)

Page 261

Page 264: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

See Also Introduction to NexScript and Python Programming Function Categories

Page 262

Page 265: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.1.21. OpenSavedResult

OpenSavedResult Script Function Opens a saved result file with the specified path.

Syntax OpenSavedResult(string filePath)

Parameters

Parameter Type Description

filePath string A full path of a saved result (.nexresult) file or analysistemplate (.ntp) file. Use SaveResults|RestoreAnalysis in NeuroExplorer menu command torestore analysis saved in the result file. You can alsouse the script commands saved in history.py file.

Returns None

Comments Analysis template files can be used in two functions: ApplyTemplate and OpenSavedResult. Here are thedifferences: - The template file used in OpenSavedResult needs to have the data file path and the list of selectedvariables specified within the template file - ApplyTemplate command ignores the data file path and the list of selected variables specified within thetemplate file

Usage

NexScript OpenSavedResult("C:\Data\MyResult.nexresult")

Python import nexnex.OpenSavedResult("C:\\Data\\MyResult.nexresult")

See Also Introduction to NexScript and Python Programming Function Categories

Page 263

Page 266: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2. Document Properties Functions The following document properties functions are available in NexScript and Python

Function Description

GetDocPath Returns the full path of the data file.

GetDocTitle Returns the data file name.

GetTimestampFrequency Returns the frequency used in the specified file to store thetimestamps.

GetDocEndTime Returns the maximum timestamp value (in seconds) for all thedocument variables.

SetDocEndTime Sets the length of experimental session (in seconds) for thedocument.

GetDocComment Returns the document comment string.

Functions returning lists of variable

names and lists of variables

Functions returning lists of variable names and lists of variables.

GetSelVarNames Returns the list of selected variables in the document. The following document properties functions are available in Python only

Function Description

GetAllNumericalResults Returns the list of all numerical results.

GetAllNumResSummaryData Returns the list of all the values of the summary of numericalresults.

GetNumResColumnNames Returns the list of column names in the Numerical Results windowof the first graphical view of the document.

GetNumResSummaryColumnNam

es

Returns the list of column names in the Summary of NumericalResults Window of the first graphical view of the document.

SetProperty Sets a document property. Can be used to specify custom Y axisminimums and maximums.

Functions returning lists of variable

names and lists of variables

Functions returning lists of variable names and lists of variables.

GetSelVarNames Returns the list of selected variables in the document.

See Also Introduction to NexScript and Python Programming Function Categories

Page 264

Page 267: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.1. GetDocPath

GetDocPath Function Returns the full path of the data file.

Syntax string GetDocPath(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns Returns the full path of the data file.

Comments None

Usage

NexScript doc = GetActiveDocument()path = GetDocPath(doc)

Python import nexdoc = nex.GetActiveDocument()path = nex.GetDocPath(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 265

Page 268: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.2. GetDocTitle

GetDocTitle Function Returns the data file name.

Syntax string GetDocTitle(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns Returns the data file name. For example, if the document has the path "C:\Data\data1.nex", this functionwill return "data1.nex"

Comments None

Usage

NexScript doc = GetActiveDocument()fileName = GetDocTitle(doc)

Python import nexdoc = nex.GetActiveDocument()fileName = nex.GetDocTitle(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 266

Page 269: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.3. GetTimestampFrequency

GetTimestampFrequency Function Returns the frequency used in the internal representation of the timestamps.

Syntax number GetTimestampFrequency(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns Returns the frequency used in the specified file to store the timestamps.

Comments Internally, the timestamps are stored as integers representing the number of time ticks from the start ofthe experiment. The time tick is equal to 1./Timestamp_Frequency.

Usage

NexScript doc = GetActiveDocument()tsFreq = GetTimestampFrequency(doc)

Python import nexdoc = nex.GetActiveDocument()tsFreq = nex.GetTimestampFrequency(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 267

Page 270: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.4. GetDocEndTime

GetDocEndTime Function Returns the maximum timestamp value (in seconds) for all the document variables.

Syntax number GetDocEndTime(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns Returns the maximum timestamp value (in seconds) for all the document variables.

Comments None

Usage

NexScript doc = GetActiveDocument()endTime = GetDocEndTime(doc)

Python import nexdoc = nex.GetActiveDocument()endTime = nex.GetDocEndTime(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 268

Page 271: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.5. SetDocEndTime

SetDocEndTime Function Sets the length of experimental session for the document.

Syntax SetDocEndTime(doc, endtime)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

endtime number Document end time in seconds.

Returns None

Comments NeuroExplorer determines document end time when the document is loaded. Then, the duration ofexperimental session (endTime - startTime) may be used in the calculations of the confidence limits. If

your script modifies or adds the variables, you may need to set the document end time directly to

maintain correctness of the confidence calculations. 

Usage

NexScript doc = GetActiveDocument()SetDocEndTime(doc, 1200.3)

Python import nexdoc = nex.GetActiveDocument()nex.SetDocEndTime(doc, 1200.3)

See Also Introduction to NexScript and Python Programming Function Categories

Page 269

Page 272: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.6. GetDocComment

GetDocComment Function Returns the document comment string.

Syntax string GetDocComment(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns Returns the document comment string.

Comments None

Usage

NexScript doc = GetActiveDocument()comment = GetDocComment(doc)Trace(comment)

Python import nexdoc = nex.GetActiveDocument()comment = nex.GetDocComment(doc)print comment

See Also Introduction to NexScript and Python Programming Function Categories

Page 270

Page 273: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.7. NeuronNames Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 271

Page 274: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 272

Page 275: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 273

Page 276: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.8. EventNames Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 274

Page 277: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 275

Page 278: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 276

Page 279: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.9. IntervalNames Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 277

Page 280: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 278

Page 281: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 279

Page 282: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.10. WaveNames Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 280

Page 283: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 281

Page 284: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 282

Page 285: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.11. MarkerNames Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 283

Page 286: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 284

Page 287: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 285

Page 288: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.12. ContinuousNames Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 286

Page 289: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 287

Page 290: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 288

Page 291: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.13. NeuronVars Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 289

Page 292: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 290

Page 293: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 291

Page 294: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.14. EventVars Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 292

Page 295: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 293

Page 296: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 294

Page 297: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.15. IntervalVars Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 295

Page 298: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 296

Page 299: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 297

Page 300: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.16. WaveVars Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 298

Page 301: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 299

Page 302: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 300

Page 303: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.17. MarkerVars Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 301

Page 304: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 302

Page 305: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 303

Page 306: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.18. ContinuousVars Returns the list of neuron names in the document.

Syntax list doc.NeuronNames()

Returns Returns the list of neuron names in the document. import nexdoc = nex.GetActiveDocument()namesOfNeurons = doc.NeuronNames() Returns the list of event variable names in the document.

Syntax list doc.EventNames()

Returns Returns the list of event variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfEvents = doc.EventNames() Returns the list of interval variable names in the document.

Syntax list doc.IntervalNames()

Returns Returns the list of interval variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfIntervalVars = doc.IntervalNames() Returns the list of waveform variable names in the document.

Syntax list doc.WaveNames()

Returns Returns the list of waveform variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfWaveformVars = doc.WaveNames() Returns the list of marker variable names in the document.

Syntax list doc.MarkerNames()

Page 304

Page 307: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Returns Returns the list of marker variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfMarkerVars = doc.MarkerNames() Returns the list of continuous variable names in the document.

Syntax list doc.ContinuousNames()

Returns Returns the list of continuous variable names in the document. import nexdoc = nex.GetActiveDocument()namesOfContVars = doc.ContinuousNames() Returns the list of neuron variables in the document.

Syntax list doc.NeuronVars()

Returns Returns the list of neuron variables in the document. import nexdoc = nex.GetActiveDocument()neuronVars = doc.NeuronVars() Returns the list of event variables in the document.

Syntax list doc.EventVars()

Returns Returns the list of event variables in the document. import nexdoc = nex.GetActiveDocument()eventVars = doc.EventVars() Returns the list of interval variables in the document.

Syntax list doc.IntervalVars()

Returns Returns the list of interval variables in the document. import nexdoc = nex.GetActiveDocument()intervalVars = doc.IntervalVars() Returns the list of waveform variables in the document.

Page 305

Page 308: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Syntax list doc.WaveVars()

Returns Returns the list of waveform variables in the document. import nexdoc = nex.GetActiveDocument()waveformVars = doc.WaveVars() Returns the list of marker variables in the document.

Syntax list doc.MarkerVars()

Returns Returns the list of marker variables in the document. import nexdoc = nex.GetActiveDocument()markerVars = doc.MarkerVars() Returns the list of continuous variables in the document.

Syntax list doc.ContinuousVars()

Returns Returns the list of continuous variables in the document. import nexdoc = nex.GetActiveDocument()contVars = doc.ContinuousVars()

See Also Introduction to NexScript and Python Programming Function Categories

Page 306

Page 309: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.2.19. GetSelVarNames

GetSelVarNames NexDoc Method Returns the list of selected variables in the document.

Syntax doc.GetSelVarNames()

Returns Returns the list of selected variables in the document.

Usage

Python import nexdoc = nex.GetActiveDocument()selNames = doc.GetSelVarNames()

See Also Introduction to NexScript and Python Programming Function Categories

Page 307

Page 310: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3. Document Variables Functions The following document variables functions are available in NexScript and Python

Function Description

GetVarCount Returns the number of variables of the specified type in the file.

GetVarName Returns a string -- the name of the variable of the specified type inthe file.

GetVarSpikeCount Returns the number of timestamps in the variable.

GetVar Returns the reference to the specified variable.

Functions returning lists of variable

names and lists of variables

Functions returning lists of variable names and lists of variables.

DeleteVar Deletes the specified variable from the file.

Delete Deletes the specified variable from the file.

GetVarByName Returns the reference to the variable which has the specifiedname.

NewEvent Creates a new timestamped variable.

NewIntEvent Creates a new interval variable.

NewPopVector Creates a new population vector.

GetContNumDataPoints Returns the number of data points in the continuous variable.

NewContVar Creates a new continuous variable.

CopySelectedVarsToAnotherFile Copies selected variables from one file to another.

NewContVarWithFloats Creates a new continuous variable, returns a reference to the newvariable. frequency specifies the sampling frequency of the newvariable (in Hz).

ContVarStoreValuesAsFloats Converts storage of continuous values from 16-bit integers to 32-bit floats.

SetContVarTimestampsAndValues Sets the timestamps and continuous values of a NexVar objectrepresenting continuous variable.

CreateWaveformVariable Creates a new waveform variable with specified values.

ContMin Returns minimum of continuous values of the NexVar objectrepresenting continuous variable.

ContMax Returns maximum of continuous values of the NexVar objectrepresenting continuous variable.

ContMean Returns the mean of continuous values of the NexVar objectrepresenting continuous variable.

ContAdd Creates a new continuous variable with valuescontVar[i]+numberToAdd, returns a reference to the new variable.

ContMult Creates a new continuous variable with values

Page 308

Page 311: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

contVar[i]*numberToMultiply, returns a reference to the newvariable.

ContAddCont Creates a new continuous variable with valuescontVar1[i]+contVar2[i], returns a reference to the new variable.

GetName Returns the name of the variable.

GetSpikeCount Returns the number of timestamps in the variable.

AddTimestamp Adds a new timestamp to the specified variable.

SetNeuronType Changes the type of the timestamp variable to either 'neuron' or'event'.

AddContValue Adds a new data point to the specified continuous variable.

AddInterval Adds a new interval to the specified interval variable.

Name Returns the name of the NexVar object.

Metadata Returns metadata of the NexVar object.

SamplingRate Returns the sampling rate of the NexVar object representingcontinuous channel.

NumPointsInWave Returns the number of data points in each waveform of the NexVarobject representing waveform variable.

Timestamps Returns the list of all the timestamps of the NexVar object.

Intervals Returns the list of all the intervals of the NexVar objectrepresenting interval variable.

ContinuousValues Returns the list of all continuous values of the NexVar objectrepresenting continuous variable.

FragmentTimestamps Returns the list of fragment timestamps of the NexVar objectrepresenting continuous variable.

FragmentCounts Returns the list of fragment counts (numbers of data points in eachfragment) of the NexVar object representing continuous variable.

WaveformValues Returns the list of waveform values of the NexVar objectrepresenting waveform variable.

Markers Returns the list of marker values of the NexVar object representingmarker variable.

MarkerFieldNames Returns the list of marker field names of the NexVar objectrepresenting marker variable.

SetContVarTimestampsAndValues Sets the timestamps and continuous values of a NexVar objectrepresenting continuous variable.

SetTimestamps Sets the timestamps of a NexVar object representing event orneuron.

SetNeuronPosition Sets the position (used in 3D displays) of a neuron variable.

See Also

Page 309

Page 312: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Introduction to NexScript and Python Programming Function Categories

Page 310

Page 313: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.1. GetVarCount

GetVarCount Function Returns the number of variables of the specified type in the file.

Syntax number GetVarCount(doc, varType)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

varType string Variable type. Should be "neuron", "neuronorevent" ,"event", "interval" "wave", "popvector", "continuous","marker" or "all".

Returns Returns the number of variables of the specified type in the file.

Comments None

Usage

NexScript doc = GetActiveDocument()% get the number of continuous variablesnumContVars = GetVarCount(doc, "continuous")

Python import nexdoc = nex.GetActiveDocument()# get the number of continuous variablesnumContVars = nex.GetVarCount(doc, "continuous")

See Also Introduction to NexScript and Python Programming Function Categories

Page 311

Page 314: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.2. GetVarName

GetVarName Function Returns the name of the specified variable.

Syntax string GetVarName(doc, varNumber, varType)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

varNumber number 1-based variable number within the group specified byvarType.

varType string Variable type. Should be "neuron", "neuronorevent" ,"event", "interval" "wave", "popvector", "continuous","marker" or "all".

Returns Returns the name of the specified variable.

Comments None

Usage

NexScript doc = GetActiveDocument()% get the name of the first event variablename = GetVarName(doc, 1, "event")

Python import nexdoc = nex.GetActiveDocument()# get the name of the first event variablename = nex.GetVarName(doc, 1, "event")

See Also Introduction to NexScript and Python Programming Function Categories

Page 312

Page 315: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.3. GetVarSpikeCount

GetVarSpikeCount Function Returns the number of timestamps in the specified variable.

Syntax number GetVarSpikeCount(doc, varNumber, varType)

Parameters

Parameter Type Description

doc documentReference Reference to the document

varNumber number 1-based variable number within the group specified byvarType.

varType string Variable type. Should be "neuron", "neuronorevent","event", "interval", "wave", "continuous", "marker" or"all".

Returns Returns the number of timestamps in the variable. For a continuous variable, returns the number offragments.

Comments None

Usage

NexScript doc = GetActiveDocument()numSpikes = GetVarSpikeCount(doc, 3, "neuron")

Python import nexdoc = nex.GetActiveDocument()numSpikes = nex.GetVarSpikeCount(doc, 3, "neuron")

See Also Introduction to NexScript and Python Programming Function Categories

Page 313

Page 316: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.4. GetVar

GetVar Function Returns the reference to the specified variable.

Syntax variableReference GetVar(doc, varNumber, varType)

Parameters

Parameter Type Description

doc documentReference Reference to the document

varNumber number 1-based variable number within the group specified byvarType.

varType string Variable type. Should be "neuron", "neuronorevent" ,"event", "interval" "wave", "popvector", "continuous","marker" or "all".

Returns Returns the reference to the specified variable.

Comments None

Usage

NexScript doc = GetActiveDocument()% get the second event variableevent = GetVar(doc, 2, "event")

Python import nexdoc = nex.GetActiveDocument()# get the second event variableevent = nex.GetVar(doc, 2, "event")

See Also Introduction to NexScript and Python Programming Function Categories

Page 314

Page 317: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.5. DeleteVar

DeleteVar Function Deletes the specified variable from the file.

Syntax DeleteVar(doc, number, varType)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

number number 1-based variable number within the group specified byvarType.

varType string Variable type. Should be "neuron", "neuronorevent" ,"event", "interval" "wave", "popvector", "continuous","marker" or "all".

Returns None

Comments All the analysis windows are closed before executing this function. Please note that this functionproduces an immediate result - after the execution of this function, the number of variables of thespecified type is reduced by 1. Therefore, you cannot use a simple for loop to delete all the variables of acertain type. You can use while loop as shown in the example script below. 

Usage

NexScript doc = GetActiveDocument()% delete the first continuous variableDeleteVar(doc, 1, "continuous") % delete all waveform variables% note that we always delete the first variablewhile GetVarCount(doc, "wave") > 0 DeleteVar(doc, 1, "wave")end

Python import nexdoc = nex.GetActiveDocument()# delete the first continuous variablenex.DeleteVar(doc, 1, "continuous") # delete all waveform variables# note that we always delete the first variable

Page 315

Page 318: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

while nex.GetVarCount(doc, "wave") > 0: nex.DeleteVar(doc, 1, "wave")

See Also Introduction to NexScript and Python Programming Function Categories

Page 316

Page 319: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.6. Delete

Delete Function Deletes the specified variable from the file.

Syntax Delete(doc, var)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

var variableReference Reference to the variable.

Returns None

Comments All the analysis windows are closed before executing this function.

Usage

NexScript doc = GetActiveDocument()var = GetVarByName(doc, "Event04")Delete(doc, var)

Python import nexdoc = nex.GetActiveDocument()var = nex.GetVarByName(doc, "Event04")nex.Delete(doc, var)

See Also Introduction to NexScript and Python Programming Function Categories

Page 317

Page 320: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.7. GetVarByName

GetVarByName Function Returns the reference to the variable which has the specified name.

Syntax variableReference GetVarByName(doc, name)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

name string Variable name.

Returns Returns the reference to the variable which has the specified name.

Comments None

Usage

NexScript doc = GetActiveDocument()% get the variable with the name TrialStartstart = GetVarByName(doc, "TrialStart")

Python import nexdoc = nex.GetActiveDocument()# get the variable with the name TrialStartstart = nex.GetVarByName(doc, "TrialStart")

See Also Introduction to NexScript and Python Programming Function Categories

Page 318

Page 321: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.8. NewEvent

NewEvent Function Creates a new timestamped variable.

Syntax variableReference NewEvent(doc, count)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

count number Initial number of the timestamps in the document.

Returns Returns a reference to the new variable.

Comments None

Usage

NexScript doc = GetActiveDocument()temp = NewEvent(doc, 10) % creates a script-only variabledoc["NewVar"] = NewEvent(doc, 0) % creates a new variable in the file

Python import nexdoc = nex.GetActiveDocument()temp = nex.NewEvent(doc, 10) # creates a script-only variabledoc["NewVar"] = nex.NewEvent(doc, 0) # creates a new variable in the file

See Also Introduction to NexScript and Python Programming Function Categories

Page 319

Page 322: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.9. NewIntEvent

NewIntEvent Function Creates a new interval variable.

Syntax variableReference NewIntEvent(doc, count)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

count number Initial number of intervals in the variable. Thisparameter is optional.

Returns Returns a reference to the new variable.

Comments If initial number of intervals is positive, intervals are initialized with values [0, 0.5], [1, 1.5], etc.

Usage

NexScript The following script creates a new interval variable that has two intervals: from 0 to 100 seconds andfrom 200 to 300 seconds: doc = GetActiveDocument()doc["MyInterval"] = NewIntEvent(doc)AddInterval(doc["MyInterval"], 0., 100.)AddInterval(doc["MyInterval"], 200., 300.)

Python import nexdoc = nex.GetActiveDocument()doc["MyInterval"] = nex.NewIntEvent(doc)nex.AddInterval(doc["MyInterval"], 0., 100.)nex.AddInterval(doc["MyInterval"], 200., 300.)

See Also Introduction to NexScript and Python Programming Function Categories

Page 320

Page 323: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.10. NewPopVector

NewPopVector Function Creates a new population vector.

Syntax variableReference NewPopVector(doc, type)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

type number if type = 0, all weights of the new vector are equal tozero.

Returns Returns a reference to the new vector.

Comments None

Usage

NexScript doc = GetActiveDocument()doc["neuronAverage"] = NewPopVector(doc, 1)

Python import nexdoc = nex.GetActiveDocument()doc["neuronAverage"] = nex.NewPopVector(doc, 1)

See Also Introduction to NexScript and Python Programming Function Categories

Page 321

Page 324: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.11. GetContNumDataPoints

GetContNumDataPoints Function Returns the number of data points in the continuous variable.

Syntax number GetContNumDataPoints(var)

Parameters

Parameter Type Description

var variableReference Reference to a continuous variable.

Returns Returns the number of data points in the continuous variable.

Comments None

Usage

NexScript doc = GetActiveDocument()var = GetVarByName(doc, "AD_01")numPoints = GetContNumDataPoints(var)

Python import nexdoc = nex.GetActiveDocument()var = nex.GetVarByName(doc, "AD_01")numPoints = nex.GetContNumDataPoints(var)

See Also Introduction to NexScript and Python Programming Function Categories

Page 322

Page 325: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.12. NewContVar

NewContVar Function Creates a new continuous variable.

Syntax variableReference NewContVar(doc, frequency, mVmin, mVmax)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

frequency number Specifies the sampling frequency of the new variable(in Hz).

mVmin number Minimum of the values of the new variable (inmilliVolts).

mVmax number Maximum of the values of the new variable (inmilliVolts).

Returns Returns a reference to the new variable.

Comments When you use this function, NeuroExplorer will store the values of the new continuous variable as scaled2-byte integers. Specifying minimum and maximum of the variable values helps to determine the correctscaling factor for the new variable.   It is recommended that you use NewContVarWithFloats function instead of this function.

Usage

NexScript doc = GetActiveDocument()freq = 1000.% create new variable in the filedoc["SinValues"] = NewContVar(doc, freq, -500.,500.)% add the values to the new variablefor i = 1 to 10000 % timestamp ts = i/freq % value value = 500.*sin(ts) AddContValue(doc["SinValues"], ts, value)end

Python import neximport math

Page 323

Page 326: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

doc = nex.GetActiveDocument()freq = 1000.# create new variable in the filedoc["SinValues"] = nex.NewContVar(doc, freq, - 500., 500.)# add the values to the new variablefor i in range( int(1), int(10000) + 1): # timestamp ts = i / freq # value value = 500. * math.sin(ts) nex.AddContValue(doc["SinValues"], ts, value)

See Also Introduction to NexScript and Python Programming Function Categories

Page 324

Page 327: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.13. CopySelectedVarsToAnotherFile

CopySelectedVarsToAnotherFile Function Copies selected variables from one file to another.

Syntax CopySelectedVarsToAnotherFile(fromDoc, toDoc)

Parameters

Parameter Type Description

fromDoc documentReference Reference to the document. The variables are copiedfrom this document.

toDoc documentReference Reference to the document. The variables are copiedto this document.

Returns None

Comments In Python, backslash character (\) has a special meaning. When specifying a Windows path like"C:\Data\File.nex" in Python, use either "C:/Data/File.nex" or "C:\\Data\\File.nex".

Usage

NexScript fromDoc = OpenDocument("C:\Data\File1.nex")toDoc = OpenDocument("C:\Data\File2.nex")% copy all events from fromDoc to toDoc% first, select all eventsSelectAllEvents(fromDoc)% call CopySelectedVarsToAnotherFileCopySelectedVarsToAnotherFile(fromDoc, toDoc)

Python import nexfromDoc = nex.OpenDocument("C:\\Data\\File1.nex")toDoc = nex.OpenDocument("C:\\Data\\File2.nex")# copy all events from fromDoc to toDoc# first, select all eventsnex.SelectAllEvents(fromDoc)# call CopySelectedVarsToAnotherFilenex.CopySelectedVarsToAnotherFile(fromDoc, toDoc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 325

Page 328: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.14. NewContVarWithFloats

NewContVarWithFloats Function Creates a new continuous variable, returns a reference to the new variable. Frequency specifies thesampling frequency of the new variable (in Hz).

Syntax variableReference NewContVarWithFloats(doc, frequency)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

frequency number Sampling frequency of the new variable (in Hz).

Returns Creates a new continuous variable, returns a reference to the new variable. frequency specifies thesampling frequency of the new variable (in Hz).

Comments None

Usage

NexScript doc = GetActiveDocument()freq = 1000.% create new variable in the filedoc["SinValues"] = NewContVarWithFloats(doc, freq)% add the values to the new variablefor i = 1 to 10000 % timestamp ts = i/freq % value value = 500.*sin(ts) AddContValue(doc["SinValues"], ts, value)end

Python import neximport mathdoc = nex.GetActiveDocument()freq = 1000.# create new variable in the filedoc["SinValues"] = nex.NewContVarWithFloats(doc, freq)# add the values to the new variablefor i in range( int(1), int(10000) + 1): # timestamp ts = i / freq # value value = 500. * math.sin(ts)

Page 326

Page 329: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

nex.AddContValue(doc["SinValues"], ts, value)

See Also Introduction to NexScript and Python Programming Function Categories

Page 327

Page 330: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.15. ContVarStoreValuesAsFloats

ContVarStoreValuesAsFloats Function Converts storage of continuous values from 16-bit integers to 32-bit floats.

Syntax ContVarStoreValuesAsFloats(contVar)

Parameters

Parameter Type Description

contVar variableReference Reference to the variable.

Returns None

Comments When you assign a value to a continuous variable that was imported from a file created by a dataacquisition system, the assigned value might be clipped. Data acquisition systems usually store continuous values as 2-byte integers. NeuroExplorer also storesimported analog data as 2-byte integers with some scaling factors. For example, if analog to digital converter has input range from -1000mV to +1000mV, then maximum 2-byte value 32767 corresponds to 1000mV and the scaling factor is 1000/32768. If we try to assign thevalue that is outside the original input range, the value has to be clipped so that it could be stored as a 2-byte integer (for example, if we try to assign 2000mV, the stored value will be 32767 or 1000mV). To avoid data clipping, use ContVarStoreValuesAsFloats function to convert 2-byte integer storage to4-byte float storage that does not have clipping problems.

Usage

NexScript doc["FP01_Rectified"] = doc["FP01"]rectified = doc["FP01_Rectified"]ContVarStoreValuesAsFloats( rectified )n = GetContNumDataPoints( rectified )for i=1 to n rectified[i,2] = abs( rectified[i,2] )end

Python import nexdoc["FP01_Rectified"] = doc["FP01"]rectified = doc["FP01_Rectified"]nex.ContVarStoreValuesAsFloats(rectified)n = nex.GetContNumDataPoints(rectified)for i in range( 1, int(n) + 1): rectified[i, 2] = abs(rectified[i, 2])

Page 328

Page 331: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

See Also Introduction to NexScript and Python Programming Function Categories

Page 329

Page 332: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.16. CreateWaveformVariable

CreateWaveformVariable NexDoc Method Creates a new waveform variable with specified values.

Syntax doc.CreateWaveformVariable(name, waveformSamplingRate, timestamps, waveformValues)

Parameters

Parameter Type Description

name string The name of the variable

waveformSamplingRate number Waveform sampling rate (sampling rate of thecontinuous channel that was used to extractwaveforms).

timestamps list List of timestamps in seconds.

waveformValues list of lists List of waveform values in milliVolts. Each sub-listrepresents a single waveform (values should be inmilliVolts). See sample code below.

Returns None

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()# create waveform variable with 2 waveforms:# waveform 1: timestamp = 10s; waveform values are 2, 3, 4 and 1 (mV)# waveform 2: timestamp = 20s; waveform values are 5, 6, 7 and 2 (mV)doc.CreateWaveformVariable('ScriptGenerated', 40000, [10,20], [ [2,3,4,1], [5,6,7,2]] )

See Also Introduction to NexScript and Python Programming Function Categories

Page 330

Page 333: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.17. ContMin

ContMin Script Function Returns minimum of continuous values of the NexVar object representing continuous variable.

Syntax ContMin()

Parameters None

Returns Returns minimum of continuous values of the NexVar object representing continuous variable.

Comments

Usage

Python import nexdoc = nex.GetActiveDocument()minFP01 = doc['FP01'].ContMin()

See Also Introduction to NexScript and Python Programming Function Categories

Page 331

Page 334: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.18. ContMax

ContMax Script Function Returns maximum of continuous values of the NexVar object representing continuous variable.

Syntax ContMax()

Parameters None

Returns Returns maximum of continuous values of the NexVar object representing continuous variable.

Comments

Usage

Python import nexdoc = nex.GetActiveDocument()maxFP01 = doc['FP01'].ContMax()

See Also Introduction to NexScript and Python Programming Function Categories

Page 332

Page 335: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.19. ContMean

ContMean Script Function Returns the mean of continuous values of the NexVar object representing continuous variable.

Syntax ContMean()

Parameters None

Returns Returns the mean of continuous values of the NexVar object representing continuous variable.

Comments

Usage

Python import nexdoc = nex.GetActiveDocument()meanFP01 = doc['FP01'].ContMean()

See Also Introduction to NexScript and Python Programming Function Categories

Page 333

Page 336: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.20. ContAdd

ContAdd Script Function Creates a new continuous variable with values contVar[i]+numberToAdd, returns a reference to the newvariable.

Syntax variableReference ContAdd(contVar, numberToAdd)

Parameters

Parameter Type Description

contVar variableReference Reference to the variable.

numberToAdd number The number to add to each value of the contVar

Returns Creates a new continuous variable with values contVar[i]+numberToAdd, returns a reference to the newvariable.

Comments

Usage

NexScript doc = GetActiveDocument()baseLine = 10.0doc["subtractedBaseLine"] = ContAdd(doc["FP01"], -baseLine)

Python import nexdoc = nex.GetActiveDocument()baseLine = 10.0doc["subtractedBaseLine"] = nex.ContAdd(doc["FP01"], -baseLine) # you can also use arithmetic operations on continuous variables:doc["subtractedBaseLine"] = doc["FP01"] - baseLine doc["average of FP01 and FP02"] = ( doc["FP01"] + doc["FP02"] ) / 2

See Also Introduction to NexScript and Python Programming Function Categories

Page 334

Page 337: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.21. ContMult

ContMult Script Function Creates a new continuous variable with values contVar[i]*numberToMultiply, returns a reference to thenew variable.

Syntax variableReference ContMult(contVar, numberToMultiply)

Parameters

Parameter Type Description

contVar variableReference Reference to the variable.

numberToMultiply number The result values will be contVar[i]*numberToMultiply.

Returns Creates a new continuous variable with values contVar[i]*numberToMultiply, returns a reference to thenew variable.

Comments

Usage

NexScript doc = GetActiveDocument()coeff = -1.0doc["invertedFP01"] = ContMult(doc["FP01"], coeff)

Python import nexdoc = nex.GetActiveDocument()coeff = -1.0doc["invertedFP01"] = nex.ContMult(doc["FP01"], coeff) # you can also use arithmetic operations on continuous variables:doc["average of FP01 and FP02"] = ( doc["FP01"] + doc["FP02"] ) / 2

See Also Introduction to NexScript and Python Programming Function Categories

Page 335

Page 338: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.22. ContAddCont

ContAddCont Script Function Creates a new continuous variable with values contVar1[i]+contVar2[i], returns a reference to the newvariable.

Syntax variableReference ContAddCont(contVar1, contVar2)

Parameters

Parameter Type Description

contVar1 variableReference Reference to the continuous variable.

contVar2 variableReference Reference to the continuous variable. contVar1 andcontVar2 should have the same number of continuousvalues.

Returns Creates a new continuous variable with values contVar1[i]+contVar2[i], returns a reference to the newvariable. The timestamps of the new variable are copied from contVar1. Timestamps of contVar2 areignored.

Comments

Usage

NexScript doc = GetActiveDocument()theSumOfFP1andFP2 = ContAddCont(doc["FP01"], doc["FP02"])

Python import nexdoc = nex.GetActiveDocument()theSumOfFP1andFP2 = nex.ContAddCont(doc["FP01"], doc["FP02"]) # you can also use arithmetic operations on continuous variables:doc["average of FP01 and FP02"] = ( doc["FP01"] + doc["FP01"] ) / 2

See Also Introduction to NexScript and Python Programming Function Categories

Page 336

Page 339: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.23. GetName

GetName Function Returns the name of the variable.

Syntax string GetName(var)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

Returns Returns the name of the variable.

Comments None

Usage

NexScript doc = GetActiveDocument()% get the first neuron variablevar = GetVar(doc, 1, "neuron")% get the variable namename = GetName(var)

Python import nexdoc = nex.GetActiveDocument()# get the first neuron variablevar = nex.GetVar(doc, 1, "neuron")# get the variable namename = nex.GetName(var)

See Also Introduction to NexScript and Python Programming Function Categories

Page 337

Page 340: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.24. GetSpikeCount

GetSpikeCount Function Returns the number of timestamps in the variable.

Syntax number GetSpikeCount(var)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

Returns Returns the number of timestamps in the variable. For a continuous variable, returns the number offragments.

Comments None

Usage

NexScript doc = GetActiveDocument()count = GetSpikeCount( doc["Neuron04a"] )

Python import nexdoc = nex.GetActiveDocument()count = nex.GetSpikeCount(doc["Neuron04a"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 338

Page 341: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.25. AddTimestamp

AddTimestamp Function Adds a new timestamp to the specified event or neuron variable.

Syntax AddTimestamp(var, timestamp)

Parameters

Parameter Type Description

var  variableReference Reference to the event or neuron variable.

timestamp number New timestamp (in seconds).

Returns None

Comments The new timestamp should not be equal to one of the existing timestamps of the specified variable.

Usage

NexScript doc = GetActiveDocument()eventVar = GetVarByName(doc, "Event04")% add timestamp at 1.5 secondsAddTimestamp(eventVar, 1.5)

Python import nexdoc = nex.GetActiveDocument()eventVar = nex.GetVarByName(doc, "Event04")# add timestamp at 1.5 secondsnex.AddTimestamp(eventVar, 1.5)

See Also Introduction to NexScript and Python Programming Function Categories

Page 339

Page 342: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.26. SetNeuronType

SetNeuronType Function 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', iftype is zero or negative, the variable type is set to'event'.

Returns None

Comments Neuron and event types are almost identical. The main difference is that when a data file is opened byNeuroExplorer, 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. NewEvent

creates an event variable and the variable type can later be changed to 'neuron' using SetNeuronType. 

Usage

NexScript doc = GetActiveDocument()doc["neuron1"] = NewEvent(doc, 0)SetNeuronType(doc, doc["neuron1"], 1)

Python import nexdoc = nex.GetActiveDocument()doc["neuron1"] = nex.NewEvent(doc, 0)nex.SetNeuronType(doc, doc["neuron1"], 1)

See Also Introduction to NexScript and Python Programming Function Categories

Page 340

Page 343: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.27. AddContValue

AddContValue Function Adds a new data point to the specified continuous variable

Syntax AddContValue(var, timestamp, value)

Parameters

Parameter Type Description

var variableReference Reference to the continuous variable.

timestamp number Timestamp value in seconds.

value number Voltage value in milliVolts.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()contVar = GetVarByName(doc, "ContVar1")% add voltage value of 25.7 mV at the time 100.3 secondsAddContValue(contVar, 100.3, 25.7)

Python import nexdoc = nex.GetActiveDocument()contVar = nex.GetVarByName(doc, "ContVar1")# add voltage value of 25.7 mV at the time 100.3 secondsnex.AddContValue(contVar, 100.3, 25.7)

See Also Introduction to NexScript and Python Programming Function Categories

Page 341

Page 344: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.28. AddInterval

AddInterval Function Adds a new interval to the specified interval variable.

Syntax AddInterval(var, interval_start, interval_end)

Parameters

Parameter Type Description

var  variableReference Reference to the interval variable.

interval_start  number Start of new interval (in seconds).

interval_end number End of new interval (in seconds).

Returns None

Comments The new interval should not overlap with any of the existing intervals of the specified interval variable.

Usage

NexScript doc = GetActiveDocument()intervalVar = GetVarByName(doc, "CorrectTrials")% add interval [100s,120s]AddInterval(intervalVar, 100, 120)

Python import nexdoc = nex.GetActiveDocument()intervalVar = nex.GetVarByName(doc, "CorrectTrials")# add interval [100s,120s]nex.AddInterval(intervalVar, 100, 120)

See Also Introduction to NexScript and Python Programming Function Categories

Page 342

Page 345: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.29. Name

Name NexVar Object Method Returns the name of the NexVar object.

Syntax string var.Name()

Parameters Name

Returns Returns the name of the NexVar object.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()var = nex.GetVar(doc, 1, 'neuron')print(var.Name())

See Also Introduction to NexScript and Python Programming Function Categories

Page 343

Page 346: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.30. Name

Metadata NexVar Object Method Returns metadata of the NexVar object as Python dictionary.

Syntax pythonDictionary var.Metadata()

Parameters Name

Returns Returns metadata of the NexVar object as Python dictionary (for example, wire and unit number forneuron variable).

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()var = nex.GetVar(doc, 1, 'neuron')meta = var.Metadata()print(meta)

See Also Introduction to NexScript and Python Programming Function Categories

Page 344

Page 347: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.31. SamplingRate

SamplingRate NexVar Method Returns the sampling rate of the NexVar object representing continuous channel.

Syntax number SamplingRate()

Parameters None

Returns Returns the sampling rate of the NexVar object representing continuous channel.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()var = nex.GetVar(doc, 1, 'continuous')print(var.SamplingRate())

See Also Introduction to NexScript and Python Programming Function Categories

Page 345

Page 348: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.32. NumPointsInWave

NumPointsInWave NexVar Method Returns the number of data points in each waveform of the NexVar object representing waveformvariable.

Syntax number var.NumPointsInWave()

Parameters None

Returns Returns the number of data points in each waveform of the NexVar object representing waveformvariable.

Comments Python only

Usage

Python import nexdoc = nex.GetActiveDocument()var = nex.GetVar(doc, 1, 'wave')print var.NumPointsInWave()

See Also Introduction to NexScript and Python Programming Function Categories

Page 346

Page 349: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.33. Timestamps

Timestamps NexVar Method Returns the list of all the timestamps of the NexVar object.

Syntax list var.Timestamps()

Parameters None

Returns Returns the list of all the timestamps of the NexVar object. The timestamp values are in seconds.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()ts = doc['ResponseCorrect'].Timestamps()# print the first timestampprint(ts[0])

See Also Introduction to NexScript and Python Programming Function Categories

Page 347

Page 350: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.34. Intervals

Intervals NexVar Method Returns the list of all the intervals of the NexVar object representing interval variable.

Syntax list var.Intervals()

Parameters None

Returns Returns the list of all the intervals of the NexVar object representing interval variable. The values are inseconds.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()intervals = doc['CorrectTrials'].Intervals()print(intervals)

See Also Introduction to NexScript and Python Programming Function Categories

Page 348

Page 351: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.35. ContinuousValues

ContinuousValues NexVar Method Returns the list of all continuous values of the NexVar object representing continuous variable.

Syntax list var.ContinuousValues()

Parameters None

Returns Returns the list of all continuous values of the NexVar object representing continuous variable. Thevalues are in milliVolts.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()values = doc['FP01'].ContinuousValues()# print first 10 valuesprint(values[0:10])

See Also Introduction to NexScript and Python Programming Function Categories

Page 349

Page 352: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.36. FragmentTimestamps

FragmentTimestamps NexVar Method Returns the list of fragment timestamps of the NexVar object representing continuous variable.

Syntax list var.FragmentTimestamps()

Parameters None

Returns Returns the list of fragment timestamps of the NexVar object representing continuous variable. Thetimestamps are in seconds.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()fts = doc['FP01'].FragmentTimestamps()#print the first fragment timestampprint(fts[0])

See Also Introduction to NexScript and Python Programming Function Categories

Page 350

Page 353: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.37. FragmentCounts

FragmentCounts NexVar Method Returns the list of fragment counts (numbers of data points in each fragment) of the NexVar objectrepresenting continuous variable.

Syntax list var.FragmentCounts()

Parameters None

Returns Returns the list of fragment counts (numbers of data points in each fragment) of the NexVar objectrepresenting continuous variable.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()counts = doc['FP01'].FragmentCounts()#print number of points in the first fragmentprint(counts[0])

See Also Introduction to NexScript and Python Programming Function Categories

Page 351

Page 354: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.38. WaveformValues

WaveformValues NexVar Method Returns the list of waveform values of the NexVar object representing waveform variable.

Syntax list var.WaveformValues()

Parameters None

Returns Returns the list of waveform values of the NexVar object representing waveform variable.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()waveforms = doc['sig001a_wf'].WaveformValues()#print the values of the first waveformprint(waveforms[0])

See Also Introduction to NexScript and Python Programming Function Categories

Page 352

Page 355: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.39. Markers

Markers NexVar Method Returns the list of marker values of the NexVar object representing marker variable.

Syntax list var.Markers()

Parameters

Parameter Type Description

Returns Returns the list of marker values of the NexVar object representing marker variable.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()markerValues = doc['Strobed'].Markers()#print the second marker value of the first marker fieldprint(markerValues[0][1])

See Also Introduction to NexScript and Python Programming Function Categories

Page 353

Page 356: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.40. MarkerFieldNames

MarkerFieldNames NexVar Method Returns the list of marker field names of the NexVar object representing marker variable.

Syntax list var.MarkerFieldNames()

Parameters None

Returns Returns the list of marker field names of the NexVar object representing marker variable.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()fieldNames = doc['Strobed'].MarkerFieldNames()#print the name of the first marker fieldprint(fieldNames[0])

See Also Introduction to NexScript and Python Programming Function Categories

Page 354

Page 357: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.41. SetContVarTimestampsAndValues

SetContVarTimestampsAndValues NexVar Method Sets the timestamps and continuous values of a NexVar object representing continuous variable.

Syntax var.SetContVarTimestampsAndValues(timestamps, values)

Parameters

Parameter Type Description

timestamps list list containing timestamps in seconds.

values list list containing values in milliVolts.

Returns None

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()doc["ScriptGenerated"] = nex.NewContVarWithFloats(doc, 1000)doc["ScriptGenerated"].SetContVarTimestampsAndValues([0,0.001,0.002],[1,2,22])

See Also Introduction to NexScript and Python Programming Function Categories

Page 355

Page 358: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.42. SetTimestamps

SetTimestamps NexVar Method Sets the timestamps of a NexVar object representing event or neuron.

Syntax var.SetTimestamps(timestamps)

Parameters

Parameter Type Description

timestamps list list containing timestamps in seconds

Returns None

Comments Python only.

Usage

Python doc = nex.GetActiveDocument()doc["ScriptGeneratedEvent"] = nex.NewEvent(doc, 0)doc["ScriptGeneratedEvent"].SetTimestamps([ 1.0025, 2.5, 34.5])

See Also Introduction to NexScript and Python Programming Function Categories

Page 356

Page 359: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.3.43. SetNeuronPosition

SetNeuronPosition NexDoc Method Sets the position (used in 3D displays) of a neuron variable.

Syntax doc.SetNeuronPosition(neuronVar, x, y)

Parameters

Parameter Type Description

neuronVar variable reference Reference to the neuron variable.

x number x coordinate of position (within [0,100] range)

y number y coordinate of position (within [0,100] range)

Returns None

Comments

Usage

Python import nexdoc = nex.GetActiveDocument()doc.SetNeuronPosition(doc['SPK01a'], 8.0, 12.5)

See Also Introduction to NexScript and Python Programming Function Categories

Page 357

Page 360: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4. Variable Selection Functions The following selection functions are available in NexScript and Python:

Function Description

IsSelected Returns selection status of the specified variable.

Select Selects the specified variable (with variable type and index) foranalysis.

Deselect Deselects the specified variable (with variable type and index).

SelectVar Selects the specified variable for analysis.

DeselectVar Deselects the specified variable.

SelectAll Selects all variables for analysis.

DeselectAll Deselects all variables.

SelectAllNeurons Selects all the neuron type variables for analysis.

SelectAllEvents Selects all the event type variables for analysis.

EnableRecalcOnSelChange Enables recalculation of analyses when the list of selectedvariables changes.

DisableRecalcOnSelChange Disables recalculation of analyses when the list of selectedvariables changes.

See Also Introduction to NexScript and Python Programming Function Categories

Page 358

Page 361: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.1. IsSelected

IsSelected Function Returns 1 if the variable var is selected, 0 otherwise.

Syntax number IsSelected(var)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

Returns Returns 1 if the variable var is selected, 0 otherwise.

Comments Only selected variables used in analysis.

Usage

NexScript doc = GetActiveDocument()isSel = IsSelected(doc["Neuron1"])

Python import nexdoc = nex.GetActiveDocument()isSel = nex.IsSelected(doc["Neuron1"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 359

Page 362: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.2. Select

Select Function Selects the specified variable for analysis.

Syntax Select(doc, var)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

var variableReference Reference to the variable.

Returns None

Comments Only selected variables used in analysis. Use select and deselect functions to specify what variables youwant to analyze.

Usage

NexScript doc = GetActiveDocument()Select(doc, doc["Neuron1"])

Python import nexdoc = nex.GetActiveDocument()nex.Select(doc, doc["Neuron1"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 360

Page 363: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.3. Deselect

Deselect Function Deselects the specified variable.

Syntax Deselect(doc, var)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

var variableReference Reference to the variable.

Returns None

Comments Only selected variables used in analysis. Use select and deselect functions to specify what variables youwant to analyze.

Usage

NexScript doc = GetActiveDocument()% deselect variable Neuro04a from analysisDeselect(doc, doc["Neuron04a"])

Python import nexdoc = nex.GetActiveDocument()# deselect variable Neuro04a from analysisnex.Deselect(doc, doc["Neuron04a"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 361

Page 364: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.4. SelectVar

SelectVar Function Selects the specified variable for analysis.

Syntax SelectVar(doc, number, varType)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

number number Variable number within the group specified byvarType.

varType string Variable type. Should be "neuron", "neuronorevent" ,"event", "interval" "wave", "popvector", "continuous","marker" or "all".

Returns None

Comments Only selected variables used in analysis. Use select and deselect functions to specify what variables youwant to analyze.

Usage

NexScript doc = GetActiveDocument()% select the second neuron for analysisSelectVar(doc, 2, "neuron")

Python import nexdoc = nex.GetActiveDocument()# select the second neuron for analysisnex.SelectVar(doc, 2, "neuron")

See Also Introduction to NexScript and Python Programming Function Categories

Page 362

Page 365: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.5. DeselectVar

DeselectVar Function Deselects the specified variable.

Syntax DeselectVar(doc, number, varType)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

number number Variable number within the group specified byvarType.

varType string Variable type. Should be "neuron", "neuronorevent" ,"event", "interval" "wave", "popvector", "continuous","marker" or "all".

Returns None

Comments Only selected variables used in analysis. Use select and deselect functions to specify what variables youwant to analyze.

Usage

NexScript doc = GetActiveDocument()% deselect the second neuronDeselectVar(doc, 2, "neuron")

Python import nexdoc = nex.GetActiveDocument()# deselect the second neuronnex.DeselectVar(doc, 2, "neuron")

See Also Introduction to NexScript and Python Programming Function Categories

Page 363

Page 366: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.6. Select

Select Function Selects the specified variable for analysis.

Syntax Select(doc, var)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

var variableReference Reference to the variable.

Returns None

Comments Only selected variables used in analysis. Use select and deselect functions to specify what variables youwant to analyze.

Usage

NexScript doc = GetActiveDocument()Select(doc, doc["Neuron1"])

Python import nexdoc = nex.GetActiveDocument()nex.Select(doc, doc["Neuron1"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 364

Page 367: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.7. Deselect

Deselect Function Deselects the specified variable.

Syntax Deselect(doc, var)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

var variableReference Reference to the variable.

Returns None

Comments Only selected variables used in analysis. Use select and deselect functions to specify what variables youwant to analyze.

Usage

NexScript doc = GetActiveDocument()% deselect variable Neuro04a from analysisDeselect(doc, doc["Neuron04a"])

Python import nexdoc = nex.GetActiveDocument()# deselect variable Neuro04a from analysisnex.Deselect(doc, doc["Neuron04a"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 365

Page 368: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.8. SelectAll

SelectAll Function Selects all the variables for analysis.

Syntax SelectAll(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns None

Comments Only selected variables used in analysis. Use select and deselect functions to specify what variables youwant to analyze.

Usage

NexScript doc = GetActiveDocument()SelectAll(doc)

Python import nexdoc = nex.GetActiveDocument()nex.SelectAll(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 366

Page 369: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.9. DeselectAll

DeselectAll Function Deselects all variables.

Syntax DeselectAll(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns None

Comments Only selected variables used in analysis. Use select and deselect functions to specify what variables youwant to analyze.

Usage

NexScript doc = GetActiveDocument()DeselectAll(doc)

Python import nexdoc = nex.GetActiveDocument()nex.DeselectAll(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 367

Page 370: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.10. SelectAllNeurons

SelectAllNeurons Function Selects all neuron type variables for analysis.

Syntax SelectAllNeurons(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns None

Comments Only selected variables used in analysis. Use select and deselect functions to specify what variables youwant to analyze.

Usage

NexScript doc = GetActiveDocument()SelectAllNeurons(doc)

Python import nexdoc = nex.GetActiveDocument()nex.SelectAllNeurons(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 368

Page 371: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.11. SelectAllEvents

SelectAllEvents Function Selects all event type variables for analysis.

Syntax SelectAllEvents(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns None

Comments Only selected variables used in analysis. Use select and deselect functions to specify what variables youwant to analyze.

Usage

NexScript doc = GetActiveDocument()SelectAllEvents(doc)

Python import nexdoc = nex.GetActiveDocument()nex.SelectAllEvents(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 369

Page 372: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.12. EnableRecalcOnSelChange

EnableRecalcOnSelChange Function Enables recalculation of analyses when the list of selected variables changes.

Syntax EnableRecalcOnSelChange ()

Parameters None

Returns None

Comments If there is an analysis window open in NeuroExplorer (for example, if an analysis window was openbefore script began or ApplyTemplate was called in the script) and a list of selected variables changes,NeuroExplorer can automatically recalculate the analysis results. This automatic recalculation is disabledby default. This function allows you to enable automatic recalculation on selection change.

Usage

NexScript EnableRecalcOnSelChange ()

Python import nexnex.EnableRecalcOnSelChange()

See Also Introduction to NexScript and Python Programming Function Categories

Page 370

Page 373: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.4.13. DisableRecalcOnSelChange

DisableRecalcOnSelChange Function Disables recalculation of analyses when the list of selected variables changes.

Syntax DisableRecalcOnSelChange()

Parameters None

Returns None

Comments If there is an analysis window open in NeuroExplorer (for example, if an analysis window was openbefore script began or ApplyTemplate was called in the script) and a list of selected variables changes,NeuroExplorer can automatically recalculate the analysis results. This function allows you to disableautomatic recalculation on selection change.

Usage

NexScript DisableRecalcOnSelChange()

Python import nexnex.DisableRecalcOnSelChange()

See Also Introduction to NexScript and Python Programming Function Categories

Page 371

Page 374: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5. Analysis Functions The following analysis functions are available in NexScript and Python

Function Description

ApplyTemplate Runs the analysis specified in the template.

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

EnableRecalcOnSelChange Enables recalculation of analyses when the list of selectedvariables changes.

DisableRecalcOnSelChange Disables recalculation of analyses when the list of selectedvariables changes.

PrintGraphics Prints the contents of the first graphical window of the document.

Dialog Shows a dialog allowing to set script parameters.

ModifyTemplate Modifies one of the template parameters.

GetTemplateParValue Returns the value of the template parameter.

RecalculateAnalysisInWindow Forces recalculation of analysis in the specified graphic window.

SendGraphicsToPowerPoint Sends the contents of the first graphical window of the documentto the specified PowerPoint presentation.

SaveGraphics Saves the graphics to a WMF, PNG or SVG file.

ExecuteMenuCommand Executes specified menu command.

SaveResults Saves numerical and graphical results to a file with the specifiedname.

SelectVariablesIn1DView Selects variables in 1D View.

SetProperty Sets custom analysis result.

GetPostProcessingScriptParamete

r

Returns post-processing script parameter value.

GetAllAnalysisParameters Returns all analysis parameters.

ActivateWindow Activates specified child window.

CloseWindow Closes specified child window.   See also Numerical Results functions.  

See Also Introduction to NexScript and Python Programming Function Categories

Page 372

Page 375: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.1. ApplyTemplate

ApplyTemplate Function Runs the analysis specified in the analysis template.

Syntax ApplyTemplate(doc, templateName)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

templateName string The name of the template. See Comments below fordetails on how to specify template name parameter.

Returns None

Comments

How to specify template names. By default, the templates are stored in directory: C:\Users\current_user\Documents\NeuroExplorer 5\Templates\ (where current_user is your Windows user name). You can also specify custom templates directory usingTemplates | Template Properties... menu command. The following discussion assumes that you areusing default templates directory.   When the template name is specified as "PSTH", for example: ApplyTemplate(doc, "PSTH") NeuroExplorer will use the following template file C:\Users\current_user\Documents\NeuroExplorer 5\Templates\PSTH.ntp   You can also specify the template name relative to the main templates folder For example, the template name "Grant\Auto.ntp" used in ApplyTemplate(doc, "Grant\Auto.ntp") means that the template file C:\Users\current_user\Documents\NeuroExplorer 5\Templates\Grant\Auto.ntp will be used.   Finally, you can specify the absolute path of the template file: ApplyTemplate(doc, "C:\MyTemplates\Auto.ntp")

Page 373

Page 376: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

 

Usage

NexScript doc = GetActiveDocument()% run PSTH analysis saved in the template Peri1ApplyTemplate(doc, "Peri1")

Python import nexdoc = nex.GetActiveDocument()# run PSTH analysis saved in the template Peri1nex.ApplyTemplate(doc, "Peri1")

See Also Introduction to NexScript and Python Programming Function Categories

Page 374

Page 377: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.2. ApplyTemplateToWindow

ApplyTemplateToWindow Function 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 Comments below fordetails on how to specify template name parameter.

windownumber number The number 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 Graphwindow with the specified number does not exist, anew Graph window is created

Returns None

Comments

How to specify template names. By default, the templates are stored in directory: C:\Users\current_user\Documents\NeuroExplorer 5\Templates\ (where current_user is your Windows user name). You can also specify custom templates directory usingTemplates | Template Properties... menu command. The following discussion assumes that you areusing default templates directory.   When the template name is specified as "PSTH", for example: ApplyTemplateToWindow(doc, "PSTH", 2) NeuroExplorer will use the following template file C:\Users\current_user\Documents\NeuroExplorer 5\Templates\PSTH.ntp   You can also specify the template name relative to the main templates folder For example, the template name "Grant\Auto.ntp" used in ApplyTemplateToWindow(doc, "Grant\Auto.ntp", 2) means that the template file C:\Users\current_user\Documents\NeuroExplorer 5\Templates\Grant\Auto.ntp

Page 375

Page 378: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

will be used.   Finally, you can specify the absolute path of the template file: ApplyTemplateToWindow(doc, "C:\MyTemplates\Auto.ntp", 2)  

Usage

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

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

See Also Introduction to NexScript and Python Programming Function Categories

Page 376

Page 379: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.3. PrintGraphics

PrintGraphics Function Prints the contents of the first graphical window of the document.

Syntax PrintGraphics(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()PrintGraphics(doc)

Python import nexdoc = nex.GetActiveDocument()nex.PrintGraphics(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 377

Page 380: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.4. Dialog

Dialog Function Shows a dialog that can be used to specify the script parameters.

Syntax number Dialog(doc, par1, name1, type1, par2, name2, type2, ...)

Parameters

Parameter Type Description

doc documentReference Reference to the document. Could be zero if all thetype values are "number" or "string".

par1 variable A variable that will be assigned a value after Dialogexits. The variable should be created before theDialog function is called

name1 string Prompt that will be shown in the dialog.

type1 string  Parameter type. It should be one of: "number","string", "neuron", "neuronorevent", "event", "interval","wave", "continuous", "marker" or "all".

Returns Dialog function returns 1 if user pressed OK button or 0, if user pressed Cancel button. 

Comments None

Usage

NexScript % create a string variablefilefilter = "C:\Data\*.nex" % show the dialog to the userres = Dialog(0., filefilter , "File Filter:", "string")

Python filefilter = "C:\\Data\\*.nex" # show the dialog to the user__wrapper = []res = nex.Dialog(0., filefilter, "File Filter:", "string", __wrapper )filefilter = __wrapper[0]; The following dialog will be shown:

Page 378

Page 381: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Now a user can type the new value in the File Filter edit box. If the user presses OK button, the Dialogfunction returns 1, otherwise, it returns 0.   The following script will allow a user to choose one of the neurons in the active document and select thisneuron for analysis: doc = GetActiveDocument()Neuron_Number = 1% choose a neuronres = Dialog(doc, Neuron_Number, "Select Neuron", "neuron")% get the neuron variable and select itNeuron_Var = GetVar(doc, Neuron_Number, "neuron")Select(doc, Neuron_Var) Here is the Python equivalent: import nexdoc = nex.GetActiveDocument()Neuron_Number = 1# choose a neuron__wrapper = []res = nex.Dialog(doc, Neuron_Number, "Select Neuron", "neuron", __wrapper )Neuron_Number = __wrapper[0];# get the neuron variable and select itNeuron_Var = nex.GetVar(doc, Neuron_Number, "neuron")nex.Select(doc, Neuron_Var)

See Also Introduction to NexScript and Python Programming Function Categories

Page 379

Page 382: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.5. ModifyTemplate

ModifyTemplate Function Modifies one of the template parameters.

Syntax ModifyTemplate(doc, templateName, paramName, newParValue)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

templateName string The name of the template. See Comments below fordetails on how to specify template name parameter.

paramName string The name of the parameter to be modified.

newParValue string The new value of the parameter (as a string).

Returns None

Comments

How to specify template names. When the template name is specified as "PSTH", for example: ModifyTemplate(doc, "PSTH", "Bin (sec)", "5.0") NeuroExplorer will modify the following template file C:\Users\current_user\Documents\NeuroExplorer 5\Templates\PSTH.ntp (where current_user is your Windows user name). You can also specify the template name relative to the main templates folder C:\Users\current_user\Documents\NeuroExplorer 5\Templates\ For example, the template name "Grant\Auto.ntp" ModifyTemplate(doc, "Grant\Auto.ntp", "Bin (sec)", "5.0") means that the template file C:\Users\current_user\Documents\NeuroExplorer 5\Templates\Grant\Auto.ntp will be modified. Finally, you can specify the absolute path of the template file: ModifyTemplate(doc, "C:\MyTemplates\Auto.ntp", "Bin (sec)", "5.0")

Usage

NexScript

Page 380

Page 383: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

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 PropertiesPanel (e.g. not "Bin", but "Bin (sec)" as in the example above). You can select the parameter name in theleft column of Properties Panel and press Ctrl+C to copy the parameter name to the clipboard and thenpaste 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 NumToStrfunction. 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, Crosscorrelogramsand 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 andPerievent 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 thanstart 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 shapeTriangle 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 eventsModifyTemplate(doc, "PRaster", "Markers", "AddMarker:Event06,TriangleDown,0,0,0,0,255,0") % adds new marker Event6ModifyTemplate(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 needto 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")  

Page 381

Page 384: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

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.")   To change the X Axis parameter, you need to add XAxis| before the parameter name. doc = GetActiveDocument()ModifyTemplate(doc, "Peri", "XAxis|Show numerics", "Never")

See Also Introduction to NexScript and Python Programming Function Categories

Page 382

Page 385: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.6. GetTemplateParValue

GetTemplateParValue Function Returns the value of the specified template parameter as string.

Syntax string GetTemplateParValue(templateName, paramName)

Parameters

Parameter Type Description

templateName string The name of the template. See Comments below fordetails on how to specify template name parameter.

paramName string The name of the parameter.

Returns None

Comments

How to specify template names.   By default, the templates are stored in directory: C:\Users\current_user\Documents\NeuroExplorer 5\Templates\ (where current_user is your Windows user name). You can also specify custom templates directory usingTemplates | Template Properties... menu command. The following discussion assumes that you areusing default templates directory.   When the template name is specified as "PSTH", for example: GetTemplateParValue("PSTH", "Bin (sec)") NeuroExplorer will use the following template file C:\Users\current_user\Documents\NeuroExplorer 5\Templates\PSTH.ntp   You can also specify the template name relative to the main templates folder For example, the template name "Grant\Auto.ntp" used in GetTemplateParValue("Grant\Auto.ntp", "Bin (sec)") means that the template file C:\Users\current_user\Documents\NeuroExplorer 5\Templates\Grant\Auto.ntp will be used.   Finally, you can specify the absolute path of the template file:

Page 383

Page 386: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

GetTemplateParValue("C:\MyTemplates\Auto.ntp", "Bin (sec)")

Usage

NexScript To get the bin value in the Rate Histograms template, you need to write: valueAsString = GetTemplateParValue("Rate Histograms", "Bin (sec)") Note that the parameter name should be specified exactly as it is shown in the left column of theProperties Panel (e.g. not "Bin", but "Bin (sec)" as in the example above). You can select the parametername in the left column of Properties Panel and press Ctrl+C to copy the parameter name to theclipboard and then paste the name of the parameter into your script. If you need to use a numeric value of the parameter, you need to convert the string to number using

StrToNum function.

See Also Introduction to NexScript and Python Programming Function Categories

Page 384

Page 387: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.7. RecalculateAnalysisInWindow

RecalculateAnalysisInWindow Function Forces recalculation of analysis in the specified graphic window.

Syntax RecalculateAnalysisInWindow(doc, graphWindowNumber)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

graphWindowNumber number Index of the Graph window.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()RecalculateAnalysisInWindow(doc, 1)

Python import nexdoc = nex.GetActiveDocument()nex.RecalculateAnalysisInWindow(doc, 1)

See Also Introduction to NexScript and Python Programming Function Categories

Page 385

Page 388: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.8. EnableRecalcOnSelChange

EnableRecalcOnSelChange Function Enables recalculation of analyses when the list of selected variables changes.

Syntax EnableRecalcOnSelChange ()

Parameters None

Returns None

Comments If there is an analysis window open in NeuroExplorer (for example, if an analysis window was openbefore script began or ApplyTemplate was called in the script) and a list of selected variables changes,NeuroExplorer can automatically recalculate the analysis results. This automatic recalculation is disabledby default. This function allows you to enable automatic recalculation on selection change.

Usage

NexScript EnableRecalcOnSelChange ()

Python import nexnex.EnableRecalcOnSelChange()

See Also Introduction to NexScript and Python Programming Function Categories

Page 386

Page 389: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.9. DisableRecalcOnSelChange

DisableRecalcOnSelChange Function Disables recalculation of analyses when the list of selected variables changes.

Syntax DisableRecalcOnSelChange()

Parameters None

Returns None

Comments If there is an analysis window open in NeuroExplorer (for example, if an analysis window was openbefore script began or ApplyTemplate was called in the script) and a list of selected variables changes,NeuroExplorer can automatically recalculate the analysis results. This function allows you to disableautomatic recalculation on selection change.

Usage

NexScript DisableRecalcOnSelChange()

Python import nexnex.DisableRecalcOnSelChange()

See Also Introduction to NexScript and Python Programming Function Categories

Page 387

Page 390: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.10. SendGraphicsToPowerPoint

SendGraphicsToPowerPoint Function Sends the contents of the first graphical window of the document to the specified PowerPointpresentation.

Syntax SendGraphicsToPowerPoint (doc, presentationPath, slideTitle, comment, addParameters, useBitmap)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

presentationPath string Path of the presentation file. File extension should be.ppt (NeuroExplorer cannot save .pptx files). If fileextension is not .ppt, .ppt extension is added to the filepath.

slideTitle string Slide title.

comment string Slide comment. Will be shown below graphics.

addParameters number If 1, add a text box with analysis parameter values.

useBitmap number If 1, transfer graphics as a bitmap, otherwise, transfergraphics as a metafile.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()SendGraphicsToPowerPoint(doc, "C:\Data\NexResults.ppt", "Slide 1", "Sample slide", 1,0)

Python import nexdoc = nex.GetActiveDocument()nex.SendGraphicsToPowerPoint(doc, "C:\\Data\\NexResults.ppt", "Slide 1", "Sampleslide", 1, 0)

See Also Introduction to NexScript and Python Programming Function Categories

Page 388

Page 391: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.11. SaveGraphics

SaveGraphics Function Saves the graphics of the first graphics window of the document to a WMF, PNG or SVG (ScalableVector Graphics) file. Use SVG file type if you plan to edit graphics in Adobe Illustrator.

Syntax SaveGraphics(doc, filePath, graphicsFileType)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

filePath string Graphics file path

graphicsFileType number If this parameter value is zero, graphics is saved inWindows Metafile format. If graphicsFileType is 1, thegraphics is saved in PNG format. If graphicsFileTypeis 2, the graphics is saved in SVG format.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()SaveGraphics(doc, "C:\Data\NexGraphics.wmf", 0)SaveGraphics(doc, "C:\Data\NexGraphics.png", 1)SaveGraphics(doc, "C:\Data\NexGraphics.svg", 2)

Python import nexdoc = nex.GetActiveDocument()nex.SaveGraphics(doc, "C:\\Data\\NexGraphics.wmf", 0)nex.SaveGraphics(doc, "C:\\Data\\NexGraphics.png", 1)nex.SaveGraphics(doc, "C:\\Data\\NexGraphics.svg", 2)

See Also Introduction to NexScript and Python Programming Function Categories

Page 389

Page 392: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.12. ExecuteMenuCommand

ExecuteMenuCommand Script Function Executes specified menu command.

Syntax ExecuteMenuCommand(menuName)

Parameters

Parameter Type Description

menuName string Menu name. Submenus are separated by vertical bar(|). For example: ExecuteMenuCommand("SavedResults|Quick SaveResults"). See Comments below for the list of supported menucommands. Some menu commands require user interaction.These menu commands have ellipsis (...) at the end ofthe menu title (for example, "File|Open..."). Since userinteraction is required, these commands cannot beused in a script. Use History to record thesecommands with proper command parameters.

Returns None

Comments The following menu commands are supported: File|New File|Restore Last Analysis File|Load SelectedCont. Channels from 3Brain Files File|Close File|Save File|Connect to Plexon Server View|1D DataViewer Window View|Numerical Results Window View|Average/Overlay Chart Window View|ResultsFolder Summary Analysis|Increase X Range Analysis|Decrease X Range Results|GraphicalResults|Copy Graphics to the Clipboard Results|Numerical Results|View Numerical Results Window Results|Numerical Results|Copy Numerical Results to the Clipboard Results|Numerical Results|AddNumerical Results as New Continuous Variables Results|Numerical Results|Send Numerical Results toMatlab SavedResults|Quick Save Results SavedResults|Results Folder Summary Graphics|ExportGraphics|Copy Graphics to the Clipboard Graphics|Fonts|Enable Font AutoScale Graphics|Fonts|Increase font size Graphics|Fonts|Decrease font size Graphics|Zoom|Fit to Window Template|Save As Default Template 3DView|View Histograms in 3D 3DView|View Histogram Variationsin 3D Matlab|Get Data From Matlab|Open Matlab As Engine Matlab|Send Selected Variables to Matlab Matlab|Send Numerical Results to Matlab Online|Connect to Plexon Server Online|Connect to CerebusServer Online|Connect to Neuralynx Server Online|Connect to AlphaMap Server Online|Pause OnlineData Server Updates Online|Reset Online Data File Online|Disconnect from Online Data Server Window|Numerical Results Window Window|Close All Windows Window|Close All Windows ExceptCurrently Active Window

Page 390

Page 393: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Usage

NexScript ExecuteMenuCommand("SavedResults|Quick Save Results")

Python import nexnex.ExecuteMenuCommand("SavedResults|Quick Save Results")

See Also Introduction to NexScript and Python Programming Function Categories

Page 391

Page 394: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.13. SaveResults

SaveResults Script Function Saves numerical and graphical results as well as an analysis template for the first graphical view of thedocument.

Syntax SaveResults(doc, fileName, comment)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

fileName string The path of the .nexresult file. UseSavedResults|Open Saved Results File... menucommand to open saved result.

comment string The user comment for the result.

Returns None

Comments  

Usage

NexScript doc = GetActiveDocument()SaveResults(doc, "C:\Data\MyResult.nexresult", "some comment")

Python import nexdoc = nex.GetActiveDocument()nex.SaveResults(doc, "C:\\Data\\MyResult.nexresult", "some comment")

See Also Introduction to NexScript and Python Programming Function Categories

Page 392

Page 395: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.14. SelectVariablesIn1DView

SelectVariablesIn1DView Script Function Selects variables in 1D View.

Syntax SelectVariablesIn1DView(doc, listOfVarNames)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

listOfVarNames string A string containing comma-separated list of variablenames.

Returns None

Comments There should be no spaces before or after commas in the variables list. If a variable name containscomma(s) and Python is used, the variable name should be enclosed in double quotes. See sample codebelow.

Usage

NexScript doc = nex.GetActiveDocument()SelectVariablesIn1DView(doc, "Neuron04a,Neuron05b,Neuron05c")

Python import nexdoc = nex.GetActiveDocument()nex.SelectVariablesIn1DView(doc, 'Neuron04a,Neuron05b,Neuron05c')# if we want to select a variable with a name containing comma(s),# the variable name should be enclosed in double quotes. For example,# if variable name is# channel 1, cluster2: nex.SelectVariablesIn1DView(doc, 'Neuron04a,Neuron05b,Neuron05c,"channel 1,cluster2"')

See Also Introduction to NexScript and Python Programming Function Categories

Page 393

Page 396: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.15. SetProperty

SetProperty NexDoc Method Sets custom analysis result property.

Syntax doc.SetProperty(propertyName, propertyValue)

Parameters

Parameter Type Description

propertyName string Property name. Supported property names are:  'YAxisMinimumsAndMaximums' (sets Y axisminimums and maximums, see code sample below); 'AdditionalNumResColumns' (sets additional columnsin Summary of Numerical Results, see code samplebelow); 'AdditionalGraphicsCommands' (sets additionalgraphics commands, see code sample below)

propertyValue Python object Property value. See code sample below for details.

Returns None.

Comments This method sets properties of the first graphical view of the document (or numerical results of the firstgraphical view).

Usage

Python import neximport mathimport sysimport json def SpecifyCustomYMinimumsAndMaximums(): doc = nex.GetActiveDocument() sumColNames = doc.GetNumResSummaryColumnNames() sumResults = doc.GetAllNumResSummaryData() # loop over values in Mean column of the Numerical Results Summary # and, for each graph, set Y axis minimum to mean-10, Y axis maximum to mean+10 # 'YAxisMinimumsAndMaximums' property value should be a list of 2-element numericlists allMinsAndMaxes = [] meanColumnIndex = sumColNames.index('Mean') # sumResults[meanColumnIndex] returns a list of values in the column 'Mean'

Page 394

Page 397: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

for m in sumResults[meanColumnIndex]: ymin = float(m) - 10 ymax = float(m) + 10 allMinsAndMaxes.append([ymin, ymax]) doc.SetProperty('YAxisMinimumsAndMaximums', allMinsAndMaxes) def PeakDetect(x, y, delta):# Converted from MATLAB script at http://billauer.co.il/peakdet.html# Finds the local maxima in the vector y. # A point is considered a maximum peak if it has the maximal# value, and was preceded (to the left) by a value lower by delta. maximums = [] minimums = [] if len(y) != len(x): # Input vectors v and x must have same length return [] if delta <= 0: # Input argument delta must be positive return [] theMinimum = float('inf') theMaximum = float('-inf') minPos = float('nan') maxPos = float('nan') lookformax = True for i in range(len(y)): this = y[i] if this > theMaximum: theMaximum = this maxPos = x[i] if this < theMinimum: theMinimum = this minPos = x[i] if lookformax: if this < theMaximum-delta: maximums.append((maxPos, theMaximum)) theMinimum = this minPos = x[i] lookformax = False else: if this > theMinimum+delta: minimums.append((minPos, theMinimum)) theMaximum = this maxPos = x[i] lookformax = True return maximums def MakeEmptyColumn(name, numValues): # creates empty column object that can be used in

Page 395

Page 398: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

# doc.SetProperty('AdditionalNumResColumns', columns) col = {} col['name'] = name col['values'] = [] for row in range(numValues): col['values'].append('') return col def MakeLine(graphIndex,xFrom,yFrom,xTo,yTo,thickness=0.5,color='(0;0;0)'): # creates line drawing command that can be used in # doc.SetProperty('AdditionalGraphicsCommands', graphicsCommands) line = {} line['type'] = 'line' line['graphNumber'] = graphIndex line['thickness'] = thickness line['color'] = color line['xFrom'] = xFrom line['xTo'] = xTo line['yFrom'] = yFrom line['yTo'] = yTo return line def MakeText(graphIndex,x,y,text,fontsize=8,color='(0;0;0)'): # creates text command that can be used in # doc.SetProperty('AdditionalGraphicsCommands', graphicsCommands) textCommand = {} textCommand['type'] = 'text' textCommand['graphNumber'] = graphIndex # font size is in points textCommand['fontsize'] = fontsize textCommand['color'] = color # x and y are the coordinates of the lower-left corner of text textCommand['x'] = x textCommand['y'] = y textCommand['text'] = text return textCommand def FindPeaksAndAddColumnsAndGraphicsCommands(): doc = nex.GetActiveDocument() deltaPercentString = doc.GetPostProcessingScriptParameter() try: deltaPercent = float(deltaPercentString) except: deltaPercent = 25 res = doc.GetAllNumericalResults() resNames = doc.GetNumResColumnNames() if len(resNames) < 2: return # the first column should contain X axis values if not resNames[0] in ['Bin Left', 'Bin Middle', 'Bin Right', 'Frequency Value','Time']: print 'no x data'

Page 396

Page 399: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

return # select only columns with real graph names # (we may have columns with confidence, standard deviation, etc.) sumNumRes = doc.GetAllNumResSummaryData() # real graph names are specified in the first column # of summary of numerical results realGraphNames = sumNumRes[0] graphIndexes = [] for i in range(len(resNames)): if resNames[i] in realGraphNames: graphIndexes.append(i) numResults = len(graphIndexes) # first column of numerical results contains x values x = res[0] xRange = max(x) - min(x) # we may need to adjust x to draw peak center at bin center step = x[1]-x[0] xAdjustment = 0 if resNames[0] == 'Bin Left': xAdjustment = step*0.5 if resNames[0] == 'Bin Right': xAdjustment = -step*0.5 # prepare empty columns with peak info columns = [] # we will report up to 5 peaks maxNumPeaks = 5 for i in range(maxNumPeaks): columns.append(MakeEmptyColumn('PeakValue' + str(i+1),numResults)) columns.append(MakeEmptyColumn('PeakPosition' + str(i+1),numResults)) graphicsCommands = [] # for each graph, find peaks and add columns and graphical commands for igraph in range(len(graphIndexes)): y = res[graphIndexes[igraph]] yRange = max(y) - min(y) if yRange > 0 : delta = yRange*deltaPercent/100.0 peaks = PeakDetect(x, y, delta) for ip in range(len(peaks)): xp = peaks[ip][0] + xAdjustment yp = peaks[ip][1] if ip < maxNumPeaks: # fill extra columns columns[ip*2]['values'][igraph] = '%.6f' % (yp) columns[ip*2+1]['values'][igraph] = '%.6f' % (xp) # add graphics commands dx = xRange*0.010 dy = yRange*0.015 # add graphics commands to draw 'x' (red diagonal lines) at each peak graphicsCommands.append(MakeLine(igraph,xp-dx,yp-dy,xp+dx,yp+dy,1.0,'(255;0;0)')) graphicsCommands.append(MakeLine(igraph,xp-dx,yp+dy,xp+dx,yp-dy,1.0,'(255;0;0)')) # add text command showing x value of the peak

Page 397

Page 400: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

# if you want both x and y, use # peakText = '(%.3f,%.3f)'%(xp,yp) peakText = '%.3f'%(xp)graphicsCommands.append(MakeText(igraph,xp,yp+dy,peakText,7,'(0;64;255)')) doc.SetProperty('AdditionalNumResColumns', columns) doc.SetProperty('AdditionalGraphicsCommands', graphicsCommands) FindPeaksAndAddColumnsAndGraphicsCommands()

See Also Introduction to NexScript and Python Programming Function Categories

Page 398

Page 401: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.16. GetPostProcessingScriptParameter

GetPostProcessingScriptParameter NexDoc Method Gets the value of a post-processing script parameter as string.

Syntax string doc.GetPostProcessingScriptParameter()

Returns Post-processing script parameter as string. The parameter value is specified in the Post-Processing tabof the analysis parameters dialog.

Usage

Python import nexdoc = nex.GetActiveDocument() deltaPercentString = doc.GetPostProcessingScriptParameter() try: deltaPercent = float(deltaPercentString)except: deltaPercent = 15

See Also Introduction to NexScript and Python Programming Function Categories

Page 399

Page 402: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.17. GetAllAnalysisParameters

GetAllAnalysisParameters NexDoc Method Returns the values of all analysis parameters of the first graphical view of a document.

Syntax stringInJSONFormat doc.GetAllAnalysisParameters()

Returns All analysis parameters as JSON string (name:value pairs).

Comments Use json.loads to convert returned string to a Python dictionary object (see sample code below).Parameter values are returned as strings. Use float() to convert strings to numbers.

Usage

Python import neximport json doc = nex.GetActiveDocument()anParsString = doc.GetAllAnalysisParameters()pars = json.loads(anParsString) # print all parameter names and valuesfor p in pars: print("{}={}".format(p, pars[p])) # get xmin and xmax valuesxmin = float(pars['XMin (sec)'])xmax = float(pars['XMax (sec)'])print("xmin={}, xmax={}, range={}".format(xmin, xmax, xmax-xmin))

See Also Introduction to NexScript and Python Programming Function Categories

Page 400

Page 403: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.18. ActivateWindow

ActivateWindow Script Function Activates specified child window.

Syntax ActivateWindow(docPath, windowName)

Parameters

Parameter Type Description

docPath string Document (data file) path.

windowName string Window name, for example [Graphs1]

Returns None

Comments

Usage

NexScript doc = nex.GetActiveDocument()docPath = GetDocPath(doc)ActivateWindow(docPath, "[Graphs1]")

Python import nexdoc = nex.GetActiveDocument()docPath = nex.GetDocPath(doc)nex.ActivateWindow(docPath, '[Graphs1]')

See Also Introduction to NexScript and Python Programming Function Categories

Page 401

Page 404: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.5.19. CloseWindow

CloseWindow Script Function Closes specified child window.

Syntax CloseWindow(docPath, windowName)

Parameters

Parameter Type Description

docPath string Document (data file) path.

windowName string Window name, for example [Graphs1]

Returns None

Comments

Usage

NexScript doc = nex.GetActiveDocument()docPath = GetDocPath(doc)CloseWindow(docPath, "[Graphs1]")

Python import nexdoc = nex.GetActiveDocument()docPath = nex.GetDocPath(doc)nex.CloseWindow(docPath, '[Graphs1]')

See Also Introduction to NexScript and Python Programming Function Categories

Page 402

Page 405: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6. Numerical Results Functions The following numerical results functions are available in NexScript and Python

Function Description

GetAllNumericalResults Returns the list of all numerical results.

GetAllNumResSummaryData Returns the list of all the values of the summary of numericalresults.

GetNumResColumnNames Returns the list of column names in the Numerical Results windowof the first graphical view of the document.

GetNumResSummaryColumnNam

es

Returns the list of column names in the Summary of NumericalResults Window of the first graphical view of the document.

GetNumRes Returns the value of the specified cell in the Numerical ResultsWindow of the first graphical view of the document.

GetNumResNCols Returns the number of columns of the Numerical Results Windowof the first graphical view of the document.

GetNumResNRows Returns the number of rows of the Numerical Results Window ofthe first graphical view of the document.

GetNumResColumnName Returns the name of the specified column of the Numerical ResultsWindow of the first graphical view of the document.

SendResultsToExcel Sends numerical results (of the first graphics window of thedocument) to Excel.

GetNumResSummaryNCols Returns the number of columns of the Numerical Results SummaryWindow of the first graphical view of the document.

GetNumResSummaryNRows Returns the number of rows of the Numerical Results SummaryWindow of the first graphical view of the document.

GetNumResSummaryColumnNam

e

Returns the name of the specified column of the Numerical ResultsSummary Window of the first graphical view of the document.

GetNumResSummaryData Returns the value of the specified cell in the Numerical ResultsSummary Window of the first graphical view of the document.

SendResultsSummaryToExcel Sends summary of numerical results (of the first graphics windowof the document) to Excel.

SaveNumResults Saves the numerical results to a text file with the specified name.

SaveNumSummary Saves the summary of numerical results to a text file with thespecified name.

GetAllNumericalResultsAsCOM Returns the list of all values (as a list or rows) in the NumericalResults Window of the first graphical view of the document.

See Also Introduction to NexScript and Python Programming

Page 403

Page 406: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Function Categories

Page 404

Page 407: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.1. GetAllNumericalResults

GetAllNumericalResults NexDoc Method Returns the list of all values (as a list of columns) in the Numerical Results Window of the first graphicalview of the document.

Syntax list doc.GetAllNumericalResults()

Parameters None.

Returns Returns the list of all values (as a list of columns) in the Numerical Results Window of the first graphicalview of the document.

Comments GetAllNumericalResults() returns a list object with all the numerical results. Each element of the list is alist containing results from a single column in Numerical Results table. For example to get the 10-th valueof the first column of numerical results, use allNumRes[0][9] (see Usage below).

Usage

Python import nexdoc = nex.GetActiveDocument()allNumRes = doc.GetAllNumericalResults()# allNumRes now contains a list object with all numerical results.# for example, to get the 10-th value of the first column of numerical results, useallNumRes[0][9]# thus, allNumRes[0][9] equals to the result of nex.GetNumRes(doc, 10, 1)

See Also Introduction to NexScript and Python Programming Function Categories

Page 405

Page 408: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.2. GetAllNumResSummaryData

GetAllNumResSummaryData NexDoc Method Returns the list of all the values in the Numerical Results Summary Window of the first graphical view ofthe document.

Syntax list doc.GetAllNumResSummaryData()

Parameters None

Returns Returns the list of all the values in the Numerical Results Summary Window of the first graphical view ofthe document.

Comments Available only in Python.

Usage

Python import nexdoc = nex.GetActiveDocument()summary = doc.GetAllNumResSummaryData()# summary now contains a list object with all the values of summary of numericalresults window# for example, to get the 5-th value of the first column of summary of numericalresults, use summary[0][4]

See Also Introduction to NexScript and Python Programming Function Categories

Page 406

Page 409: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.3. SetProperty

SetProperty NexDoc Method Sets custom analysis result property.

Syntax doc.SetProperty(propertyName, propertyValue)

Parameters

Parameter Type Description

propertyName string Property name. Supported property names are:  'YAxisMinimumsAndMaximums' (sets Y axisminimums and maximums, see code sample below); 'AdditionalNumResColumns' (sets additional columnsin Summary of Numerical Results, see code samplebelow); 'AdditionalGraphicsCommands' (sets additionalgraphics commands, see code sample below)

propertyValue Python object Property value. See code sample below for details.

Returns None.

Comments This method sets properties of the first graphical view of the document (or numerical results of the firstgraphical view).

Usage

Python import neximport mathimport sysimport json def SpecifyCustomYMinimumsAndMaximums(): doc = nex.GetActiveDocument() sumColNames = doc.GetNumResSummaryColumnNames() sumResults = doc.GetAllNumResSummaryData() # loop over values in Mean column of the Numerical Results Summary # and, for each graph, set Y axis minimum to mean-10, Y axis maximum to mean+10 # 'YAxisMinimumsAndMaximums' property value should be a list of 2-element numericlists allMinsAndMaxes = [] meanColumnIndex = sumColNames.index('Mean') # sumResults[meanColumnIndex] returns a list of values in the column 'Mean'

Page 407

Page 410: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

for m in sumResults[meanColumnIndex]: ymin = float(m) - 10 ymax = float(m) + 10 allMinsAndMaxes.append([ymin, ymax]) doc.SetProperty('YAxisMinimumsAndMaximums', allMinsAndMaxes) def PeakDetect(x, y, delta):# Converted from MATLAB script at http://billauer.co.il/peakdet.html# Finds the local maxima in the vector y. # A point is considered a maximum peak if it has the maximal# value, and was preceded (to the left) by a value lower by delta. maximums = [] minimums = [] if len(y) != len(x): # Input vectors v and x must have same length return [] if delta <= 0: # Input argument delta must be positive return [] theMinimum = float('inf') theMaximum = float('-inf') minPos = float('nan') maxPos = float('nan') lookformax = True for i in range(len(y)): this = y[i] if this > theMaximum: theMaximum = this maxPos = x[i] if this < theMinimum: theMinimum = this minPos = x[i] if lookformax: if this < theMaximum-delta: maximums.append((maxPos, theMaximum)) theMinimum = this minPos = x[i] lookformax = False else: if this > theMinimum+delta: minimums.append((minPos, theMinimum)) theMaximum = this maxPos = x[i] lookformax = True return maximums def MakeEmptyColumn(name, numValues): # creates empty column object that can be used in

Page 408

Page 411: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

# doc.SetProperty('AdditionalNumResColumns', columns) col = {} col['name'] = name col['values'] = [] for row in range(numValues): col['values'].append('') return col def MakeLine(graphIndex,xFrom,yFrom,xTo,yTo,thickness=0.5,color='(0;0;0)'): # creates line drawing command that can be used in # doc.SetProperty('AdditionalGraphicsCommands', graphicsCommands) line = {} line['type'] = 'line' line['graphNumber'] = graphIndex line['thickness'] = thickness line['color'] = color line['xFrom'] = xFrom line['xTo'] = xTo line['yFrom'] = yFrom line['yTo'] = yTo return line def MakeText(graphIndex,x,y,text,fontsize=8,color='(0;0;0)'): # creates text command that can be used in # doc.SetProperty('AdditionalGraphicsCommands', graphicsCommands) textCommand = {} textCommand['type'] = 'text' textCommand['graphNumber'] = graphIndex # font size is in points textCommand['fontsize'] = fontsize textCommand['color'] = color # x and y are the coordinates of the lower-left corner of text textCommand['x'] = x textCommand['y'] = y textCommand['text'] = text return textCommand def FindPeaksAndAddColumnsAndGraphicsCommands(): doc = nex.GetActiveDocument() deltaPercentString = doc.GetPostProcessingScriptParameter() try: deltaPercent = float(deltaPercentString) except: deltaPercent = 25 res = doc.GetAllNumericalResults() resNames = doc.GetNumResColumnNames() if len(resNames) < 2: return # the first column should contain X axis values if not resNames[0] in ['Bin Left', 'Bin Middle', 'Bin Right', 'Frequency Value','Time']: print 'no x data'

Page 409

Page 412: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

return # select only columns with real graph names # (we may have columns with confidence, standard deviation, etc.) sumNumRes = doc.GetAllNumResSummaryData() # real graph names are specified in the first column # of summary of numerical results realGraphNames = sumNumRes[0] graphIndexes = [] for i in range(len(resNames)): if resNames[i] in realGraphNames: graphIndexes.append(i) numResults = len(graphIndexes) # first column of numerical results contains x values x = res[0] xRange = max(x) - min(x) # we may need to adjust x to draw peak center at bin center step = x[1]-x[0] xAdjustment = 0 if resNames[0] == 'Bin Left': xAdjustment = step*0.5 if resNames[0] == 'Bin Right': xAdjustment = -step*0.5 # prepare empty columns with peak info columns = [] # we will report up to 5 peaks maxNumPeaks = 5 for i in range(maxNumPeaks): columns.append(MakeEmptyColumn('PeakValue' + str(i+1),numResults)) columns.append(MakeEmptyColumn('PeakPosition' + str(i+1),numResults)) graphicsCommands = [] # for each graph, find peaks and add columns and graphical commands for igraph in range(len(graphIndexes)): y = res[graphIndexes[igraph]] yRange = max(y) - min(y) if yRange > 0 : delta = yRange*deltaPercent/100.0 peaks = PeakDetect(x, y, delta) for ip in range(len(peaks)): xp = peaks[ip][0] + xAdjustment yp = peaks[ip][1] if ip < maxNumPeaks: # fill extra columns columns[ip*2]['values'][igraph] = '%.6f' % (yp) columns[ip*2+1]['values'][igraph] = '%.6f' % (xp) # add graphics commands dx = xRange*0.010 dy = yRange*0.015 # add graphics commands to draw 'x' (red diagonal lines) at each peak graphicsCommands.append(MakeLine(igraph,xp-dx,yp-dy,xp+dx,yp+dy,1.0,'(255;0;0)')) graphicsCommands.append(MakeLine(igraph,xp-dx,yp+dy,xp+dx,yp-dy,1.0,'(255;0;0)')) # add text command showing x value of the peak

Page 410

Page 413: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

# if you want both x and y, use # peakText = '(%.3f,%.3f)'%(xp,yp) peakText = '%.3f'%(xp)graphicsCommands.append(MakeText(igraph,xp,yp+dy,peakText,7,'(0;64;255)')) doc.SetProperty('AdditionalNumResColumns', columns) doc.SetProperty('AdditionalGraphicsCommands', graphicsCommands) FindPeaksAndAddColumnsAndGraphicsCommands()

See Also Introduction to NexScript and Python Programming Function Categories

Page 411

Page 414: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.4. GetNumRes

GetNumRes Function Returns the value of the specified cell in the Numerical Results Window of the first graphical view of thedocument.

Syntax number GetNumRes(doc, row, col)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

row number 1-based row number.

col number 1-based column number.

Returns Returns the numeric value of the specified cell in the Numerical Results Window of the first graphicalview of the document.

Comments In Python, you can also use NexDoc object GetAllNumericalResults method. GetAllNumericalResults

returns a list object with all the numerical results. Each element of the list is a list containing results from

a single column in Numerical Results table. For example: import nexdoc = nex.GetActiveDocument()allNumRes = doc.GetAllNumericalResults()# allNumRes now contains a list object with all numerical results.# for example, to get the 10-th value of the first column of numerical results, useallNumRes[0][9]# thus, allNumRes[0][9] equals to the result of nex.GetNumRes(doc, 10, 1)

Usage

NexScript doc = GetActiveDocument()ApplyTemplate(doc, "PSTH")% get the value of the second bin of the first histogrambinCount = GetNumRes(doc, 2, 1)

Python import nexdoc = nex.GetActiveDocument()nex.ApplyTemplate(doc, "PSTH")# get the value of the second bin of the first histogrambinCount = nex.GetNumRes(doc, 2, 1)

Page 412

Page 415: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

See Also Introduction to NexScript and Python Programming Function Categories

Page 413

Page 416: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.5. GetNumResNCols

GetNumResNCols Function Returns the number of columns of the Numerical Results Window of the first graphical view of thedocument.

Syntax number GetNumResNCols(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns Returns the number of columns of the Numerical Results Window of the first graphical view of thedocument.

Comments None

Usage

NexScript doc = GetActiveDocument()numCols = GetNumResNCols(doc)

Python import nexdoc = nex.GetActiveDocument()numCols = nex.GetNumResNCols(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 414

Page 417: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.6. GetNumResNRows

GetNumResNRows Function Returns the number of rows of the Numerical Results Window of the first graphical view of the document.

Syntax number GetNumResNRows(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns Returns the number of rows of the Numerical Results Window of the first graphical view of the document.

Comments None

Usage

NexScript doc = GetActiveDocument()numRows = GetNumResNRows(doc)

Python import nexdoc = nex.GetActiveDocument()numRows = nex.GetNumResNRows(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 415

Page 418: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.7. GetNumResColumnName

GetNumResColumnName Function Returns the name of the specified column of the Numerical Results Window.

Syntax string GetNumResColumnName(doc, col)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

col number 1-based column number.

Returns Returns the name of the column of the Numerical Results Window of the first graphical view of thedocument.

Comments None

Usage

NexScript doc = GetActiveDocument()% get the name of the second column of the Numerical Results WindowcolName = GetNumResColumnName(doc, 2)

Python import nexdoc = nex.GetActiveDocument()# get the name of the second column of the Numerical Results WindowcolName = nex.GetNumResColumnName(doc, 2)

See Also Introduction to NexScript and Python Programming Function Categories

Page 416

Page 419: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.8. SendResultsToExcel

SendResultsToExcel Function Sends numerical results (of the first graphics window of the document) to Excel.

Syntax SendResultsToExcel(doc, fileName, worksheetName, useFirstEmptyRow, cellName, includeHeader,includeFileName)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

fileName string Excel file path.

worksheetName string Excel worksheet name.

useFirstEmptyRow number If 1, NeuroExplorer will ignore cellName parameterand add the results to the first row where the cell incolumn A is empty. If 2, NeuroExplorer will ignore cellName parameterand add the results to the first column where the cellin row 1 is empty. If 0, NeuroExplorer will copy the data starting with thecell specified in cellName.

cellName string Excel cell where to copy the results. Should be in theform CR where C is Excel column name, R is the rownumber. For example, A1 is the top-left cell in theworksheet.

includeHeader number If 1, NeuroExplorer will paste column names.

includeFileName number If 1, NeuroExplorer will add a column with the data filename.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()SendResultsToExcel(doc, "C:\Data\NexResults.xls", "Nex", 0, "A1", 1, 0)

Python import nexdoc = nex.GetActiveDocument()nex.SendResultsToExcel(doc, "C:\\Data\\NexResults.xls", "Nex", 0, "A1", 1, 0)

Page 417

Page 420: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

See Also Introduction to NexScript and Python Programming Function Categories

Page 418

Page 421: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.9. GetNumResSummaryNCols

GetNumResSummaryNCols Function Returns the number of columns of the Numerical Results Summary Window of the first graphical view ofthe document.

Syntax number GetNumResSummaryNCols(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns Returns the number of columns of the Numerical Results Summary Window of the first graphical view ofthe document.

Comments None

Usage

NexScript doc = GetActiveDocument()nCols = GetNumResSummaryNCols(doc)

Python import nexdoc = nex.GetActiveDocument()nCols = nex.GetNumResSummaryNCols(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 419

Page 422: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.10. GetNumResSummaryNRows

GetNumResSummaryNRows Function Returns the number of rows of the Numerical Results Summary Window of the first graphical view of thedocument.

Syntax number GetNumResSummaryNRows(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns Returns the number of rows of the Numerical Results Summary Window of the first graphical view of thedocument.

Comments None

Usage

NexScript doc = GetActiveDocument()nRows = GetNumResSummaryNRows(doc)

Python import nexdoc = nex.GetActiveDocument()nRows = nex.GetNumResSummaryNRows(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 420

Page 423: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.11. GetNumResSummaryColumnName

GetNumResSummaryColumnName Function Returns the name of the specified column of the Numerical Results Summary Window of the firstgraphical view of the document.

Syntax string GetNumResSummaryColumnName(doc, col)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

col number 1-based column number.

Returns Returns the name of the column of the Numerical Results Summary Window of the first graphical view ofthe document.

Comments None

Usage

NexScript doc = GetActiveDocument()% get the name of the third column in Numerical Results SummarycolName = GetNumResSummaryColumnName(doc, 3)

Python import nexdoc = nex.GetActiveDocument()# get the name of the third column in Numerical Results SummarycolName = nex.GetNumResSummaryColumnName(doc, 3)

See Also Introduction to NexScript and Python Programming Function Categories

Page 421

Page 424: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.12. GetNumResSummaryData

GetNumResSummaryData Function Returns the string value of the specified cell in the Numerical Results Summary Window of the firstgraphical view of the document.

Syntax string GetNumResSummaryData(doc, row, col)

Parameters

Parameter Type Description

doc documentReference Reference to the document

row number 1-based row number.

col number 1-based column number.

Returns Returns the string value of the specified cell in the Numerical Results Summary Window of the firstgraphical view of the document.

Comments In Python, use GetAllNumResSummaryData NexDoc method to get all summary values at once.

Usage

NexScript doc = GetActiveDocument()% get the value of the cell in row 3, column 2summaryCellString = GetNumResSummaryData(doc, 3, 2)

Python import nexdoc = nex.GetActiveDocument()# get the value of the cell in row 3, column 2summaryCellString = nex.GetNumResSummaryData(doc, 3, 2)# get all the values in summarysummary = doc.GetAllNumResSummaryData()# summary now contains a list object with all the values of summary of numericalresults window# for example, to get the 5-th value of the first column of summary of numericalresults, use summary[0][4]

See Also Introduction to NexScript and Python Programming Function Categories

Page 422

Page 425: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.13. SendResultsSummaryToExcel

SendResultsSummaryToExcel Function Sends summary of numerical results (of the first graphics window of the document) to Excel.

Syntax SendResultsSummaryToExcel(doc, fileName, worksheetName, useFirstEmptyRow, cellName,includeHeader, includeFileName)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

fileName string Excel file path.

worksheetName string Excel worksheet name.

useFirstEmptyRow number If 1, NeuroExplorer will ignore cellName parameterand add the results to the first row where the cell incolumn A is empty. If 2, NeuroExplorer will ignore cellName parameterand add the results to the first column where the cellin row 1 is empty. If 0, NeuroExplorer will paste data starting with thecell specified in cellName.

cellName string Excel cell where to paste the results. Should be in theform CR where C is Excel column name, R is the rownumber. For example, A1 is the top-left cell in theworksheet.

includeHeader number If 1, will paste column names.

includeFileName number If 1, will add a column with the data file name.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()SendResultsSummaryToExcel(doc, "C:\Data\res.xls", "FromNex", 0, "A1", 1, 0)

Python import nexdoc = nex.GetActiveDocument()nex.SendResultsSummaryToExcel(doc, "C:\\Data\\res.xls", "FromNex", 0, "A1", 1, 0)

Page 423

Page 426: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

See Also Introduction to NexScript and Python Programming Function Categories

Page 424

Page 427: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.14. SaveNumResults

SaveNumResults Function Saves the numerical results to a text file with the specified name.

Syntax SaveNumResults(doc, fileName)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

fileName string File path for saved results.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()SaveNumResults(doc, "C:\Data\res1.txt")

Python import nexdoc = nex.GetActiveDocument()nex.SaveNumResults(doc, "C:\\Data\\res1.txt")

See Also Introduction to NexScript and Python Programming Function Categories

Page 425

Page 428: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.15. SaveNumSummary

SaveNumSummary Function Saves the summary of numerical results to a text file with the specified name.

Syntax SaveNumSummary(doc, filename)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

filename string File path for saved results.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()SaveNumSummary(doc, "C:\Data\res1summary.txt")

Python import nexdoc = nex.GetActiveDocument()nex.SaveNumSummary(doc, "C:\\Data\\res1summary.txt")

See Also Introduction to NexScript and Python Programming Function Categories

Page 426

Page 429: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.16. GetNumResSummaryColumnNames

GetNumResSummaryColumnNames NexDoc Method Returns the list of column names in the Summary of Numerical Results Window of the first graphical viewof the document.

Syntax list doc.GetNumResSummaryColumnNames()

Parameters None

Returns Returns the list of column names in the Summary of Numerical Results Window of the first graphical viewof the document.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()names = doc.GetNumResSummaryColumnNames()

See Also Introduction to NexScript and Python Programming Function Categories

Page 427

Page 430: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.17. GetNumResColumnNames

GetNumResColumnNames NexDoc Method Returns the list of column names in the Numerical Results window of the first graphical view of thedocument.

Syntax list doc.GetNumResColumnNames()

Parameters None

Returns Returns the list of column names in the Numerical Results window of the first graphical view of thedocument.

Comments Python only.

Usage

Python import nexdoc = nex.GetActiveDocument()names = doc.GetNumResColumnNames()

See Also Introduction to NexScript and Python Programming Function Categories

Page 428

Page 431: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.6.18. GetAllNumericalResultsAsCOM

GetAllNumericalResultsAsCOM NexDoc Method Returns the list of all values (as a list or rows, similar to GetNumericalResults() COM method) in theNumerical Results Window of the first graphical view of the document.

Syntax list doc.GetAllNumericalResultsAsCOM()

Parameters None.

Returns Returns the list of all values (as a list or rows) in the Numerical Results Window of the first graphical viewof the document.

Comments GetAllNumericalResultsAsCOM() returns a list object with all the numerical results. Each element of thelist is a list containing results from a single row in Numerical Results table. For example to get the 10-thvalue of the first column of numerical results, use allNumRes[9][0] (see Usage below).

Usage

Python import nexdoc = nex.GetActiveDocument()allNumResAsCOM = doc.GetAllNumericalResultsAsCOM()# allNumRes now contains a list object with all numerical results.# for example, to get the 10-th value of the first column of numerical results, useallNumResAsCOM[9][0]# thus, allNumResAsCOM[9][0] equals to the result of nex.GetNumRes(doc, 10, 1)

See Also Introduction to NexScript and Python Programming Function Categories

Page 429

Page 432: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7. Operations on Variables Functions The following operations on variables functions are available in NexScript and Python

Function Description

Rename Renames the specified variable.

Join Creates the new event that contains both the timestamps of var1and the timestamps of var2.

Sync Creates the new event containing all the timestamps of var1 thatare in the intervals [var2+from, var2+to].

NotSync Creates the new event containing all the timestamps of var1 thatare NOT in the intervals [var2+from, var2+to].

FirstAfter Creates the new event containing the first timestamp of var1 ineach of the intervals [var2+from, var2+to].

FirstNAfter Creates the new event containing the first N timestamps of var1after each of the var2 timestamps.

LastBefore Creates the new event containing the last timestamp of var1 ineach of the intervals [var2+from, var2+to].

IntervalFilter Creates the new event containing all the timestamps of var that arein the intervals of the intervalVar.

SelectTrials Creates the new event containing the specified timestamps ofvariable var. selectList can contain comma-separated indexes orranges of timestamps for example: 1,3-5,10.

SelectRandom Creates the new event containing randomly selected timestampsof variable var.

SelectEven Creates the new event containing even (2nd, 4th, etc.) timestampsof variable var.

SelectOdd Creates the new event containing odd (1st, 3rd, etc.) timestampsof variable var.

ISIFilter Creates the new event containing timestamps of the variable varthat have preceding interspike intervals larger than min ISI.

FirstInInterval Creates the new event. For each interval of intervalVar, the first vartimestamp in this interval is copied to the result.

LastInInterval Creates the new event. For each interval of intervalVar, the last vartimestamp in this interval is copied to the result.

StartOfInterval Creates the new event. Copies the start of each interval ofintervalVar the result.

EndOfInterval Creates the new event. Copies the end of each interval ofintervalVar the result.

MakeIntervals Creates new interval variable with intervals[varTimestamp+shiftmin, varTimestamp+shiftMax].

MakeIntFromStart Creates new interval variable. For each timestamp (tstart) of

Page 430

Page 433: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

intStartVar, it looks for the first timestamp (tend) of the intEndVarafter tstart. If tend is before the next timestamp of intStartVar, itadds the interval [tstart+shift1, tend+shift2] to the result.

MakeIntFromEnd Creates new interval variable. For each timestamp of theintEndVar (tend), it looks for the last timestamp (tstart) of theintStartVar before tend. If tstart is after the previous timestamp ofintEndVar, it adds the interval [tstart+shift1, tend+shift2] to theresult.

IntOpposite Creates a new interval variable that contains intervals'complementary' to the intervals of intervalvar.

IntOr Creates a new Interval Variable that contains unions of theintervals of intervalVar1 and intervalVar2.

IntAnd Creates a new Interval Variable that contains intersections of theintervals of intervalVar1 and intervalVar2.

IntSize Creates a new Interval Variable that contains all of the intervals ofintervalVar that have the length which is more or equal to minIntand less than or equal to intMax.

IntFind Creates a new Interval Variable. Each interval of intervalVar thatcontains one or more timestamps of eventVar is copied to theresult.

MarkerExtract Creates a new event variable based on an existing markervariable.

Shift Returns a new variable with all the timestamps of variable varshifted in time by shiftBy seconds.

NthAfter Returns the N-th timestamp in var1 after the timestamp in var2.

PositionSpeed Calculates position speed from X and Y coordinate variables.Speed is calculated from positions at times (t-deltaT, t+deltaT).

FilterContinuousVariable Applies the specified frequency filter to the specified continuousvariable.

LinearCombinationOfContVars Calculates a linear combination of two continuous variables.

DecimateContVar Decimates a continuous variable.

ContAdd Creates new continuous variable with values cont[i]+number.

ContMult Creates new continuous variable with values cont[i]*number.

ContAddCont Creates a new continuous variable with valuescontVar1[i]+contVar2[i], returns a reference to the new variable.

See Also Introduction to NexScript and Python Programming Function Categories

Page 431

Page 434: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.1. Rename

Rename Function Renames the specified variable.

Syntax Rename(doc, var, newName)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

var variableReference Reference to the variable.

newName string The new name of the variable.

Returns None

Usage

NexScript doc = GetActiveDocument()Rename(doc, doc["Strobed_01"], "LightOn")

Python import nexdoc = nex.GetActiveDocument()nex.Rename(doc, doc["Strobed_01"], "LightOn")

See Also Introduction to NexScript and Python Programming Function Categories

Page 432

Page 435: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.2. Join

Join Function Creates the new event that contains the timestamps of the two specified variables.

Syntax variableReference Join(var1, var2)

Parameters

Parameter Type Description

var1 variableReference Reference to the variable.

var2 variableReference Reference to the variable.

Returns Reference to the new variable.

Comments Creates the new event that contains both the timestamps of var1 and the timestamps of var2.

Usage

NexScript doc = GetActiveDocument()doc["Events4and5"] = Join(doc["Event4"], doc["Event5"])

Python import nexdoc = nex.GetActiveDocument()doc["Events4and5"] = nex.Join(doc["Event4"], doc["Event5"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 433

Page 436: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.3. Sync

Sync Function Creates the new event containing all the timestamps of var1 that are in the intervals [var2+fromTime,var2+toTime].

Syntax variableReference Sync(var1, var2, fromTime, toTime)

Parameters

Parameter Type Description

var1 variableReference Reference to the variable.

var2 variableReference Reference to the variable.

fromTime number Offset minimum (seconds).

toTime number Offset maximum (seconds).

Returns Reference to the new variable.

Comments Creates the new event containing all the timestamps of var1 that are in the intervals [var2+from, var2+to]

Usage

NexScript doc = GetActiveDocument()doc["synced_1_and_2"] = Sync(doc["Neuron1"], doc["Neuron2"], -0.01, 0.01)

Python import nexdoc = nex.GetActiveDocument()doc["synced_1_and_2"] = nex.Sync(doc["Neuron1"], doc["Neuron2"], -0.01, 0.01)

See Also Introduction to NexScript and Python Programming Function Categories

Page 434

Page 437: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.4. NotSync

NotSync Function Creates the new event containing all the timestamps of var1 that are NOT in the intervals[var2+fromTime, var2+toTime].

Syntax variableReference NotSync(var1, var2, fromTime, toTime)

Parameters

Parameter Type Description

var1 variableReference Reference to the variable.

var2 variableReference Reference to the variable.

fromTime number Offset minimum (seconds).

toTime number Offset maximum (seconds).

Returns Reference to the new variable.

Comments None

Usage

NexScript doc = GetActiveDocument()doc["notSync_4_and_5"] = NotSync(doc["Neuron04"], doc["Neuron05"], -0.01, 0.01)

Python import nexdoc = nex.GetActiveDocument()doc["notSync_4_and_5"] = nex.NotSync(doc["Neuron04"], doc["Neuron05"], - 0.01, 0.01)

See Also Introduction to NexScript and Python Programming Function Categories

Page 435

Page 438: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.5. FirstAfter

FirstAfter Function Creates the new event containing the first timestamp of var1 in each of the intervals [var2+fromTime,var2+toTime].

Syntax variableReference FirstAfter(var1, var2, fromTime, toTime)

Parameters

Parameter Type Description

var1 variableReference Reference to the variable.

var2 variableReference Reference to the variable.

fromTime number Offset of interval start around var2 timestamps.

toTime number Offset of interval end around var2 timestamps.

Returns Reference to the new variable.

Comments Creates the new event containing the first timestamp of var1 in each of the intervals [var2+from, var2+to].

Usage

NexScript doc = GetActiveDocument()% find the first spike of Neuron1 after each stimulus (in the first second afterstimulus)doc["FirstN1"] = FirstAfter(doc["Neuron1"], doc["Stimulus"], 0, 1)

Python import nexdoc = nex.GetActiveDocument()# find the first spike of Neuron1 after each stimulus (in the first second afterstimulus)doc["FirstN1"] = nex.FirstAfter(doc["Neuron1"], doc["Stimulus"], 0, 1)

See Also Introduction to NexScript and Python Programming Function Categories

Page 436

Page 439: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.6. FirstNAfter

FirstNAfter Function Creates the new event containing the first N timestamps of one variable after each of the timestamps ofthe second variable.

Syntax variableReference FirstNAfter(var1, var2, count)

Parameters

Parameter Type Description

var1 variableReference Reference to the variable.

var2 variableReference Reference to the variable.

count number How many timestamps of var1 (that are after eachtimestamp of var2) to copy to the result.

Returns The reference to the new variable. 

Comments None

Usage

NexScript doc = GetActiveDocument()doc["first5SpikesAfterStimulus"] = FirstNAfter(doc["Neuron1"], doc["Stimulus"], 5)

Python import nexdoc = nex.GetActiveDocument()doc["first5SpikesAfterStimulus"] = nex.FirstNAfter(doc["Neuron1"], doc["Stimulus"],5)

See Also Introduction to NexScript and Python Programming Function Categories

Page 437

Page 440: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.7. LastBefore

LastBefore Function Creates the new event containing the last timestamp of var1 in each of the intervals [var2+fromTime,var2+toTime].

Syntax variableReference LastBefore(var1, var2, fromTime, toTime)

Parameters

Parameter Type Description

var1 variableReference Reference to the variable.

var2 variableReference Reference to the variable.

fromTime number Interval start offset (seconds).

toTime number Interval end offset (seconds).

Returns Reference to the new variable.

Comments Creates the new event containing the last timestamp of var1 in each of the intervals [var2+from, var2+to].

Usage

NexScript doc = GetActiveDocument()doc["lastBefore"] = LastBefore(doc["Neuron1"], doc["Event4"], 0, 5)

Python import nexdoc = nex.GetActiveDocument()doc["lastBefore"] = nex.LastBefore(doc["Neuron1"], doc["Event4"], 0, 5)

See Also Introduction to NexScript and Python Programming Function Categories

Page 438

Page 441: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.8. IntervalFilter

IntervalFilter Function Creates the new event containing all the timestamps of the specified event or neuron variable that are inthe intervals of the specified interval variable.

Syntax variableReference IntervalFilter(var, intervalVar)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

intervalVar variableReference Reference to the interval variable.

Returns Reference to the new variable.

Comments Creates the new event containing all the timestamps of var that are in the intervals of the intervalVar

Usage

NexScript doc = GetActiveDocument()doc["filtered"] = IntervalFilter(doc["Neuron1"], doc["Trials"])

Python import nexdoc = nex.GetActiveDocument()doc["filtered"] = nex.IntervalFilter(doc["Neuron1"], doc["Trials"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 439

Page 442: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.9. SelectTrials

SelectTrials Function Creates the new event containing the specified timestamps of a variable.

Syntax variableReference SelectTrials(var, selectList)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

selectList string A list of comma-separated indexes or ranges oftimestamps. for example: 1,3-5,10.

Returns The reference to the new variable.

Comments None

Usage

NexScript doc = GetActiveDocument()doc["selectedEvents"] = SelectTrials(doc["Event04"], "1,5-10")

Python import nexdoc = nex.GetActiveDocument()doc["selectedEvents"] = nex.SelectTrials(doc["Event04"], "1,5-10")

See Also Introduction to NexScript and Python Programming Function Categories

Page 440

Page 443: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.10. SelectRandom

SelectRandom Function Creates the new event containing randomly selected timestamps of the specified variable.

Syntax variableReference SelectRandom(var, nSelect)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

nSelect number Number of timestamps to select.

Returns The reference to the new event containing randomly selected timestamps of the specified variable. 

Comments None

Usage

NexScript doc = GetActiveDocument()doc["randomEvents04"] = SelectRandom(doc["Event04"], 10)

Python import nexdoc = nex.GetActiveDocument()doc["randomEvents04"] = nex.SelectRandom(doc["Event04"], 10)

See Also Introduction to NexScript and Python Programming Function Categories

Page 441

Page 444: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.11. SelectEven

SelectEven Function Creates the new event containing even (2nd, 4th, etc.) timestamps of the specified variable.

Syntax variableReference SelectEven(var)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

Returns The reference to the new event containing even (2nd, 4th, etc.) timestamps of the specified variable.

Comments None

Usage

NexScript doc = GetActiveDocument()doc["evenEvents04"] = SelectEven(doc["Event04"])

Python import nexdoc = nex.GetActiveDocument()doc["evenEvents04"] = nex.SelectEven(doc["Event04"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 442

Page 445: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.12. SelectOdd

SelectOdd Function Creates the new event containing the odd (1st, 3rd, etc.) timestamps of the specified variable.

Syntax variableReference SelectOdd(var)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

Returns The reference to the new event containing the odd (1st, 3rd, etc.) timestamps of the specified variable.

Comments None

Usage

NexScript doc = GetActiveDocument()doc["oddEvents04"] = SelectOdd(doc["Event04"])

Python import nexdoc = nex.GetActiveDocument()doc["oddEvents04"] = nex.SelectOdd(doc["Event04"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 443

Page 446: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.13. ISIFilter

ISIFilter Function Creates the new event containing the timestamps of the specified variable that have preceding interspikeintervals larger than the specified value.

Syntax variableReference ISIFilter(var, minISI)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

minISI number Minimum ISI (in seconds).

Returns Reference to the new variable. 

Comments Creates the new event containing timestamps of the variable var that have preceding interspike intervalslarger than minISI.

Usage

NexScript doc = GetActiveDocument()doc["RemovedSmallISI"] = ISIFilter(doc["Neuron1"], 0.1)

Python import nexdoc = nex.GetActiveDocument()doc["RemovedSmallISI"] = nex.ISIFilter(doc["Neuron1"], 0.1)

See Also Introduction to NexScript and Python Programming Function Categories

Page 444

Page 447: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.14. FirstInInterval

FirstInInterval Function Creates the new event. For each interval of the specified interval variable, the first timestamp in thisinterval is copied to the result.

Syntax variableReference FirstInInterval(var, intervalVar)

Parameters

Parameter Type Description

var variableReference Reference to the neuron or event variable.

intervalVar variableReference Reference to the interval variable.

Returns The reference to the new variable.

Comments Creates the new event. For each interval of intervalVar, the first var timestamp in this interval is copied tothe result.

Usage

NexScript doc = GetActiveDocument()doc["firstInTrial"] = FirstInInterval(doc["Neuron1"], doc["Trials"])

Python import nexdoc = nex.GetActiveDocument()doc["firstInTrial"] = nex.FirstInInterval(doc["Neuron1"], doc["Trials"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 445

Page 448: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.15. LastInInterval

LastInInterval Function Creates the new event. For each interval of the specified interval variable, the last timestamp in thisinterval is copied to the result.

Syntax variableReference LastInInterval(var, intervalVar)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

intervalVar variableReference Reference to the interval variable.

Returns Reference to the new variable.

Comments Creates the new event. For each interval of intervalVar, the last var timestamp in this interval is copied tothe result.

Usage

NexScript doc = GetActiveDocument()doc["LastSpikeInTrial"] = LastInInterval(doc["Neuron1"], doc["Trials"])

Python import nexdoc = nex.GetActiveDocument()doc["LastSpikeInTrial"] = nex.LastInInterval(doc["Neuron1"], doc["Trials"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 446

Page 449: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.16. StartOfInterval

StartOfInterval Function Creates the new event. Copies the start of each interval of the specified interval variable to the result.

Syntax variableReference StartOfInterval(intervalVar)

Parameters

Parameter Type Description

intervalVar variableReference Reference to the interval variable.

Returns Reference to the new variable.

Comments Creates the new event. Copies the start of each interval of intervalVar to the result.

Usage

NexScript doc = GetActiveDocument()doc["TrialStarts"] = StartOfInterval(doc["Trials"])

Python import nexdoc = nex.GetActiveDocument()doc["TrialStarts"] = nex.StartOfInterval(doc["Trials"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 447

Page 450: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.17. EndOfInterval

EndOfInterval Function Creates the new event based on the specified interval variable. Copies the end of each interval of theinterval variable to the result.

Syntax variableReference EndOfInterval(intervalVar)

Parameters

Parameter Type Description

intervalVar variableReference Reference to an interval variable.

Returns Reference to the new variable. 

Comments Creates the new event based on the specified interval variable. Copies the end of each interval of theinterval variable to the result.

Usage

NexScript doc = GetActiveDocument()doc["trialEnds"] = EndOfInterval(doc["Trials"])

Python import nexdoc = nex.GetActiveDocument()doc["trialEnds"] = nex.EndOfInterval(doc["Trials"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 448

Page 451: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.18. MakeIntervals

MakeIntervals Function Creates new interval variable with intervals [varTimestamp+shiftMin, varTimestamp+shiftMax].Overlapping intervals are merged.

Syntax variableReference MakeIntervals(var, shiftMin, shiftMax)

Parameters

Parameter Type Description

var variableReferenceUseTimestamps

Reference to neuron, event, marker, interval orwaveform variable. For neuron, event or markervariable, the variable timestamps are used. Forinterval variable, interval start times are used astimestamps. For waveform variable, wave timestampsare used.

shiftMin number Shift minimum in seconds.

shiftMax number Shift maximum in seconds.

Returns Reference to the new variable.

Comments Creates new interval variable with intervals [varTimestamp+shiftMin, varTimestamp+shiftMax].Overlapping intervals are merged.

Usage

NexScript doc = GetActiveDocument()doc["IntAroundEvent04"] = MakeIntervals(doc["Event04"], 0, 2)

Python import nexdoc = nex.GetActiveDocument()doc["IntAroundEvent04"] = nex.MakeIntervals(doc["Event04"], 0, 2)

See Also Introduction to NexScript and Python Programming Function Categories

Page 449

Page 452: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.19. MakeIntFromStart

MakeIntFromStart Function Creates new interval variable. For each timestamp tstart of intStartVar, it looks for the first timestamptend of the intEndVar after tstart. If tend is before the next timestamp of intStartVar, it adds the interval [tstart +shift1, tend +shift2] to the result.

Syntax variableReference MakeIntFromStart(intStartVar, intEndVar, shift1, shift2)

Parameters

Parameter Type Description

intStartVar variableReference Reference to the variable

intEndVar variableReference Reference to the variable

shift1 number Shift minimum (seconds).

shift2 number Shift maximum (seconds).

Returns Reference to the new variable.

Comments None

Usage

NexScript doc = GetActiveDocument()doc["Int2"] = MakeIntFromStart(doc["Event04"], doc["Event05"], -0.1, 0.1)

Python import nexdoc = nex.GetActiveDocument()doc["Int2"] = nex.MakeIntFromStart(doc["Event04"], doc["Event05"], - 0.1, 0.1)

See Also Introduction to NexScript and Python Programming Function Categories

Page 450

Page 453: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.20. MakeIntFromEnd

MakeIntFromEnd Function Creates new interval variable. For each timestamp tend of the intEndVar, it looks for the last timestamp (tstart ) of the intStartVar before tend. If tstart is after the previous timestamp of intEndVar, it adds theinterval [ tstart +shift1, tend +shift2] to the result.

Syntax variableReference MakeIntFromEnd(intStartVar, intEndVar, shift1, shift2)

Parameters

Parameter Type Description

intStartVar variableReferenceUseTimestamps

Reference to neuron, event, marker, interval orwaveform variable. For neuron, event or markervariable, the variable timestamps are used. Forinterval variable, interval start times are used astimestamps. For waveform variable, wave timestampsare used.

intEndVar variableReferenceUseTimestamps

Reference to neuron, event, marker, interval orwaveform variable. For neuron, event or markervariable, the variable timestamps are used. Forinterval variable, interval start times are used astimestamps. For waveform variable, wave timestampsare used.

shift1 number Shift minimum (seconds).

shift2 number Shift maximum (seconds).

Returns Reference to the new variable. 

Comments None

Usage

NexScript doc = GetActiveDocument()doc["Int2"] = MakeIntFromEnd(doc["Event04"], doc["Event05"], -0.1, 0.1)

Python import nexdoc = nex.GetActiveDocument()doc["Int2"] = nex.MakeIntFromEnd(doc["Event04"], doc["Event05"], - 0.1, 0.1)

See Also Introduction to NexScript and Python Programming

Page 451

Page 454: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Function Categories

Page 452

Page 455: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.21. IntOpposite

IntOpposite Function Creates a new interval variable that contains intervals 'complementary' to the intervals of the specifiedinterval variable.

Syntax variableReference IntOpposite(doc, intervalVariable)

Parameters

Parameter Type Description

doc documentReference Reference to the document

intervalVariable variableReference Reference to the interval variable.

Returns Reference to the new interval variable.

Comments Creates a new interval variable that contains intervals 'complementary' to the intervals of intervalVariable.

Usage

NexScript doc = GetActiveDocument()doc["OusideTrials"] = IntOpposite(doc, doc["Trials"])

Python import nexdoc = nex.GetActiveDocument()doc["OusideTrials"] = nex.IntOpposite(doc, doc["Trials"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 453

Page 456: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.22. IntOr

IntOr Function Creates a new Interval Variable that contains unions of the intervals of intervalVar1 and intervalVar2.

Syntax variableReference IntOr(doc, intervalVar1, intervalVar2)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

intervalVar1 variableReference Reference to the interval variable.

intervalVar2 variableReference Reference to the interval variable.

Returns Reference to the new interval variable.

Comments Creates a new Interval Variable that contains unions of the intervals of intervalVar1 and intervalVar2

Usage

NexScript doc = GetActiveDocument()doc["Trials1and2"] = IntOr(doc, doc["Trials1"], doc["Trials2"])

Python import nexdoc = nex.GetActiveDocument()doc["Trials1and2"] = nex.IntOr(doc, doc["Trials1"], doc["Trials2"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 454

Page 457: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.23. IntAnd

IntAnd Function Creates a new Interval Variable that contains intersections of the intervals of intervalVar1 andintervalVar2.

Syntax variableReference IntAnd(intervalVar1, intervalVar2)

Parameters

Parameter Type Description

intervalVar1 variableReference Reference to the interval variable.

intervalVar2 variableReference Reference to the interval variable.

Returns The reference to the new interval variable. 

Comments Creates a new Interval Variable that contains intersections of the intervals of intervalVar1 andintervalVar2

Usage

NexScript doc["Int3"] = IntAnd(doc["Interval1"], doc["Interval2"])

Python import nexdoc["Int3"] = nex.IntAnd(doc["Interval1"], doc["Interval2"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 455

Page 458: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.24. IntSize

IntSize Function Creates a new Interval Variable that contains the intervals with the specified length range.

Syntax variableReference IntSize(intervalVar, minInt, maxInt)

Parameters

Parameter Type Description

intervalVar variableReference Reference to the interval variable.

minInt number Minimum interval length (in seconds).

maxInt number Maximum interval length (in seconds).

Returns Reference to the new interval variable.

Comments Creates a new Interval Variable that contains all of the intervals of intervalVar that have the length whichis more or equal to minInt and less than or equal to intMax.

Usage

NexScript doc = GetActiveDocument()doc["TrialsLessThan10secDuration"] = IntSize(doc["Trials"], 0, 10)

Python import nexdoc = nex.GetActiveDocument()doc["TrialsLessThan10secDuration"] = nex.IntSize(doc["Trials"], 0, 10)

See Also Introduction to NexScript and Python Programming Function Categories

Page 456

Page 459: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.25. IntFind

IntFind Function Finds all intervals that contain at least one timestamp of the specified event or neuron variable.

Syntax variableReference IntFind(intervalVar, eventVar)

Parameters

Parameter Type Description

intervalVar variableReference Reference to the interval variable.

eventVar variableReference Reference to the event or neuron variable.

Returns None

Comments Creates a new Interval Variable. Each interval of intervalVar that contains one or more timestamps ofeventVar is copied to the result.

Usage

NexScript doc = GetActiveDocument()doc["IntervalsWithEvent04"] = IntFind(doc["Interval1"], doc["Event4"])

Python import nexdoc = nex.GetActiveDocument()doc["IntervalsWithEvent04"] = nex.IntFind(doc["Interval1"], doc["Event4"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 457

Page 460: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.26. MarkerExtract

MarkerExtract Function Creates a new event variable based on existing marker variable.

Syntax variableReference MarkerExtract(doc, MarkerVariableName, ExtractString)

Parameters

Parameter Type Description

doc documentReference Reference to the document

MarkerVariableName string The name of the marker variable.

ExtractString string Extract string. See comments.

Returns None

Comments ExtractString contains a list of items separated by commas. Items AND or OR should be placedbetween the conditions for the sample field. Conditions for each marker field should end with the itemEOF. The last item in ExtractString list should be END. For example, assume that we have a marker variable Strobed with one field that contains integer values.To extract all the timestamps with the field value 3 you may use the following command: doc["NewEvent"] = MarkerExtract(doc, "Strobed", "=3,EOF,END") To extract all the timestamps with the field values 3, 4 and 5 you may use the command: doc["NewEvent"] = MarkerExtract(doc, "Strobed", ">2,AND,<6,EOF,END") To use string comparisons in timestamp extraction, add $ sign at the beginning of the string. Forexample, to extract timestamps with Ev_Marker field value WL, use: doc["NewEvent1"] = MarkerExtract(doc, "Ev_Marker", "=$WL,EOF,END")  

Usage

NexScript doc = GetActiveDocument()doc["NewEvent"] = MarkerExtract(doc, "Strobed", "=3,EOF,END")

Python import nexdoc = nex.GetActiveDocument()doc["NewEvent"] = nex.MarkerExtract(doc, "Strobed", "=3,EOF,END")

See Also

Page 458

Page 461: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Introduction to NexScript and Python Programming Function Categories

Page 459

Page 462: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.27. Shift

Shift Function Returns a new variable with all the timestamps of variable var shifted in time by shiftBy seconds.

Syntax variableReference Shift(var, shiftBy)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

shiftBy number Shift value (in seconds).

Returns Reference to the new variable.

Comments Returns a new variable with all the timestamps of variable var shifted in time by shiftBy seconds.

Usage

NexScript doc = GetActiveDocument()doc["Event04Shifted"] = Shift(doc["Event04"], 10)

Python import nexdoc = nex.GetActiveDocument()doc["Event04Shifted"] = nex.Shift(doc["Event04"], 10)

See Also Introduction to NexScript and Python Programming Function Categories

Page 460

Page 463: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.28. NthAfter

NthAfter Function Creates the new variable with the N-th timestamp in var1 after each timestamp in var2.

Syntax variableReference NthAfter(var1, var2, N)

Parameters

Parameter Type Description

var1 variableReference Reference to the variable

var2 variableReference Reference to the variable

N number Spike number.

Returns Reference to the new variable.

Comments Creates the new variable with the N-th timestamp in var1 after each timestamp in var2.

Usage

NexScript doc = GetActiveDocument()doc["SecondSpike"] = NthAfter(doc["Neuron1"], doc["Neuron2"], 2)

Python import nexdoc = nex.GetActiveDocument()doc["SecondSpike"] = nex.NthAfter(doc["Neuron1"], doc["Neuron2"], 2)

See Also Introduction to NexScript and Python Programming Function Categories

Page 461

Page 464: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.29. PositionSpeed

PositionSpeed Function Calculates the position speed from X and Y coordinate variables and creates a new continuous variable.

Syntax variableReference PositionSpeed(varX, varY, deltaT, smoothRadius)

Parameters

Parameter Type Description

varX variableReference Reference to the variable.

varY variableReference Reference to the variable.

deltaT number Time step for speed calculation.

smoothRadius number Smooth parameter. See Comments.

Returns Reference to the new variable 

Comments PositionSpeed operation calculates the scalar speed of a pair of the position variables. 1. First, for each data point of Position variable PosX[T], where T is time, the raw scalar speed iscalculated: dX = PosX[ T + DeltaT ] - PosX[ T ] dY = PosY[ T + DeltaT ] - PosY[ T ] RawScalarSpeed[ T ] = sqrt( dX*dX + dY*dY ) / DeltaT If there is no data point at time T + DeltaT, a linear interpolation is used to calculate PosX[T + DeltaT]and PosY[T + DeltaT]. 2. Second, RawScalarSpeed is smoothed with the Gaussian filter. The parameters of the filter are suchthat the width (in seconds) of the Gaussian curve at half the height is equal to the value of Smoothparameter. If Smooth = 0, Gaussian filter is not applied.  

Usage

NexScript doc = GetActiveDocument()doc["speed"] = PositionSpeed(doc["LED1_X"], doc["LED1_Y"], 0.1, 0.5)

Python import nexdoc = nex.GetActiveDocument()doc["speed"] = nex.PositionSpeed(doc["LED1_X"], doc["LED1_Y"], 0.1, 0.5)

Page 462

Page 465: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

See Also Introduction to NexScript and Python Programming Function Categories

Page 463

Page 466: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.30. FilterContinuousVariable

FilterContinuousVariable Function Filters the specified continuous variable using the specified frequency filter.

Syntax FilterContinuousVariable(doc, contVar, filteredVarName, filterType, filterOrder, freq1, freq2)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

contVar variableReference Reference to the variable.

filteredVarName string The name of the filtered variable.

filterType string The type of the filter. Should be "Lowpass","Highpass", "Bandpass", "Bandstop" or "Notch".

filterOrder number The number specifying the filter order. Should bebetween 3 and 11 inclusive.

freq1 number Filter frequency parameter (in Hz). See commentsbelow.

freq2 number Filter frequency parameter (in Hz). See commentsbelow.

Returns None

Comments If the filter type is Lowpass or Highpass, freq1 is a cutoff frequency and freq2 is not used. Butterworthfilter is used. If the filter type is Bandpass or Bandstop, freq1 is a minimum of the frequency range and freq2 is amaximum of the frequency range. Butterworth filter is used. If the filter type is Notch, freq1 is the center of Notch filter and freq2 is the width of the Notch filter.Standard Notch filter is used.

Usage

NexScript The following sample script applies Bandpass filter to the variable ContChannel01. The result of filteringwill be saved in continuous variable Cont1BandFiltered. The filter order is 5 and the frequency band isfrom 1000 Hz to 2000 Hz: doc = GetActiveDocument()var = GetVarByName(doc, "ContChannel01")FilterContinuousVariable(doc, var, "Cont1BandFiltered", "Bandpass", 5, 1000, 2000)

Page 464

Page 467: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Python import nexdoc = nex.GetActiveDocument()var = nex.GetVarByName(doc, "ContChannel01")nex.FilterContinuousVariable(doc, var, "Cont1BandFiltered", "Bandpass", 5, 1000,2000)

See Also Introduction to NexScript and Python Programming Function Categories

Page 465

Page 468: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.31. LinearCombinationOfContVars

LinearCombinationOfContVars Function Calculates a linear combination of two continuous variables.

Syntax LinearCombinationOfContVars(doc, resultName, contVar1, coeff1, contVar2, coeff2)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

resultName string The name of the result.

contVar1 variableReference Reference to the first continuous variable.

coeff1 number Coefficient for the first continuous variable

contVar2 variableReference Reference to the second continuous variable.

coeff2 number Coefficient for the second continuous variable

Returns None

Comments This function calculates a linear combination of two continuous variables. The values of the resultingvariable are: contVar1_value*coeff1 + contVar2_value*coeff2 Starting with version 5.104, you can get the same result by using math operations (multiplication andaddition) on document continuous variables: doc['contVar1_2_Average'] = doc['contVar1']*0.5 + doc['contVar2']*0.5

Usage

NexScript doc = GetActiveDocument()% calculate average of contVar1 and contVar2LinearCombinationOfContVars(doc, "average", doc["contVar1"], 0.5, doc["contVar2"],0.5)

Python import nexdoc = nex.GetActiveDocument()# calculate average of contVar1 and contVar2nex.LinearCombinationOfContVars(doc, "average", doc["contVar1"], 0.5,doc["contVar2"], 0.5)

Page 466

Page 469: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

See Also Introduction to NexScript and Python Programming Function Categories

Page 467

Page 470: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.32. AbsOfContVar

AbsOfContVar Function Calculates an absolute value of the signal of a continuous variable.

Syntax AbsOfContVar(doc, resultName, contVar)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

resultName string The name of the result.

contVar variableReference Reference to continuous variable.

Returns None

Comments This function calculates an absolute value of the signal of a continuous variable. The values of theresulting variable are: abs(contVar_value)

Usage

NexScript doc = GetActiveDocument()% calculate abs of FP01 and store result in document variable with the name'absOfFP01'AbsOfContVar(doc, "absOfFP01", doc["FP01"])

Python import nexdoc = nex.GetActiveDocument()# calculate abs of FP01 and store result in document variable with the name'absOfFP01'nex.AbsOfContVar(doc, "absOfFP01", doc["FP01"])

See Also Introduction to NexScript and Python Programming Function Categories

Page 468

Page 471: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.33. DecimateContVar

DecimateContVar Function Decimates a continuous variable.

Syntax DecimateContVar(doc, resultName, contVar, decimationFactor)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

resultName string The name of the decimated continuous variable.

contVar variableReference Reference to the variable.

decimationFactor number If decimationFactor = 2, every second data point ofcontVar is copied to the result, if decimationFactor =3, every third, etc.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()DecimateContVar(doc, "decimated", doc["ContVar1"], 10)

Python import nexdoc = nex.GetActiveDocument()nex.DecimateContVar(doc, "decimated", doc["ContVar1"], 10)

See Also Introduction to NexScript and Python Programming Function Categories

Page 469

Page 472: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.34. ContAdd

ContAdd Script Function Creates a new continuous variable with values contVar[i]+numberToAdd, returns a reference to the newvariable.

Syntax variableReference ContAdd(contVar, numberToAdd)

Parameters

Parameter Type Description

contVar variableReference Reference to the variable.

numberToAdd number The number to add to each value of the contVar

Returns Creates a new continuous variable with values contVar[i]+numberToAdd, returns a reference to the newvariable.

Comments

Usage

NexScript doc = GetActiveDocument()baseLine = 10.0doc["subtractedBaseLine"] = ContAdd(doc["FP01"], -baseLine)

Python import nexdoc = nex.GetActiveDocument()baseLine = 10.0doc["subtractedBaseLine"] = nex.ContAdd(doc["FP01"], -baseLine) # you can also use arithmetic operations on continuous variables:doc["subtractedBaseLine"] = doc["FP01"] - baseLine doc["average of FP01 and FP02"] = ( doc["FP01"] + doc["FP02"] ) / 2

See Also Introduction to NexScript and Python Programming Function Categories

Page 470

Page 473: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.35. ContMult

ContMult Script Function Creates a new continuous variable with values contVar[i]*numberToMultiply, returns a reference to thenew variable.

Syntax variableReference ContMult(contVar, numberToMultiply)

Parameters

Parameter Type Description

contVar variableReference Reference to the variable.

numberToMultiply number The result values will be contVar[i]*numberToMultiply.

Returns Creates a new continuous variable with values contVar[i]*numberToMultiply, returns a reference to thenew variable.

Comments

Usage

NexScript doc = GetActiveDocument()coeff = -1.0doc["invertedFP01"] = ContMult(doc["FP01"], coeff)

Python import nexdoc = nex.GetActiveDocument()coeff = -1.0doc["invertedFP01"] = nex.ContMult(doc["FP01"], coeff) # you can also use arithmetic operations on continuous variables:doc["average of FP01 and FP02"] = ( doc["FP01"] + doc["FP02"] ) / 2

See Also Introduction to NexScript and Python Programming Function Categories

Page 471

Page 474: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.7.36. ContAddCont

ContAddCont Script Function Creates a new continuous variable with values contVar1[i]+contVar2[i], returns a reference to the newvariable.

Syntax variableReference ContAddCont(contVar1, contVar2)

Parameters

Parameter Type Description

contVar1 variableReference Reference to the continuous variable.

contVar2 variableReference Reference to the continuous variable. contVar1 andcontVar2 should have the same number of continuousvalues.

Returns Creates a new continuous variable with values contVar1[i]+contVar2[i], returns a reference to the newvariable. The timestamps of the new variable are copied from contVar1. Timestamps of contVar2 areignored.

Comments

Usage

NexScript doc = GetActiveDocument()theSumOfFP1andFP2 = ContAddCont(doc["FP01"], doc["FP02"])

Python import nexdoc = nex.GetActiveDocument()theSumOfFP1andFP2 = nex.ContAddCont(doc["FP01"], doc["FP02"]) # you can also use arithmetic operations on continuous variables:doc["average of FP01 and FP02"] = ( doc["FP01"] + doc["FP01"] ) / 2

See Also Introduction to NexScript and Python Programming Function Categories

Page 472

Page 475: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.8. Matlab Functions The following matlab functions are available in NexScript and Python

Function Description

SendSelectedVarsToMatlab Sends the selected variables to Matlab.

ExecuteMatlabCommand Sends the string command to Matlab and executes the commandin Matlab.

GetVarFromMatlab Gets the specified timestamped variable (array of timestamps)from Matlab.

GetContVarFromMatlab Imports the specified matrix containing continuous variable datafrom Matlab.

GetContVarWithTimestampsFrom

Matlab

Imports the specified matrix containing continuous variable datafrom Matlab.

GetIntervalVarFromMatlab Imports the specified matrix containing intervals from Matlab.

See Also Introduction to NexScript and Python Programming Function Categories

Page 473

Page 476: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.8.1. SendSelectedVarsToMatlab

SendSelectedVarsToMatlab Function Sends selected variables to Matlab.

Syntax SendSelectedVarsToMatlab(doc)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()SendSelectedVarsToMatlab(doc)

Python import nexdoc = nex.GetActiveDocument()nex.SendSelectedVarsToMatlab(doc)

See Also Introduction to NexScript and Python Programming Function Categories

Page 474

Page 477: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.8.2. ExecuteMatlabCommand

ExecuteMatlabCommand Function Sends the string command to Matlab and executes the command in Matlab.

Syntax string ExecuteMatlabCommand(command)

Parameters

Parameter Type Description

command string Matlab command to be run.

Returns String with the result of Matlab command.

Comments Any valid Matlab command that you can type at Matlab prompt can be used. For example, you can call aMatlab script or a function.

Usage

NexScript ExecuteMatlabCommand("x=randn(10,1);plot(x)")varList = ExecuteMatlabCommand("who")

Python import nexnex.ExecuteMatlabCommand("x=randn(10,1);plot(x)")varList = nex.ExecuteMatlabCommand("who")

See Also Introduction to NexScript and Python Programming Function Categories

Page 475

Page 478: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.8.3. GetVarFromMatlab

GetVarFromMatlab Function Gets the specified neuron or event variable from Matlab.

Syntax GetVarFromMatlab(doc, varname, isneuron)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

varname string The name of the matrix in Matlab workspace. Thematrix should be a number matrix with either one rowor one column of data containing timestamps inseconds.

isneuron number  If isneuron is 1, the imported variable is added to thelist of Neurons. Otherwise, the variable is added to thelist of events.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()% get the 1-column matrix ev1 and add it to the list of eventsGetVarFromMatlab(doc, "ev1", 0)

Python import nexdoc = nex.GetActiveDocument()# get the 1-column matrix ev1 and add it to the list of eventsnex.GetVarFromMatlab(doc, "ev1", 0)

See Also Introduction to NexScript and Python Programming Function Categories

Page 476

Page 479: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.8.4. GetContVarFromMatlab

GetContVarFromMatlab Function Imports the specified matrix from Matlab. Each column of the matrix is imported as a continuous variable.

Syntax GetContVarFromMatlab(doc, MatrixName, TimestampOfFirstValue, TimeStep)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

MatrixName string The name of a matrix in Matlab workspace.

TimestampOfFirstValue number The timestamp (in seconds) of the first value of eachcontinuous variable.

TimeStep number Digitizing time step (in seconds) of the importedvariables.

Returns None

Comments This function adds continuous variables to the specified document. The names of the variables includethe MatrixName and the column number.

Usage

NexScript doc = GetActiveDocument()% import matrix contData from Matlab. first timestamp is 0, time step is 0.001s.GetContVarFromMatlab(doc, "contData", 0, 0.001)

Python import nexdoc = nex.GetActiveDocument()# import matrix contData from Matlab. first timestamp is 0, time step is 0.001s.nex.GetContVarFromMatlab(doc, "contData", 0, 0.001)

See Also Introduction to NexScript and Python Programming Function Categories

Page 477

Page 480: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.8.5. GetContVarWithTimestampsFromMatlab

GetContVarWithTimestampsFromMatlab Function Imports the specified 2-column matrix containing continuous variable data from Matlab.

Syntax GetContVarWithTimestampsFromMatlab(doc, MatrixName, UseFirstDeltaAsDigRate)

Parameters

Parameter Type Description

doc documentReference Reference to the document

MatrixName string The name of the Matrix in Matlab workspace. The firstcolumn of the matrix should contain the values of acontinuous variable, the second column - thecorresponding timestamps.

UseFirstDeltaAsDigRate number Valid values are 0 or 1. If this parameter is positive,the difference between the second and the firsttimestamp is used as the variable digitizing rate.

Returns None

Comments This function adds a continuous variable to the specified document. The name of the new variable is theMatrixName.

Usage

NexScript doc = GetActiveDocument()GetContVarWithTimestampsFromMatlab(doc, "contData", 1)

Python import nexdoc = nex.GetActiveDocument()nex.GetContVarWithTimestampsFromMatlab(doc, "contData", 1)

See Also Introduction to NexScript and Python Programming Function Categories

Page 478

Page 481: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.8.6. GetIntervalVarFromMatlab

GetIntervalVarFromMatlab Function Imports the specified matrix containing intervals from Matlab.

Syntax GetIntervalVarFromMatlab(doc, MatrixName)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

MatrixName string The name of the 2-column matrix in Matlabworkspace.

Returns None

Comments Imports the specified 2-column matrix from Matlab. The first column of the matrix should contain intervalstart times in seconds, the second column - interval end times in seconds.

Usage

NexScript doc = GetActiveDocument()GetIntervalVarFromMatlab(doc, "trials")

Python import nexdoc = nex.GetActiveDocument()nex.GetIntervalVarFromMatlab(doc, "trials")

See Also Introduction to NexScript and Python Programming Function Categories

Page 479

Page 482: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.9. Excel Functions The following Excel functions are available in NexScript and Python

Function Description

SetExcelCell Sets the text value of the specified cell in Excel.

CloseExcelFile Closes the specified Excel file if the file is open.

SendResultsToExcel Sends numerical results (of the first graphics window of thedocument) to Excel.

SendResultsSummaryToExcel Sends summary of numerical results (of the first graphics windowof the document) to Excel.

See Also Introduction to NexScript and Python Programming Function Categories

Page 480

Page 483: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.9.1. SetExcelCell

SetExcelCell Function Sets the text value of the specified cell in Excel.

Syntax SetExcelCell(worksheet, cell, text, excelFilePath)

Parameters

Parameter Type Description

worksheet string The name of the worksheet.

cell string Excel cell specification, Should be in the form CRwhere C is Excel column name, R is the row number.For example, "A1" is the top-left cell in the worksheet.

text string The text to be copied to the cell.

excelFilePath string Full path of the Excel file. This parameter is optional.See Usage below.

Returns None

Comments None

Usage

NexScript % this call will open Excel, Excel will create% a new workbook (Excel file) and paste the text to the specified cellSetExcelCell("fromNex", "A1", "cell text") % this call will set the cell in the specified Excel fileSetExcelCell("fromNex", "A1", "cell text", "C:\Data\Results.xls")

Python import nex# this call will open Excel, Excel will create# a new workbook (Excel file) and paste the text to the specified cellnex.SetExcelCell("fromNex", "A1", "cell text")# this call will set the cell in the specified Excel filenex.SetExcelCell("fromNex", "A1", "cell text", "C:\\Data\\Results.xls")

See Also Introduction to NexScript and Python Programming Function Categories

Page 481

Page 484: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.9.2. CloseExcelFile

CloseExcelFile Function Closes the specified Excel file if the file is open.

Syntax CloseExcelFile(filePath)

Parameters

Parameter Type Description

filePath string Full path of the Excel file.

Returns None

Comments In Python, backslash character (\) has a special meaning. When specifying a Windows path like"C:\Data\NexResults.xls" in Python, use either "C:/Data/NexResults.xls" or "C:\\Data\\NexResults.xls".

Usage

NexScript excelFilePath = "C:\Data\NexResults.xls"SendResultsToExcel(doc, excelFilePath, "Nex", 0, "A1", 1, 0)CloseExcelFile(excelFilePath)

Python import nexexcelFilePath = "C:\\Data\\NexResults.xls"nex.SendResultsToExcel(doc, excelFilePath, "Nex", 0, "A1", 1, 0)nex.CloseExcelFile(excelFilePath)

See Also Introduction to NexScript and Python Programming Function Categories

Page 482

Page 485: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.10. PowerPoint Functions The following PowerPoint functions are available in NexScript and Python

Function Description

SendGraphicsToPowerPoint Sends analysis graphics to the specified PowerPoint file.

ClosePowerPointFile Closes the specified PowerPoint file if the file is open.

See Also Introduction to NexScript and Python Programming Function Categories

Page 483

Page 486: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.10.1. SendGraphicsToPowerPoint

SendGraphicsToPowerPoint Function Sends the contents of the first graphical window of the document to the specified PowerPointpresentation.

Syntax SendGraphicsToPowerPoint (doc, presentationPath, slideTitle, comment, addParameters, useBitmap)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

presentationPath string Path of the presentation file. File extension should be.ppt (NeuroExplorer cannot save .pptx files). If fileextension is not .ppt, .ppt extension is added to the filepath.

slideTitle string Slide title.

comment string Slide comment. Will be shown below graphics.

addParameters number If 1, add a text box with analysis parameter values.

useBitmap number If 1, transfer graphics as a bitmap, otherwise, transfergraphics as a metafile.

Returns None

Comments None

Usage

NexScript doc = GetActiveDocument()SendGraphicsToPowerPoint(doc, "C:\Data\NexResults.ppt", "Slide 1", "Sample slide", 1,0)

Python import nexdoc = nex.GetActiveDocument()nex.SendGraphicsToPowerPoint(doc, "C:\\Data\\NexResults.ppt", "Slide 1", "Sampleslide", 1, 0)

See Also Introduction to NexScript and Python Programming Function Categories

Page 484

Page 487: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.10.2. ClosePowerPointFile

ClosePowerPointFile Function Closes the specified PowerPoint file if the file is open.

Syntax ClosePowerPointFile(filePath)

Parameters

Parameter Type Description

filePath string Full path of the PowerPoint file.

Returns None

Comments In Python, backslash character (\) has a special meaning. When specifying a Windows path like"C:\Data\NexResults.ppt" in Python, use either "C:/Data/NexResults.ppt" or "C:\\Data\\NexResults.ppt".

Usage

NexScript pptFilePath = "C:\Data\NexResults.ppt"SendGraphicsToPowerPoint(doc, pptFilePath, "Slide 1", "Sample slide", 1, 0)ClosePowerPointFile(pptFilePath)

Python import nexpptFilePath = "C:\\Data\\NexResults.ppt"nex.SendGraphicsToPowerPoint(doc, pptFilePath, "Slide 1", "Sample slide", 1, 0)nex.ClosePowerPointFile(pptFilePath)

See Also Introduction to NexScript and Python Programming Function Categories

Page 485

Page 488: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.11. Running Script Functions The following running script functions are available in NexScript and Python

Function Description

RunScript Runs the script with the specified file name.

Sleep Pauses execution of the script.

See Also Introduction to NexScript and Python Programming Function Categories

Page 486

Page 489: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.11.1. RunScript

RunScript Function Runs NexScript saved in a file with the specified name.

Syntax RunScript(scriptName)

Parameters

Parameter Type Description

scriptName string The name of the script. See Comments below fordetails on how to specify script name parameter.

Returns None

Comments

How to specify script names. When the script name is specified as "MyScript", for example: RunScript("MyScript") NeuroExplorer will use the following script file C:\Users\current_user\Documents\NeuroExplorer 5\Scripts\MyScript.nsc (where current_user is your Windows user name). You can also specify the script name relative to the main scripts folder C:\Users\current_user\Documents\NeuroExplorer 5\Scripts\ For example, the script name "Grant\MyScript.nsc" RunScript("Grant\MyScript.nsc") means that the script file C:\Users\current_user\Documents\NeuroExplorer 5\Scripts\Grant\MyScript.nsc will be used Finally, you can specify the absolute path of the script file: RunScript("C:\MyScripts\Script.nsc")   In Python: - You can run another Python script using execfile: execfile('C:\\MyScripts\\Grant\\AnotherScript.py') ) - You can run NexScript script from Python script: nex.RunScript('AnotherScript')

Page 487

Page 490: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

nex.RunScript('\\Grant\\AnotherScript.nsc') nex.RunScript('C:\\MyScripts\\Grant\\AnotherScript.nsc')

Usage

NexScript RunScript("MyOtherScript")

Python # run NexScriptnex.RunScript('C:\\Scripts\\SomeNexScript.nsc') # run Python scriptexecfile('C:\\Scripts\\SomePythonScript.py')

See Also Introduction to NexScript and Python Programming Function Categories

Page 488

Page 491: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.11.2. Sleep

Sleep Function Pauses execution of the script for nms milliseconds.

Syntax Sleep(nms)

Parameters

Parameter Type Description

nms number The number of milliseconds to pause.

Returns None

Comments None

Usage

NexScript % pause for 2 secondsSleep(2000)

Python import nex# pause for 2 secondsnex.Sleep(2000)

See Also Introduction to NexScript and Python Programming Function Categories

Page 489

Page 492: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12. Math Functions The following math functions are available in NexScript and Python

Function Description

seed Initializes random number generator.

expo Generates a random value exponentially distributed with thespecified mean.

floor Returns the largest integer that is less than or equal to thespecified number.

ceil Returns the smallest integer that is greater than or equal to thespecified number.

round Rounds the specified number to the nearest integer.

abs Returns the absolute value of the specified number.

sqrt Returns square root of the specified number.

pow Returns the specified number raised to the specified power.

exp Returns exponential of the specified number.

min Returns minimum of two numbers.

max Returns maximum two number.

log Returns logarithm of the specified number.

sin Returns sine of the specified number.

cos Returns cosine of the specified number.

tan Returns tangent of the specified number.

acos Returns arccosine of the specified number.

asin Returns arcsine of the specified number.

atan Returns arctangent of the specified number.

RoundToTS Rounds the number to the nearest timestamp value.

GetFirstGE Returns the index of the first timestamp in the specified variablethat is greater or equal to the specified number.

GetFirstGT Returns the index of the first timestamp in the specified variablethat is greater than the specified number.

GetBinCount Calculates the number of timestamps in neuron the specified timeinterval.

BitwiseAnd Converts values to unsigned integers and performs bitwise ANDoperation.

BitwiseOr Converts values to unsigned integers and performs bitwise ORoperation.

GetBit Converts the specified number to an unsigned integer and returns

Page 490

Page 493: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

the value of the specified bit (1 to 32).

See Also Introduction to NexScript and Python Programming Function Categories

Page 491

Page 494: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.1. seed

seed Function Initializes random number generator.

Syntax seed(iseed)

Parameters

Parameter Type Description

iseed number Numeric seed value. Should be a positive integer.

Returns None

Comments None

Usage

NexScript seed(1717)

Python import nexnex.seed(1717)

See Also Introduction to NexScript and Python Programming Function Categories

Page 492

Page 495: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.2. expo

expo Function Generates a random value exponentially distributed with the specified mean.

Syntax number expo(fmean)

Parameters

Parameter Type Description

fmean number Mean of the exponential distribution.

Returns None

Comments None

Usage

NexScript y = expo(10)

Python import nexy = nex.expo(10)

See Also Introduction to NexScript and Python Programming Function Categories

Page 493

Page 496: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.3. floor

floor Function Returns the largest integer that is less than or equal to the specified number.

Syntax number floor(x)

Parameters

Parameter Type Description

x number Numeric value.

Returns Returns the largest integer that is less than or equal to x.

Comments None

Usage

NexScript x = 1.7y = floor(x)% y now is equal to 1

Python import mathx = 1.7y = math.floor(x)# y now is equal to 1

See Also Introduction to NexScript and Python Programming Function Categories

Page 494

Page 497: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.4. ceil

ceil Function Returns the smallest integer that is greater than or equal to the specified number.

Syntax number ceil(x)

Parameters

Parameter Type Description

x number Numeric value.

Returns Returns the smallest integer that is greater than or equal to x.

Comments None

Usage

NexScript x = ceil(1.01)% x now is equal to 2

Python import mathx = math.ceil(1.01)# x now is equal to 2

See Also Introduction to NexScript and Python Programming Function Categories

Page 495

Page 498: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.5. round

round Function Rounds the specified number to the nearest integer.

Syntax round(x)

Parameters

Parameter Type Description

x number Numeric value.

Returns Returns the integer that is closest to x

Comments None

Usage

NexScript y = round(1.3)% y now is 1y = round(1.6)% y now is 2

Python y = round(1.3)# y now is 1y = round(1.6)# y now is 2

See Also Introduction to NexScript and Python Programming Function Categories

Page 496

Page 499: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.6. abs

abs Function Returns absolute value of the specified number.

Syntax number abs(x)

Parameters

Parameter Type Description

x number Numeric value.

Returns Returns absolute value of x.

Comments None

Usage

NexScript % this script tests abs functionx = -2ax = abs(x)% ax is equal to 2

Python # this script tests abs functionx = - 2ax = abs(x)# ax is equal to 2

See Also Introduction to NexScript and Python Programming Function Categories

Page 497

Page 500: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.7. sqrt

sqrt Function Returns the square root of the specified number.

Syntax number sqrt(x)

Parameters

Parameter Type Description

x number Numeric value (should be non-negative).

Returns Returns the square root of x.

Comments None

Usage

NexScript y = sqrt(2)

Python import mathy = math.sqrt(2)

See Also Introduction to NexScript and Python Programming Function Categories

Page 498

Page 501: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.8. pow

pow Function Returns x raised to the power of y.

Syntax number pow(x, y)

Parameters

Parameter Type Description

x number Number to be raised to the specified power.

y number The power.

Returns Returns x raised to the power of y.

Comments None

Usage

NexScript z = pow(2, 3)% z now is equal to 8

Python import mathz = math.pow(2, 3)# z now is equal to 8

See Also Introduction to NexScript and Python Programming Function Categories

Page 499

Page 502: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.9. exp

exp Function Returns exponential of x.

Syntax number exp(x)

Parameters

Parameter Type Description

x number Numeric value.

Returns Returns exponential of x.

Comments None

Usage

NexScript y = exp(2.5)

Python import mathy = math.exp(2.5)

See Also Introduction to NexScript and Python Programming Function Categories

Page 500

Page 503: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.10. min

min Function Returns the minimum of two numbers.

Syntax number min(x, y)

Parameters

Parameter Type Description

x number Numeric value.

y number Numeric value.

Returns Returns minimum of x and y.

Comments None

Usage

NexScript x = 4y = 2z = min(x, y)

Python x = 4y = 2z = min(x, y)

See Also Introduction to NexScript and Python Programming Function Categories

Page 501

Page 504: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.11. max

max Function Returns maximum of two numbers.

Syntax max(x, y)

Parameters

Parameter Type Description

x number Numeric value.

y number Numeric value.

Returns Returns maximum of x and y.

Comments None

Usage

NexScript x = 7y = max(x, 5)

Python x = 7y = max(x, 5)

See Also Introduction to NexScript and Python Programming Function Categories

Page 502

Page 505: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.12. log

log Function Returns logarithm of the specified number.

Syntax log(x)

Parameters

Parameter Type Description

x number Numeric value (the value should be positive).

Returns Returns logarithm of x.

Comments None

Usage

NexScript y = log(2.5)

Python import mathy = math.log(2.5)

See Also Introduction to NexScript and Python Programming Function Categories

Page 503

Page 506: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.13. sin

sin Function Returns sine of the specified number.

Syntax sin(x)

Parameters

Parameter Type Description

x number Numeric value (sine parameter in radians).

Returns Returns the sine of x.

Comments None

Usage

NexScript x = 10y = sin(x)

Python import mathx = 10y = math.sin(x)

See Also Introduction to NexScript and Python Programming Function Categories

Page 504

Page 507: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.14. cos

cos Function Returns cosine of the specified number.

Syntax number cos(x)

Parameters

Parameter Type Description

x number Numeric value (cosine parameter in radians).

Returns Returns cosine of x.

Comments None

Usage

NexScript y = cos(0.5)

Python import mathy = math.cos(0.5)

See Also Introduction to NexScript and Python Programming Function Categories

Page 505

Page 508: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.15. tan

tan Function Returns tangent of the specified number.

Syntax tan(x)

Parameters

Parameter Type Description

x number Numeric value (tangent parameter in radians).

Returns Returns tangent of x.

Comments None

Usage

NexScript y = tan(1)

Python import mathy = math.tan(1)

See Also Introduction to NexScript and Python Programming Function Categories

Page 506

Page 509: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.16. acos

acos Function Returns the arccosine (in radians) of the specified number.

Syntax number acos(x)

Parameters

Parameter Type Description

x number Numeric value (the value should be from -1 to +1).

Returns Returns y such that x = cos(y).

Comments None

Usage

NexScript x = 0.5y = acos(x)% y is 1.047197551

Python import mathx = 0.5y = math.acos(x)# y is 1.047197551

See Also Introduction to NexScript and Python Programming Function Categories

Page 507

Page 510: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.17. asin

asin Function Returns the arcsine of the specified number.

Syntax number asin(x)

Parameters

Parameter Type Description

x number Numeric value (the value should be from -1 to +1).

Returns Returns y such that x = sin(y).

Comments None

Usage

NexScript x = 0.5y = asin(x)

Python import mathx = 0.5y = math.asin(x)

See Also Introduction to NexScript and Python Programming Function Categories

Page 508

Page 511: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.18. atan

atan Function Returns the arctangent of the specified number.

Syntax number acos(x)

Parameters

Parameter Type Description

x number Numeric value.

Returns Returns y such that x = tan(y).

Comments None

Usage

NexScript x = 2y = atan(x)

Python import mathx = 2y = math.atan(x)

See Also Introduction to NexScript and Python Programming Function Categories

Page 509

Page 512: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.19. RoundToTS

RoundToTS Function Rounds the specified number to the nearest timestamp value.

Syntax number RoundToTS(doc, time)

Parameters

Parameter Type Description

doc documentReference Reference to the document.

time number The time value (in seconds) to be rounded.

Returns The document timestamp value (in seconds) nearest to the specified time. 

Comments None

Usage

NexScript doc = GetActiveDocument()ts = RoundToTS(doc, 1.234)

Python import nexdoc = nex.GetActiveDocument()ts = nex.RoundToTS(doc, 1.234)

See Also Introduction to NexScript and Python Programming Function Categories

Page 510

Page 513: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.20. GetFirstGE

GetFirstGE Function Returns the index of the first timestamp in the specified variable that is greater than or equal to thespecified number.

Syntax number GetFirstGE(var, time)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

time number Time value in seconds.

Returns Returns the index of the first timestamp in the specified variable that is greater than or equal to thespecified number.

Comments None

Usage

NexScript doc = GetActiveDocument()neuron = GetVarByName(doc, "Neuron04a")% get the index of the first spike at or after 5.7sindex = GetFirstGE(neuron, 5.7)

Python import nexdoc = nex.GetActiveDocument()neuron = nex.GetVarByName(doc, "Neuron04a")# get the index of the first spike at or after 5.7sindex = nex.GetFirstGE(neuron, 5.7)

See Also Introduction to NexScript and Python Programming Function Categories

Page 511

Page 514: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.21. GetFirstGT

GetFirstGT Function Returns the index of the first timestamp in the specified variable that is greater than the specifiednumber.

Syntax number GetFirstGT(var, time)

Parameters

Parameter Type Description

var variableReference Reference to the variable.

time number Time value in seconds.

Returns Returns the index of the first timestamp in the specified variable that is greater than the specifiednumber.

Comments None

Usage

NexScript doc = GetActiveDocument()neuron = GetVarByName(doc, "Neuron04a")% get the index of the first spike after 5.7sindex = GetFirstGT(neuron, 5.7)

Python import nexdoc = nex.GetActiveDocument()neuron = nex.GetVarByName(doc, "Neuron04a")# get the index of the first spike after 5.7sindex = nex.GetFirstGT(neuron, 5.7)

See Also Introduction to NexScript and Python Programming Function Categories

Page 512

Page 515: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.22. GetBinCount

GetBinCount Function Calculates the number of timestamps in the specified time range.

Syntax number GetBinCount(var, timeMin, timeMax)

Parameters

Parameter Type Description

var variableReference Reference to a variable. Should be a reference to aneuron, event, interval or continuous variable.

timeMin number Time range minimum (in seconds).

timeMax number Time range maximum (in seconds).

Returns The number of timestamps of the specified variable in the specified time range.

Comments None

Usage

NexScript doc = GetActiveDocument()neuron = GetVarByName(doc, "Neuron04a")% calculate how many timestamps of Neuron04a are in the interval [5.3s, 10.2s]count = GetBinCount(neuron, 5.3, 10.2)

Python import nexdoc = nex.GetActiveDocument()neuron = nex.GetVarByName(doc, "Neuron04a")# calculate how many timestamps of Neuron04a are in the interval [5.3s, 10.2s]count = nex.GetBinCount(neuron, 5.3, 10.2)

See Also Introduction to NexScript and Python Programming Function Categories

Page 513

Page 516: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.23. BitwiseAnd

BitwiseAnd Function Returns the result of the bitwise AND operation.

Syntax number BitwiseAnd(value1, value2)

Parameters

Parameter Type Description

value1 number Numeric value.

value2 number Numeric value.

Returns Result of the bitwise AND operation. 

Comments value1 and value2 are converted to integers and then bitwise AND operation is applied to these integers. When using Python scripting, use Python bitwise operations (|, & , >>, <<). See

https://wiki.python.org/moin/BitwiseOperators for details.

Usage

NexScript x = BitwiseAnd(7, 1)% x now is equal to 1

Python x = 7 & 1# x now is equal to 1

See Also Introduction to NexScript and Python Programming Function Categories

Page 514

Page 517: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.24. BitwiseOr

BitwiseOr Function Returns the result of the bitwise OR operation.

Syntax number BitwiseOr(value1, value2)

Parameters

Parameter Type Description

value1 number Numeric value.

value2 number Numeric value.

Returns Result of the bitwise OR operation.

Comments value1 and value2 are converted to integers and then the bitwise OR operation is applied to theseintegers. When using Python scripting, use Python bitwise operations (|, & , >>, <<). See

https://wiki.python.org/moin/BitwiseOperators for details.

Usage

NexScript x = BitwiseOr(2, 1)% x now is equal to 3

Python x = 2 | 3# x now is equal to 3

See Also Introduction to NexScript and Python Programming Function Categories

Page 515

Page 518: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.12.25. GetBit

GetBit Function Returns the value of the specified bit (1 to 32).

Syntax number GetBit(x, bitNumber)

Parameters

Parameter Type Description

x number Numeric value.

bitNumber number 1-based bin number. 1 is the least significant bit, 32 isthe most significant bit.

Returns Returns the value (0 or 1) of the specified bit.

Comments The first parameter is converted to an unsigned 32-bit integer and then the bit value of this unsignedinteger is returned.

Usage

NexScript % get the second bit of 3b2 = GetBit(3, 2)% b2 is now equal to 1

Python import nex# get the second bit of 3b2 = nex.GetBit(3, 2)# b2 is now equal to 1

See Also Introduction to NexScript and Python Programming Function Categories

Page 516

Page 519: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13. String Functions The following string functions are available in NexScript and Python

Function Description

Left Extracts substring from the left part of the string, returns string.

Mid Extracts substring from the middle of the string.

Right Extracts substring from the right part of the string.

Find Looks for a substring inside the specified string.

StrLength Calculates the number of characters in the string, returns number.

NumToStr Converts a number to string using optional format, returns string.

StrToNum Converts string to number.

GetNumFields Returns the number of fields in the string. The field is a substringthat does not contain spaces, tabs or commas.

GetField Returns the field with the specified field index.

CharToNum Converts a one-character string to a number (a character's ASCIIcode).

NumToChar Converts a number to a one-character string containing thecharacter with the ASCII code equal to the number.

See Also Introduction to NexScript and Python Programming Function Categories

Page 517

Page 520: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13.1. Left

Left Function Returns a substring that starts at the beginning of the string.

Syntax string Left(string, nchar)

Parameters

Parameter Type Description

string string String parameter.

nchar number Number of characters in the substring.

Returns Returns a substring that starts at the beginning of the string.

Comments In Python, use string slicing: http://pythoncentral.io/cutting-and-slicing-strings-in-python/

Usage

NexScript sub = Left("abcdefg", 3)% sub now is "abc"

Python s = 'abcdefg'sub = s[:3]# sub now is "abc"

See Also Introduction to NexScript and Python Programming Function Categories

Page 518

Page 521: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13.2. Mid

Mid Function Returns the specified substring.

Syntax string Mid(string, nstartchar, nchar)

Parameters

Parameter Type Description

string string String parameter.

nstartchar number 1-based index of the start character.

nchar number Number of characters to select.

Returns Returns the substring that starts at character nstartchar and contains nchar characters.

Comments In Python, use string slicing: http://pythoncentral.io/cutting-and-slicing-strings-in-python/

Usage

NexScript sub = Mid("abcdefg", 2, 3)% sub now is "cde"

Python s = 'abcdefg'sub = s[2:2+3]# sub now is "cde"

See Also Introduction to NexScript and Python Programming Function Categories

Page 519

Page 522: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13.3. Right

Right Function Returns a substring that ends at the end of the string.

Syntax string Right(string, nchar)

Parameters

Parameter Type Description

string string String parameter.

nchar number Number of characters in the substring.

Returns Extracts right nchar characters from string, returns string.

Comments In Python, use string slicing: http://pythoncentral.io/cutting-and-slicing-strings-in-python/

Usage

NexScript sub = Right("abcdefg", 3)% sub now is "efg"

Python s = 'abcdefg'sub = s[-3:]# sub now is "efg"

See Also Introduction to NexScript and Python Programming Function Categories

Page 520

Page 523: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13.4. Find

Find Function Looks for a substring inside a specified string.

Syntax number Find(string1, string2)

Parameters

Parameter Type Description

string1 string The string where we look for a substring.

string2 string The substring that we are trying to find.

Returns Looks for a string string2 inside the string string1, returns a number - 1-based position of the firstcharacter of string2 in the string1. Returns zero is string2 is not found.

Comments In Python, use find() method of a string object: http://www.tutorialspoint.com/python/string_find.htm.  

Usage

NexScript % this script selects only the neurons that have "05" in their namedoc = GetActiveDocument()DeselectAll(doc)for i=1 to GetVarCount(doc, "neuron") name = GetVarName(doc, i, "neuron") if Find(name, "05")> 0 SelectVar(doc, i, "neuron") endend

Python import nex# this script selects only the neurons that have "05" in their namedoc = nex.GetActiveDocument()nex.DeselectAll(doc)for i in range( 1, nex.GetVarCount(doc, "neuron") + 1): name = nex.GetVarName(doc, i, "neuron") if name.find("05") >= 0: nex.SelectVar(doc, i, "neuron")

See Also Introduction to NexScript and Python Programming

Page 521

Page 524: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Function Categories

Page 522

Page 525: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13.5. StrLength

StrLength Function Calculates the number of characters in the string.

Syntax number StrLength(stringVal)

Parameters

Parameter Type Description

stringVal string The string parameter.

Returns Returns the number of characters in the string.

Comments None

Usage

NexScript n = StrLength("abcd")

Python import nexn = nex.StrLength("abcd")

See Also Introduction to NexScript and Python Programming Function Categories

Page 523

Page 526: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13.6. NumToStr

NumToStr Function Converts number to string using optional format string.

Syntax string NumToStr(number, formatString)

Parameters

Parameter Type Description

number number Number to be converted to string.

formatString string Optional format string (a standard C/C++ formatspecifier). See, for example,

http://www.cplusplus.com/reference/clibrary/cstdio/prin

tf/

Returns Returns string representing the specified number.

Comments None

Usage

NexScript For example, to generate strings: Event001, Event002, ..., Event016 use the following loop for i=1 to 16 str = "Event0" + NumToStr(i, "%02.0f")end

Python import nexfor i in range( int(1), int(16) + 1): str = "Event0" + nex.NumToStr(i, "%02.0f")

See Also Introduction to NexScript and Python Programming Function Categories

Page 524

Page 527: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13.7. StrToNum

StrToNum Function Converts string to number.

Syntax number StrToNum(stringRepresentingNumber)

Parameters

Parameter Type Description

stringRepresentingNumber

string A string containing a valid representation of thenumber, for example, "1", "002", "123.456".

Returns Returns the number corresponding to the specified string.

Comments None

Usage

NexScript x = StrToNum("003")% x now is equal to 3

Python import nexx = nex.StrToNum("003")# x now is equal to 3

See Also Introduction to NexScript and Python Programming Function Categories

Page 525

Page 528: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13.8. GetNumFields

GetNumFields Function Returns the number of fields in the string. The field is a substring that does not contain spaces, tabs orcommas.

Syntax GetNumFields(stringWithFields)

Parameters

Parameter Type Description

stringWithFields string The string containing fields. The field is a substringthat does not contain spaces, tabs or commas.

Returns Returns the number of fields in the string. The field is a substring that does not contain spaces, tabs orcommas.

Comments In Python, use split() method of string object: http://www.tutorialspoint.com/python/string_split.htm.

Usage

NexScript numFields = GetNumFields("One two 3 4")% numFields is now equal to 4

Python import nexnumFields = nex.GetNumFields("One two 3 4")# numFields is now equal to 4

See Also Introduction to NexScript and Python Programming Function Categories

Page 526

Page 529: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13.9. GetField

GetField Function Returns the string field.

Syntax string GetField(stringWithFields, fieldnumber)

Parameters

Parameter Type Description

stringWithFields string The string containing multiple data fields. The field is asubstring that does not contain spaces, tabs orcommas.

fieldnumber number The field number.

Returns Returns the field with the specified number as a string. The field is a substring that does not containspaces, tabs or commas. For example, GetField("One two 3 4", 3) returns "3".

Comments In Python, use split() method of string object: http://www.tutorialspoint.com/python/string_split.htm.  

Usage

NexScript secondField = GetField("Neuro04a Neuron05b", 2)% secondField now is equal to "Neuron05b"

Python import nexsecondField = nex.GetField("Neuro04a Neuron05b", 2)# secondField now is equal to "Neuron05b"

See Also Introduction to NexScript and Python Programming Function Categories

Page 527

Page 530: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13.10. CharToNum

CharToNum Function Converts a one-character string to a number (a character's ASCII code).

Syntax number CharToNum(oneCharString)

Parameters

Parameter Type Description

oneCharString string A string of length 1 (for example, "a", "5").

Returns The string character's ASCII code.

Comments In Python script, use python function ord().

Usage

NexScript x = CharToNum("1")% x now is equal to 49

Python x = ord("1")# x now is equal to 49

See Also Introduction to NexScript and Python Programming Function Categories

Page 528

Page 531: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.13.11. NumToChar

NumToChar Function Converts a number to a one-character string containing a character with the ASCII code equal to thenumber.

Syntax string NumToChar(number)

Parameters

Parameter Type Description

number number ASCII code of the character.

Returns Returns a one-character string containing the character with the ASCII code equal to the specifiednumber.

Comments None

Usage

NexScript oneAsString = NumToChar(49)% oneAsString now is equal to "1"

Python import nexoneAsString = nex.NumToChar(49)# oneAsString now is equal to "1"

See Also Introduction to NexScript and Python Programming Function Categories

Page 529

Page 532: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.14. Debug Functions The following debug functions are available in NexScript and Python

Function Description

Trace Prints arguments to output window.

MsgBox Displays a message box.

See Also Introduction to NexScript and Python Programming Function Categories

Page 530

Page 533: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.14.1. Trace

Trace Function Prints arguments to the output window.

Syntax Trace(arg1, arg2, ...)

Parameters

Parameter Type Description

arg1 any type String, number or any other valid NexScript value.

arg2 any type String, number or any other valid NexScript value.

Returns None

Comments Converts each parameter to string and the prints the result to the output window. In Python, use printfunction instead.

Usage

NexScript x = 30% print the value of xTrace("x=", x)

Python x = 30# print the value of xprint("x={}".format(x))

See Also Introduction to NexScript and Python Programming Function Categories

Page 531

Page 534: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

6.5.14.2. MsgBox

MsgBox Function This function is equivalent to Trace function.  

See Also Introduction to NexScript and Python Programming Function Categories

Page 532

Page 535: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7. COM/ActiveX Interfaces NeuroExplorer exposes COM (Component Object Model, or ActiveX) interfaces that allow otherapplications to launch and control NeuroExplorer. For example, the following Matlab code starts NeuroExplorer, opens a data file and loads Neuron04atimestamps into the Matlab workspace: nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');neuron = doc.Variable('Neuron04a');timestamps = neuron.Timestamps(); The table below lists the objects that NeuroExplorer exposes via COM methods and properties.

Interface Description

Application NeuroExplorer application interface. Provides methods andproperties for the main application (for example, opendocument).

Document Document interface. Provides methods and properties of thedocument (for example, lists variables in the document).

Variable Variable interface. Provides methods and properties of avariable inside a document (for example, gets variabletimestamps).

Page 533

Page 536: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.1. Application

Application Interface External applications can open an instance of NeuroExplorer using its Program ID"NeuroExplorer.Application". For example, to open NeuroExplorer (or to connect to a running instance of NeuroExplorer) in Matlab ,you can use the following command: nex = actxserver('NeuroExplorer.Application'); The object returned by the actxserver command is an Application object. The properties and methods ofthis object are listed below.

Properties

Property Description

ActiveDocument Read-only access to the active document

DocumentCount The number of open documents

Version NeuroExplorer version

Visible Controls visibility of the application

Methods

Method Description

OpenDocument Opens a specified document (data file)

Document Returns one of the open documents 

Sleep Pauses the program

RunNexScript Runs NexScript saved in a file

RunNexScriptCommands Runs the specified NexScript text

See Also COM/ActiveX Interfaces

Page 534

Page 537: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.1.1. ActiveDocument Property

Application.ActiveDocument Property Read-only property that returns a Document object that represents the active document (the document

corresponding to the active window of the application). Returns null if there are no open documents.

Syntax Document ActiveDocument

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.ActiveDocument;

See Also Application Interface Document Interface COM/ActiveX Interfaces

Page 535

Page 538: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.1.2. DocumentCount Property

Application.DocumentCount Property Read-only property that returns the number of open documents (data files).

Syntax int DocumentCount

Usage

Matlab nex = actxserver('NeuroExplorer.Application');numDocs = nex.DocumentCount;

See Also Application Interface COM/ActiveX Interfaces

Page 536

Page 539: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.1.3. Version Property

Application.Version Property Read-only property that returns a string with the current version of NeuroExplorer.

Syntax string Version

Usage

Matlab nex = actxserver('NeuroExplorer.Application');version = nex.Version;

See Also Application Interface COM/ActiveX Interfaces

Page 537

Page 540: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.1.4. Visible Property

Application.Visible Property Boolean read/write property that controls the visibility of NeuroExplorer.

Syntax Boolean Visible

Usage

Matlab nex = actxserver('NeuroExplorer.Application');isVisible = nex.Visible;% make sure that NeuroExplorer is visiblenex.Visible = true;

See Also Application Interface COM/ActiveX Interfaces

Page 538

Page 541: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.1.5. OpenDocument Method

Application.OpenDocument Method Opens the specified data file. Returns Document object if succeeded.

Syntax Document OpenDocument ( string documentPath )

Parameters

Parameter Type Description

documentPath string Full data file path

Returns Returns Document object.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');

See Also Application Interface Document Interface COM/ActiveX Interfaces

Page 539

Page 542: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.1.6. Document Medhod

Application.Document Method Returns Document object for the specified document index.

Syntax Document Document(int documentIndex)

Parameters

Parameter Type Description

documentIndex int  1-based document index 

Returns Returns Document object.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');% get the first open documentdoc = nex.Document(1);

See Also Application Interface Document Interface COM/ActiveX Interfaces

Page 540

Page 543: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.1.7. Sleep Method

Application.Sleep Method Pauses the application.

Syntax void Sleep ( int millisecondsToSleep )

Parameters

Parameter Type Description

millisecondsToSleep int Number of milliseconds to sleep

Returns None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');% pause NeuroExplorer for 1 secondnex.Sleep(1000);

See Also Application Interface COM/ActiveX Interfaces

Page 541

Page 544: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.1.8. RunNexScript Method

Application.RunNexScript Method Runs the specified NexScript. Returns true if succeeded.

Syntax bool RunNexScript ( string scriptPath )

Parameters

Parameter Type Description

scriptPath string Script path.

Returns Returns true if script succeeded, otherwise, returns false.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');res = nex.RunNexScript('C:\Data\Scripts\TestScript.nsc');

See Also Application Interface Document Interface COM/ActiveX Interfaces

Page 542

Page 545: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.1.9. RunNexScriptCommands Method

Application.RunNexScriptCommands Method Runs the specified NexScript text. Returns true if succeeded.

Syntax bool RunNexScriptCommands ( string script )

Parameters

Parameter Type Description

script string Script text. Script lines should be separated by \n.

Returns Returns true if script succeeded, otherwise, returns false.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');res = nex.RunNexScriptCommands('doc=GetActiveDocument()\ndoc.NewEvent =Sync(doc["Neuron04a"], doc["Neuron05b"], -0.01, 0.01)')res =nex.RunNexScriptCommands('doc=GetActiveDocument()\nApplyTemplate(doc,"AutoCorrelograms")');

See Also Application Interface Document Interface COM/ActiveX Interfaces

Page 543

Page 546: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2. Document

Document Interface NeuroExplorer Application object provides access to the open documents. For example, to open adocument in NeuroExplorer in Matlab script, you can use: nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex'); Here OpenDocument method returns a Document object corresponding to the specified data file. The properties and methods of the Document object are listed below.

Properties

Property Description

Path Document file path

FileName Document file name

Comment Document comment

TimestampFrequency Document timestamp frequency

StartTime Document data start time

EndTime Document data end time

VariableCount The number of variables in the document

NeuronCount The number of neuron variables in the document

EventCount The number of event variables in the document

IntervalCount The number of interval variables in the document

MarkerCount The number of marker variables in the document

WaveCount The number of waveform variables in the document

ContinuousCount The number of continuous variables in the document

Methods

Method Description

Variable Returns the specified variable

Neuron Returns the specified neuron variable

Event Returns the specified event variable

Marker Returns the specified marker variable

Interval Returns the specified interval variable

Wave Returns the specified waveform variable

Continuous Returns the specified continuous variable

Page 544

Page 547: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

DeselectAll Deselects all the data variables in the document

SelectAllNeurons Selects all the neuron variables in the document

SelectAllContinuous Selects all the continuous variables in the document

ApplyTemplate Runs the analysis specified in the analysis template

GetNumericalResults Returns numerical results for the first graph view of the document

Close Closes the document

See Also COM/ActiveX Interfaces

Page 545

Page 548: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.1. Path Property

Document.Path Property Read-only property that returns a string with the full path of the document.

Syntax string Path

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');path = doc.Path;

See Also Document Interface COM/ActiveX Interfaces

Page 546

Page 549: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.2. FileName Property

Document.FileName Property Read-only property that returns a string with the file name.

Syntax string FileName

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');path = doc.Path;fileName = doc.FileName;% path is 'C:\Data\MyDataFile.nex'% fileName is 'MyDataFile.nex'

See Also Document Interface COM/ActiveX Interfaces

Page 547

Page 550: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.3. Comment Property

Document.Comment Property Read-only property that returns a string with the data file comment.

Syntax string Comment

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');comment = doc.Comment;

See Also Document Interface COM/ActiveX Interfaces

Page 548

Page 551: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.4. TimestampFrequency Property

Document.TimestampFrequency Property Read-only property that returns the timestamp frequency of the document in Hertz.

Syntax double TimestampFrequency

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');tsFrequency = doc.TimestampFrequency;

See Also Document Interface COM/ActiveX Interfaces

Page 549

Page 552: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.5. StartTime Property

Document.StartTime Property Read-write property that specifies the document data start time (minimum timestamp) in seconds.

Syntax double StartTime

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');startTime = doc.StartTime;

See Also Document Interface COM/ActiveX Interfaces

Page 550

Page 553: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.6. EndTime Property

Document.EndTime Property Read-write property that specifies the document data end time (maximum timestamp) in seconds.

Syntax double EndTime

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');endTime = doc.EndTime;

See Also Document Interface COM/ActiveX Interfaces

Page 551

Page 554: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.7. VariableCount Property

Document.VariableCount Property Read-only property that returns the number of variables in the document.

Syntax int VariableCount

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');numVars = doc.VariableCount;

See Also Document Interface COM/ActiveX Interfaces

Page 552

Page 555: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.8. NeuronCount Property

Document.NeuronCount Property Read-only property that returns the number of neurons in the document.

Syntax int NeuronCount

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');numNeurons = doc.NeuronCount;

See Also Document Interface COM/ActiveX Interfaces

Page 553

Page 556: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.9. EventCount Property

Document.EventCount Property Read-only property that returns the number of event variables in the document.

Syntax int EventCount

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');numEventVars = doc.EventCount;

See Also Document Interface COM/ActiveX Interfaces

Page 554

Page 557: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.10. IntervalCount Property

Document.IntervalCount Property Read-only property that returns the number of interval variables in the document.

Syntax int IntervalCount

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');numIntervalVars = doc.IntervalCount;

See Also Document Interface COM/ActiveX Interfaces

Page 555

Page 558: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.11. MarkerCount Property

Document.MarkerCount Property Read-only property that returns the number of marker variables in the document.

Syntax int MarkerCount

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');numMarkerVars = doc.MarkerCount;

See Also Document Interface COM/ActiveX Interfaces

Page 556

Page 559: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.12. WaveCount Property

Document.WaveCount Property Read-only property that returns the number of waveform variables in the document.

Syntax int WaveCount

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');numWaveVars = doc.WaveCount;

See Also Document Interface COM/ActiveX Interfaces

Page 557

Page 560: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.13. ContinuousCount Property

Document.ContinuousCount Property Read-only property that returns the number of continuous variables in the document.

Syntax int ContinuousCount

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');numContinuousVars = doc.ContinuousCount;

See Also Document Interface COM/ActiveX Interfaces

Page 558

Page 561: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.14. Variable Method

Document.Variable Method Returns Variable object for the specified variable index or name.

Syntax Variable Variable(object variableIndexOrName)

Parameters

Parameter Type Description

variableIndexOrName int or string 1-based variable index or a string with the variablename 

Returns Returns Variable object.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first variablevar1 = doc.Variable(1);% get the variable with the name Neuron04aneuron = doc.Variable('Neuron04a');

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 559

Page 562: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.15. Neuron Method

Document.Neuron Method Returns Variable object for the specified neuron variable index.

Syntax Variable Neuron(int neuronIndex)

Parameters

Parameter Type Description

neuronIndex int 1-based neuron variable index 

Returns Returns Variable object.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first neuron variableneuron1 = doc.Neuron(1);% get the last neuron variableneuronLast = doc.Neuron(doc.NeuronCount);

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 560

Page 563: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.16. Event Method

Document.Event Method Returns Variable object for the specified event variable index.

Syntax Variable Event(int eventIndex)

Parameters

Parameter Type Description

eventIndex int 1-based event variable index 

Returns Returns Variable object.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first event variableEvent1 = doc.Event(1);% get the last event variableEventLast = doc.Event(doc.EventCount);

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 561

Page 564: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.17. Interval Method

Document.Interval Method Returns Variable object for the specified interval variable index.

Syntax Variable Interval(int IntervalIndex)

Parameters

Parameter Type Description

IntervalIndex int 1-based interval variable index 

Returns Returns Variable object.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first interval variableInterval1 = doc.Interval(1);% get the last interval variableIntervalLast = doc.Interval(doc.IntervalCount);

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 562

Page 565: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.18. Marker Method

Document.Marker Method Returns Variable object for the specified marker variable index.

Syntax Variable Marker(int markerIndex)

Parameters

Parameter Type Description

markerIndex int 1-based marker variable index 

Returns Returns Variable object.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first marker variableMarker1 = doc.Marker(1);% get the last marker variableMarkerLast = doc.Marker(doc.MarkerCount);

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 563

Page 566: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.19. Wave Method

Document.Wave Method Returns Variable object for the specified waveform variable index.

Syntax Variable Wave(int waveIndex)

Parameters

Parameter Type Description

waveIndex int 1-based waveform variable index 

Returns Returns Variable object.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first waveform variableWave1 = doc.Wave(1);% get the last waveform variableWaveLast = doc.Wave(doc.WaveCount);

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 564

Page 567: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.20. Continuous Method

Document.Continuous Method Returns Variable object for the specified continuous variable index.

Syntax Variable Continuous(int continuousIndex)

Parameters

Parameter Type Description

continuousIndex int 1-based continuous variable index 

Returns Returns Variable object.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first continuous variableContinuous1 = doc.Continuous(1);% get the last continuous variableContinuousLast = doc.Continuous(doc.ContinuousCount);

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 565

Page 568: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.21. DeselectAll Method

Document.DeselectAll Method Deselects all the data variables in the document.

Syntax void DeselectAll()

Returns None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% deselect all variablesdoc.DeselectAll();% select one variabledoc.Variable('Neuron01').Select();% run Interspike Interval Histogram analysis saved in 'ISI' templatedoc.ApplyTemplate('ISI');% get numerical resultsresults = doc.GetNumericalResults();

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 566

Page 569: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.22. SelectAllNeurons Method

Document.SelectAllNeurons Method Selects all the neuron variables in the document. Selected variables are used in analysis whenApplyTemplate document method is called.

Syntax void SelectAllNeurons()

Returns None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% deselect all variablesdoc.DeselectAll();% select all neuronsdoc.SelectAllNeurons();% run Interspike Interval Histogram analysis saved in 'ISI' templatedoc.ApplyTemplate('ISI');% get numerical resultsresults = doc.GetNumericalResults();% close NeuroExplorernex.delete;

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 567

Page 570: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.23. SelectAllContinuous Method

Document.SelectAllContinuous Method Selects all the continuous variables in the document.

Syntax void SelectAllContinuous()

Returns None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% deselect all variablesdoc.DeselectAll();% select all continuous variablesdoc.SelectAllContinuous();% run Perievent Histogram analysis saved in 'PSTH' templatedoc.ApplyTemplate('PSTH');% get numerical resultsresults = doc.GetNumericalResults();

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 568

Page 571: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.24. ApplyTemplate Method

Document.ApplyTemplate Method Runs the analysis specified in the analysis template.

Syntax void ApplyTemplate(string templateName)

Parameters

Parameter Type Description

templateName string template name

Returns None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% deselect all variablesdoc.DeselectAll();% select all neuronsdoc.SelectAllNeurons();% run Interspike Interval Histogram analysis saved in 'ISI' templatedoc.ApplyTemplate('ISI');% get numerical resultsresults = doc.GetNumericalResults();% close NeuroExplorernex.delete;

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 569

Page 572: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.25. GetNumericalResults Method

Document.GetNumericalResults Method Returns 2-dimensional array of numerical results for the first graph view of the document.

Syntax Array GetNumericalResults()

Returns Returns 2-dimensional array of numerical results.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% apply AutoCorrelograms analysis templatenex.RunNexScriptCommands('doc=GetActiveDocument()\nApplyTemplate(doc,"AutoCorrelograms")');% get numerical resultsresults = doc.GetNumericalResults();

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 570

Page 573: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.2.26. Close Method

Document.Close Method Closes the document.

Syntax void Close()

Parameters None.

Returns None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% close the documentdoc.Close();

See Also Variable Interface Application Interface Document Interface COM/ActiveX Interfaces

Page 571

Page 574: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3. Variable

Variable Interface NeuroExplorer Application object provides access to the open files and variables contained in the files.For example, to open a document in NeuroExplorer and get the first event variable in the document inMatlab, you can use: nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');event1 = doc.Event(1); Here Event() method returns a Variable object corresponding to the first event variable in the file. The properties and methods of the Variable object are listed below.

Properties

Property Description

Name Variable name

TimestampCount Number of timestamps in the variable

Methods

Method Description

Timestamps Returns all the variable timestamps in an array

IntervalStarts For interval variables, returns all the interval start values

IntervalEnds For interval variables, returns all the interval end values

FragmentTimestamps For continuous variables, returns fragment timestamps

FragmentCounts For continuous variables, returns the number of data points in eachfragment

ContinuousValues For continuous variables, returns A/D values in milliVolts

MarkerValues For marker variables, returns marker string values

WaveformValues For waveform variables, returns waveform values

SamplingRate For continuous and waveform variables, returns sampling rate inHz

Select Selects the variable for analysis

Deselect Deselects the variable

See Also Document Interface COM/ActiveX Interfaces

Page 572

Page 575: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.1. Name Property

Variable.Name Property Read-only property that returns a string with the variable name.

Syntax string Name

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first neuron variableneuron1 = doc.Neuron(1);neuron1Name = neuron1.Name;

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 573

Page 576: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.2. TimestampCount Property

Variable.TimestampCount Property Read-only property that returns the number of timestamps in the variable. For interval variables, returnsthe number of intervals. For waveforms variable, returns the number of waveforms. For continuousvariables, returns the total number of data points.

Syntax int TimestampCount

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first neuron variableneuron1 = doc.Neuron(1);numTimestamps = neuron1.TimestampCount;

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 574

Page 577: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.3. Timestamps Method

Variable.Timestamps Method Returns all the timestamps of the variable in seconds. Timestamps are returned as an array (vector) ofdouble values. For interval variables, returns the interval starts. For waveforms variable, returns thewaveform timestamps. For continuous variables, returns the timestamps corresponding to all the variabledata points. 

Syntax SAFEARRAY(double) Timestamps()

Parameters None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first neuron variableneuron1 = doc.Neuron(1);% get all the timestampsts = neuron1.Timestamps();% now ts is a vector of timestamps%% get the first continuous variablecont1 = doc.Continuous(1);% get all the timestamps for continuous variablecont1_ts = cont1.Timestamps();

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 575

Page 578: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.4. IntervalStarts Method

Variable.IntervalStarts Method For an interval variable, returns the interval start values in seconds. This method is valid only for intervalvariables.

Syntax SAFEARRAY(double) IntervalStarts()

Parameters None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first interval variableint1= doc.Interval(1);% get all the interval startsint1Starts = int1.IntervalStarts();

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 576

Page 579: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.5. IntervalEnds Method

Variable.IntervalEnds Method For an interval variable, returns the interval end values in seconds. This method is valid only for intervalvariables.

Syntax SAFEARRAY(double) IntervalEnds()

Parameters None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first interval variableint1= doc.Interval(1);% get all the interval endsint1Ends = int1.IntervalEnds();

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 577

Page 580: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.6. FragmentTimestamps Method

Variable.FragmentTimestamps Method For continuous variable, returns the fragment timestamp values in seconds. This method is valid only forcontinuous variables. In general, a continuous variable may contain several fragments of data. Each fragment may be of adifferent length. NeuroExplorer does not store the timestamps for all the A/D values since they would usetoo much space. Instead, for each fragment, it stores the timestamp of the first A/D value in the fragmentand the index of the first data point in the fragment. The timestamps of the first A/D value in eachfragment are returned by this method.

Syntax SAFEARRAY(double) FragmentTimestamps()

Parameters None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first continuous variablecont1= doc.Continuous(1);% get all the fragment timestampscont1FragmentTs = cont1.FragmentTimestamps();

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 578

Page 581: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.7. FragmentCounts Method

Variable.FragmentCounts Method For continuous variable, returns the number of data points in fragments. This method is valid only forcontinuous variables. In general, a continuous variable may contain several fragments of data. Each fragment may be of adifferent length. NeuroExplorer does not store the timestamps for all the A/D values since they would usetoo much space. Instead, for each fragment, it stores the timestamp of the first A/D value in the fragmentand the index of the first data point in the fragment. The number of data points in each fragment arereturned by this method.

Syntax SAFEARRAY(double) FragmentCounts()

Parameters None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first continuous variablecont1= doc.Continuous(1);% get all the fragment countscont1FragmentCounts = cont1.FragmentCounts();

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 579

Page 582: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.8. ContinuousValues Method

Variable.ContinuousValues Method For continuous variable, returns all the A/D values in milliVolts. This method is valid only for continuousvariables.

Syntax SAFEARRAY(double) ContinuousValues()

Parameters None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first continuous variablecont1= doc.Continuous(1);% get all the valuescont1Values = cont1.ContinuousValues();

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 580

Page 583: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.9. MarkerValues Method

Variable.MarkerValues Method For a marker variable, returns all the marker values as strings. The values are returned in a two-dimensional array. Each row of the array represents all the marker strings for one timestamp. This method is valid only for marker variables.

Syntax SAFEARRAY(string) MarkerValues()

Parameters None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first markervariablemarker1 = doc.Marker(1);% get all the marker valuesmarker1Values = marker1.MarkerValues();

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 581

Page 584: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.10. WaveformValues Method

Variable.WaveformValues Method For waveform variable, returns all the waveform values in milliVolts. The values are returned in a two-dimensional array. Each row of the array represents one waveform. This method is valid only for waveform variables.

Syntax SAFEARRAY(double) WaveformValues()

Parameters None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first waveform variablewave1= doc.Wave(1);% get all the valueswave1Values = wave1.WaveformValues();

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 582

Page 585: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.11. SamplingRate Property

Variable.SamplingRate Property Read-only property that returns the sampling rate (in Hz) of a continuous or waveform variable. For othervariable types, returns zero.

Syntax double SamplingRate

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% get the first continuous variablecont1= doc.Continuous(1);% get sampling ratesamplingRate = cont1.SamplingRate;

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 583

Page 586: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.12. Select Method

Variable.Select Method Selects the variable. Selected variables are used in analysis when ApplyTemplate document method iscalled.

Syntax void Select()

Parameters None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% deselect all variablesdoc.DeselectAll();% select variable with the name 'Neuron01'doc.Variable('Neuron01').Select();% run Interspike Interval Histogram analysis saved in 'ISI' templatedoc.ApplyTemplate('ISI');% get numerical resultsresults = doc.GetNumericalResults();% close NeuroExplorernex.delete;

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 584

Page 587: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

7.3.13. Deselect Method

Variable.Deselect Method Deselects the variable. Only selected variables are used in analysis when ApplyTemplate documentmethod is called.

Syntax void Deselect()

Parameters None.

Usage

Matlab nex = actxserver('NeuroExplorer.Application');doc = nex.OpenDocument('C:\Data\MyDataFile.nex');% deselect all variablesdoc.DeselectAll();% select all neuronsdoc.SelectAllNeurons();% deselect variable with the name 'Neuron01'doc.Variable('Neuron01').Deselect();% run Interspike Interval Histogram analysis saved in 'ISI' templatedoc.ApplyTemplate('ISI');% get numerical resultsresults = doc.GetNumericalResults();% close NeuroExplorernex.delete;

See Also Variable Interface Document Interface COM/ActiveX Interfaces

Page 585

Page 588: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

Index 11D Data Viewer 33

33D Graphics 217, 219

AActivity Animation 222Adjusting Analysis Properties 39Alpha Omega Engineering 26Analysis Templates 41Analyzing Data 34Application 534Autocorrelograms 98, 165Autocorrelograms Versus Time 165

BBurst Analysis 132

CCED Spike-2 26Coherence Analysis 153COM/ActiveX Interfaces 533Confidence Limits 90Continuously Recorded Data 84Correlations with ContinuousVariable 140Crosscorrelograms 106, 112Cumulative Activity Graphs 120Cumulative Sum Graphs 92

DData Acquisition Systems 26Data Selection 85Data Types 73Document 247, 248, 249, 250, 251,252, 264, 308, 535, 536, 539, 540,544

EEpoch Counts 151

Events 76, 369Excel 51, 89, 417, 423, 480, 481,482Expressions 232

FFile Variables 228Flow Control 233Functions 235, 236, 264, 308, 358,372, 403, 430, 473, 480, 483, 486,490, 517, 530

GGraphics 44, 207, 208, 209, 211,217, 219, 377, 388, 389, 484Graphics Modes 209

HHow to Select Variables 36, 38

IImporting Data 25, 28, 30, 31Importing Files 26Instant Frequency 121Intan Technologies 26Interspike Interval Histograms 95Interspike Intervals vs. Time 122

JJoint ISI Distribution 163Joint PSTH 118

LLines 215

MMarkers 79, 353Matlab 31, 49, 88, 473, 474, 475,476, 477, 478, 479Multichannel Systems 26

NNeuralynx 26NexScript 223, 542, 543Numerical Results 42, 403

OOpening Files 25

PPerievent Histograms 90, 101Perievent Rasters 115, 167Perievent Spectrograms 160Place Cell Analysis 144Plexon 26Poincare Maps 123Population Vectors 81Post-Processing 86PowerPoint 45, 388, 483, 484, 485Power Spectral Densities 128Principal Component Analysis 136Programming with Python andNexScript 223PSTH Versus Time 138

RRasters 114, 115, 167Rate Histograms 93Rectangles 216Regularity Analysis 142Reverse Correlation 148

SSaving Graphics 44Saving Results 45Screen Elements 13, 59Script Variables 227Selecting Variables 35Sentinel Keys 11Shift-Predictor 112Spectrogram 157, 160Spike Trains 74Synchrony vs. Time 124

Page 586

Page 589: NeuroExplorer Manual · 5. Working with 3D Graphics 217 5.1. Viewing Multiple Histograms in 3D 218 5.2. 3D Graphics Parameters 219 5.3. Viewing the Neuronal Activity "Movie" 220

TText Files 28Text Labels 213Trial Bin Counts 126Tucker-Davis Technologies 26

VVariable 35, 36, 38, 140, 227, 228,308, 330, 358, 393, 430, 464, 552,559, 572Viewing Multiple Histograms 218Viewing the Neuronal Activity 220

WWaveforms 82

Page 587