Difference between revisions of "Control of BESA Research by external programs"

From BESA® Wiki
Jump to: navigation, search
(Examples)
 
(2 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
|version = 5.2.2 or higher
 
|version = 5.2.2 or higher
 
}}
 
}}
 
=Control of BESA Research by external programs=
 
  
 
==Purpose and Procedure==
 
==Purpose and Procedure==
 +
 
This document describes how to start BESA Research from an external program (a patient database management program or an EEG review program) with a list of one or more files to be opened in BESA Research. It is recommended to create an icon BESA or BESA Research in the external program and to start BESA Research using this icon.
 
This document describes how to start BESA Research from an external program (a patient database management program or an EEG review program) with a list of one or more files to be opened in BESA Research. It is recommended to create an icon BESA or BESA Research in the external program and to start BESA Research using this icon.
 
* To start BESA Research from the external program to review EEG data, this program must first write the foc_link.sub file to disk. It must contain the data file(s) to be opened (see [[#Format of foc_link.sub|Format of foc_link.sub]]). Then BESA Research needs to be started as described below in [[#Start BESA Research to open EEG data|Start BESA Research to open EEG data]].  
 
* To start BESA Research from the external program to review EEG data, this program must first write the foc_link.sub file to disk. It must contain the data file(s) to be opened (see [[#Format of foc_link.sub|Format of foc_link.sub]]). Then BESA Research needs to be started as described below in [[#Start BESA Research to open EEG data|Start BESA Research to open EEG data]].  
Line 16: Line 15:
  
 
==Start BESA Research to open EEG data==
 
==Start BESA Research to open EEG data==
 +
 
Use the following command to start BESA Research with the command line parameter:  
 
Use the following command to start BESA Research with the command line parameter:  
 
<foc_link.sub file path>\foc_link.sub
 
<foc_link.sub file path>\foc_link.sub
Line 21: Line 21:
 
For example, to load EEGs in BESA 5.2.2 or higher (e.g. BESA Research 5.3) at program start (assumed to be installed in C:\BESA52 and file foc_link.sub file located in the BESA Research installation folder), apply the following command:
 
For example, to load EEGs in BESA 5.2.2 or higher (e.g. BESA Research 5.3) at program start (assumed to be installed in C:\BESA52 and file foc_link.sub file located in the BESA Research installation folder), apply the following command:
  
 +
<source lang="dos">
 
C:\BESA52\BESA.exe C:\BESA52\foc_link.sub
 
C:\BESA52\BESA.exe C:\BESA52\foc_link.sub
 +
</source >
 +
 
==Open EEG data while BESA Research is running==
 
==Open EEG data while BESA Research is running==
 +
 
If you want to load a different EEG data file while BESA Research is running, simply execute the same command as upon start of BESA Research after updating the file list in foc_link.sub, e.g.
 
If you want to load a different EEG data file while BESA Research is running, simply execute the same command as upon start of BESA Research after updating the file list in foc_link.sub, e.g.
 
C:\BESA52\BESA.exe C:\BESA52\foc_link.sub
 
C:\BESA52\BESA.exe C:\BESA52\foc_link.sub
Line 32: Line 36:
 
* Files that are currently open but not specified in foc_link.sub are closed. Only the specified files are opened.  
 
* Files that are currently open but not specified in foc_link.sub are closed. Only the specified files are opened.  
 
* When a file is closed in BESA Research, the corresponding entry in the foc_link.sub file is deleted.
 
* When a file is closed in BESA Research, the corresponding entry in the foc_link.sub file is deleted.
 +
 
==Format of foc_link.sub==
 
==Format of foc_link.sub==
 +
 
For each EEG to be loaded write the following lines to the foc_link.sub file
 
For each EEG to be loaded write the following lines to the foc_link.sub file
 
StartedBy: <Your program name>
 
StartedBy: <Your program name>
Line 51: Line 57:
  
 
==Examples==  
 
==Examples==  
 +
 
===Open one EEG data file at the beginning.===
 
===Open one EEG data file at the beginning.===
  
 +
<source lang="dos">
 
FilePath: D:\EEG\000822WC.eeg
 
FilePath: D:\EEG\000822WC.eeg
 +
</source >
  
 
===Open one EEG data file at a defined position.===
 
===Open one EEG data file at a defined position.===
  
 +
<source lang="dos">
 
ReviewDateTime: 2008-07-02/12:18:12
 
ReviewDateTime: 2008-07-02/12:18:12
 
FilePath: D:\EEG\000822WC.eeg
 
FilePath: D:\EEG\000822WC.eeg
 +
</source >
  
 
===Open three EEG data files, position for second data file is specified.===
 
===Open three EEG data files, position for second data file is specified.===
  
 +
<source lang="dos">
 
FilePath: D:\EEG\000822WC.eeg
 
FilePath: D:\EEG\000822WC.eeg
  
Line 68: Line 80:
  
 
FilePath: D:\EEG\000822WE.eeg
 
FilePath: D:\EEG\000822WE.eeg
 +
</source >
  
 
We suggest to separate single EEG entries by an empty line, although this is not required.
 
We suggest to separate single EEG entries by an empty line, although this is not required.
 +
 
===Complete foc_link.sub entry with all possible tags===
 
===Complete foc_link.sub entry with all possible tags===
  
 +
<source lang="dos">
 
StartedBy: BESA Epilepsy
 
StartedBy: BESA Epilepsy
 
ElecFilePath: C:\ELP-FILES\000717WA-STD.elp
 
ElecFilePath: C:\ELP-FILES\000717WA-STD.elp
Line 78: Line 93:
 
ReviewDateTime: 2008-07-02/14:20:12
 
ReviewDateTime: 2008-07-02/14:20:12
 
FilePath: D:\EEG\000717WA.eeg
 
FilePath: D:\EEG\000717WA.eeg
 
+
</source >
  
  
 
[[Category:Setup]]
 
[[Category:Setup]]

Latest revision as of 08:26, 5 May 2021

Module information
Modules BESA Research Basic or higher
Version 5.2.2 or higher

Purpose and Procedure

This document describes how to start BESA Research from an external program (a patient database management program or an EEG review program) with a list of one or more files to be opened in BESA Research. It is recommended to create an icon BESA or BESA Research in the external program and to start BESA Research using this icon.

We recommend using the procedure described in Start BESA Research to open EEG data, since this will work in all cases, and the foc_link.sub file can be located in any arbitrary folder.

Start BESA Research to open EEG data

Use the following command to start BESA Research with the command line parameter: <foc_link.sub file path>\foc_link.sub The foc_link.sub file contains a list of the datasets to be loaded at program start. The file format is described below in Format of foc_link.sub. For example, to load EEGs in BESA 5.2.2 or higher (e.g. BESA Research 5.3) at program start (assumed to be installed in C:\BESA52 and file foc_link.sub file located in the BESA Research installation folder), apply the following command:

C:\BESA52\BESA.exe C:\BESA52\foc_link.sub

Open EEG data while BESA Research is running

If you want to load a different EEG data file while BESA Research is running, simply execute the same command as upon start of BESA Research after updating the file list in foc_link.sub, e.g. C:\BESA52\BESA.exe C:\BESA52\foc_link.sub BESA.exe interprets this call from a database or review program. It checks whether BesaMain.exe is already running. If yes, it keeps BesaMain.exe running, closes the old files, and opens the new file(s) listed in foc_link.sub. If not yet running, BESA.exe starts BesaMain.exe with the new file(s) listed in foc_link.sub. Thus, the procedure for changing an EEG file in BESA Research is the same as described in Start BESA Research to open EEG data for starting BESA Research with the first file(s).

( In older BESA versions (up to version 5.2) a different procedure was required that is still working but not required anymore: When BESA receives a WM_COMMAND message with Id 3000 (Id = (int)(LOWORD(wParam)), file foc_link.sub in the BESA installation folder was reread. While this feature is still working, it is not recommended anymore because the automatic handling by BESA.exe is much simpler and no WM_COMMAND message is needed. ) Notes:

  • Files that are currently open but not specified in foc_link.sub are closed. Only the specified files are opened.
  • When a file is closed in BESA Research, the corresponding entry in the foc_link.sub file is deleted.

Format of foc_link.sub

For each EEG to be loaded write the following lines to the foc_link.sub file StartedBy: <Your program name> EvtFilePath: <path + filename of the evt-File to be loaded for the EEG> EventCode: [<number>] <number> <number> ElecFilePath: <path + filename of the elp-File to be loaded for the EEG> ReviewDateTime: <YYYY-MM-DD/HH:MM:SS> FilePath: <path + filename of EEG to be loaded>

The first line, StartedBy (followed by a colon and a blank), is an optional tag that can be set to specify the name of your application which calls BESA Research. The second line, EvtFilePath (followed by a colon and a blank), is an optional tag that can be set to load events specified in an evt-file. If this tag is not defined, only the events found in the EEG data file are loaded. The third line, EventCode (followed by a colon and a blank), is an optional tag that can be set to define the type and range of your events stored in the event file specified in EvtFilePath. The first number defines the code (type) of your events (e.g. 1=Trigger). The second number defines the event ID range minimum and the third number stands for the maximum. If this tag is defined, BESA Research will remove all events from the EEG which IDs are within the defined range. Then the new events are loaded instead. If this tag is not defined, the new events are loaded in addition to existing events. This tag will be ignored if no EvtFilePath is defined. The fourth line, ElecFilePath (followed by a colon and a blank), is an optional tag that can be set to attach an electrode configuration specified in an elp-file. If this tag is not defined, the original/recorded electrode configuration found in the EEG-Data file is loaded. The fifth line, ReviewDateTime (followed by a colon and a blank), is an optional tag that can be set to specify a time at which the review should be started. If this tag is not defined, the review starts at the beginning of the file. The FilePath line must be the last line for each EEG entry and has to be defined. The tag is followed by path+filename (after the obligatory colon and blank). A maximum of 256 characters for path+filename is read.

Examples

Open one EEG data file at the beginning.

FilePath: D:\EEG\000822WC.eeg

Open one EEG data file at a defined position.

ReviewDateTime: 2008-07-02/12:18:12
FilePath: D:\EEG\000822WC.eeg

Open three EEG data files, position for second data file is specified.

FilePath: D:\EEG\000822WC.eeg
 
ReviewDateTime: 2008-07-02/12:18:12
FilePath: D:\EEG\000822WD.eeg
 
FilePath: D:\EEG\000822WE.eeg

We suggest to separate single EEG entries by an empty line, although this is not required.

Complete foc_link.sub entry with all possible tags

StartedBy: BESA Epilepsy
ElecFilePath: C:\ELP-FILES\000717WA-STD.elp
EvtFilePath: C:\EVT-FILES\000717WA-STD.evt
EventCode: 1 51 60
ReviewDateTime: 2008-07-02/14:20:12
FilePath: D:\EEG\000717WA.eeg