An open API service indexing awesome lists of open source software.

https://github.com/benoitberanger/api_brainvisionrecorder_remotecontrolserver

API to control BrainVisionRecorder (BVR) from MATLAB
https://github.com/benoitberanger/api_brainvisionrecorder_remotecontrolserver

api brainvisionrecorder bvr matlab pnet rcs remotecontrolserver

Last synced: about 1 year ago
JSON representation

API to control BrainVisionRecorder (BVR) from MATLAB

Awesome Lists containing this project

README

          

# API_BrainVisionRecorder_RemoteControlServer

This repo contains a class to handle communication between MATLAB and **B**rain**V**ision**R**ecorder (BVR) using **R**emote**C**ontrol**S**erver (RCS), typicaly to Start and Stop recording in BVR from MATLAB.

The network communication uses `pnet`, a mex file.
`pnet` can be found here : https://www.mathworks.com/matlabcentral/fileexchange/345-tcp-udp-ip-toolbox-2-0-6'
`pnet` may be bundled with PsychToobox.

# Exemple

```matlab
% create object, and close all previous connections
rc = BVR_RCS();
rc.closeAll()

% set connection IP and port, then connect
rc.setRecorderIP('127.0.0.1')
rc.setPort(6700)
rc.tcpConnect()

% start (or check) that BVR is in Monitoring mode, ready to start record
rc.sendMonitoring()

% up to you if you want to allow or not file overwrite
rc.sendOverwriteOFF()

% output file name will be _[.eeg, .vhdr .vmrk]
rc.sendExperimentNumber(date)
rc.sendSubjectID('test_subjectID_rcs')

% lets go ! start the recording
rc.sendStartRecording()
pause(1.0)

% send annotations
rc.sendAnnotation('blank','stim_visual')
pause(0.1)
rc.sendAnnotation('fixation_cross','stim_visual')
pause(0.1)
rc.sendAnnotation('bip','audio_cue')
pause(0.1)
rc.sendAnnotation('fixation_cross','stim_visual')
pause(0.1)
rc.sendAnnotation('blank','stim_visual')
pause(0.1)

% pause and continue
rc.sendPauseRecording()
pause(0.1)
rc.sendContinueRecording()
pause(0.5)

% and now stop recording
rc.sendStopRecording()

% close the connection
rc.closeAll()

```

# GUI

![readme_figures/gui.png](readme_figures/gui.png)
**There are tooltips on graphic elements : place your mouse cursor over it.**

In the exemples bellow `rc` is the object associted with the GUI, freshly created by `openGUI()` static method

## Standalone
```matlab
rc = BVR_RCS.openGUI()
```

## Embeded in a _container_
```matlab
% containter = figure OR axes OR uipanel
container = uipanel()

rc = BVR_RCS.openGUI(container)
```

# Limitations

Some RCS commandes **not** programmed in this API, in particular the comandes whith variable returned message size.

# MATLAB version
Even old versions shoud work, as long as they have object oriented capabilities (R2011+ ?)