Package: senserecord
Sense RecordA cross-platform application for saving data streams from biosensor hardware using theBrainFlow Python API.Sense Record is designed for a research lab setting, where the user (experimenter, study staff) needs to ensure that the raw file stream is being saved and that the file is saved along with information about the experimental session/task/run/participant.Sense Record saves biosensor recordings using file naming conventions compliant with theBrain Imaging Data Structure (BIDS). The user is prompted to enter the subject/participant, session, task, and run information before starting any recording. This data is then used by Sense Record to generate the output file name and sub directory names, along with BIDS-spec metadata files that it saves with each recording.StatusSense Record is pre-alpha, in development, unstable. Use accordingly, at your own risk.Supported hardwareManufacturerSenserecord config nameOpenBCICYTON_BOARDOpenBCIGANGLION_BOARDOpenBCICYTON_DAISY_BOARDOpenBCIGALEA_BOARDOpenBCIGANGLION_WIFI_BOARDOpenBCICYTON_WIFI_BOARDOpenBCICYTON_DAISY_WIFI_BOARDBrainbitBRAINBIT_BOARDg.tecUNICORN_BOARDCallibriCALLIBRI_EEG_BOARDCallibriCALLIBRI_EMG_BOARDCallibriCALLIBRI_ECG_BOARDMITFASCIA_BOARDNeurosityNOTION_OSC_BOARDI_Ron-BCIIRONBCI_BOARDCrowd SupplyFREEEEG32_BOARDInstallationInvokepipas appropriate in your environment to do:pipinstallsenserecordUsageSense Record provides three types of interfaces for recording biosensor data with BrainFlow: a GUI desktop app, a command-line interface, and a REST web services API.To launch the GUI desktop app:senserecord-guiTo launch the CLI console app:senserecordTo launch the local http server and web app with REST API:senserecord-httpLearn more about each of these interfaces in the sections below.GUI Desktop ApplicationThe GUI provides controls for starting and stopping recordings. It prompts you for run information (BIDS fields) at the start of each recording run.Launch the GUI by running the command:senserecord-guiIn the menu bar, selectFile > Load configuration fileand load your.ymlfile. Use the example configuration files in/examplesto create your config file.Press the "Start Recording" button. A dialog will appear, prompting you to enter information (BIDS fields) about your recording.Record until your task/run is finished.Press the "Stop Recording" button.Find your recording's raw data file in[bidsroot]/sourcedata/sub-[subject]/ses-[session]/[data_type]/*.csvCLI ApplicationSense Record comes with an interactive command-line interface.Typesenserecordwith no arguments and it shows you help text.Typesenserecord startwith no arguments and you are prompted for input, like this:Enteryourboardname:SYNTHETIC_BOARD
Enterthepathtotherootdirectoryofyourproject:./
Subjectname/ID:001Sessionname:testSession
Taskname:myExperiment
Runnumber:001Datatype.Choices:eeg,ecg,:eeg
NowrecordingfromSYNTHETIC_BOARD
Stoptherecording?[y/N]:n
Stoptherecording?[y/N]:y
StoppedrecordingfromSYNTHETIC_BOARDThis example run created a test directorysourcedata/sub-001/ses-testSession/eegwith a data file inside namedsub-001_ses-testSession_task-myExperiment_run-001_eeg.csv.You can also bypass the prompts with command-line arguments, like this example::$senserecordstart--board-nameSYNTHETIC_BOARD--serial-port/dev/ttyUSB0--bidsroot/home/myuser/my_experiment_dir--sub001--sesmySession--taskmyTask--run001--data-typeeegTypesenserecord start --helpto see available options.REST Web Services APIYou can control recordings over http using the built-in REST web services API. Start the REST server with:senserecord-httpThis will launch the server process and try to open the http endpoint in your browser athttp://127.0.0.1:8000. Visit that URL and you get interactive HTML documentation that allows you to start and stop recordings from your browser. You can also use it to build URLs like the one used in the example below.Example usage of the REST APIRecordings can be started with a GET request, with parameters in the query string of the URL.Visit this example URL and it will start recording fromSYNTHETIC_BOARD:http://127.0.0.1:8000/start/SYNTHETIC_BOARD?bidsroot=%2Fhome%2Flink%2FDownloads&serial_port=%2Fdev%2FttyUSB0&sub=001&ses=default&task=default&run=001&data_type=eeg&modality=eegIt returns a simple JSON response that looks something like this:{"status":"ok","result":{"board":{"name":"SYNTHETIC_BOARD","is_ready":false,"is_recording":true}},"details":[]Don't forget to stop the recording! You can do that by visiting this URL:http://127.0.0.1:8000/stop/SYNTHETIC_BOARDWhen the recording stops, the API returns this JSON response smth like:{"status":"ok","result":{"board":{"name":"SYNTHETIC_BOARD","is_ready":true,"is_recording":false}},"details":[]}LicenseGPL-3.0-or-laterContactLink Swanson (link@swanson.link)