In all cases the value is returned, unambiguously, in seconds. MM:SS), or whether it is a bare number indicating a number of SampleBlocks. ![]() This function takes a BCI2000 parameter value that is supposed to indicate time, and figures out whether it is expressed in seconds/milliseconds/microseconds with an explicit PhysicalUnit, or in sexagesimal notation (e.g. This utility allows you to read, combine, and write BCI2000 parameters from multiple sources, making use of read_bciprm. It requires the mex-files load_bcidat and convert_bciprm. This utility allows you to read BCI2000 parameters from a data file, a parameter file, or from a structure, string, or cell array of strings in Matlab. Read the help for this function in order to see how to run a bci2000chain on a signal that is stored in a Matlab variable rather than a pre-existing file. dat files easily, perhaps using only a numeric signal array and a scalar sampling rate. This utility allows you to create "toy" BCI2000. See the help documentation in the Matlab file for more details. S = bci2000chain(fn, 'TransmissionFilter|SpatialFilter|ARFilter', 'ExampleParameters.prm', 'SpatialFilterType', 3) But in this example, we override some of the spectral estimation parameters using the ones in ExampleParameters.prm, and then further override the spatial filter setting by switching it to CAR mode:įn = bci2000path('data', 'samplefiles', 'eeg3_2.dat') The parameters for these filters start out having the same values that they did when the file was recorded. The following example reads and replays a sample data file through the specified filter chain (TransmissionFilter, then SpatialFilter, then ARFilter). One way of satisfying these path requirements is shown above, using the bci2000path function. The BCI2000 mex files load_bcidat and convert_bciprm, and the m-files make_bciprm.m, read_bciprm.m and read_bcidate.m, must be in directories that are on the Matlab path. The tools/cmdline directory must be on the operating-system path (not to be confused with the Matlab path) for the session. The bci2000chain function uses the command-line tools (calling them via Matlab's builtin function system), but it hides the details and presents itself to you as a single Matlab function.īci2000chain requires the command-line binaries, including bci_dat2stream and bci_stream2mat as well as any specific filter tools you intend to use, to have been built in tools/cmdline. Recreating a preprocessing chain offline is then a question of passing a stream of data through a chain of these filter tools, connected by an operating-system "pipe". We can therefore take the individual filter implementations and build them singly, as separate executables that can be called from the system command-line. This is possible because online BCI2000 modules consist of a chain of filters, each filter being implemented in a self-contained source file. The BCI2000 command-line tools allow the online processing performed by BCI2000 to be recreated exactly offline. Watch out, in case this is (or becomes) incorrectīci2000path -AddToMatlabPath tools/matlabīci2000path -AddToSystemPath tools/cmdline % required so that BCI2000CHAIN can call the command-line toolsĬd(olddir) % change directory back to where we were before One solution is to adapt the following lines and put them either in your startup.m file, or in some other handy function in the My Documents\MATLAB (or $HOME/matlab) directory so that you can call it when needed:Ĭd('C:\BCI2000') % The absolute path has to be hardcoded somewhere, and here it is. ![]() ![]() You could use the graphical pathtool to add an absolute reference to the tools/matlab directory "permanently" to the Matlab path, but anyone who has made heavy use of Matlab for some time, and is in the habit of using more than one third-party toolbox, will know that this leads to problems sooner or later. This chicken-and-egg problem is typical of Matlab path-juggling. Of course, before you can call bci2000path, Matlab needs to know where bci2000path itself is.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |