arrow-left

All pages
gitbookPowered by GitBook
1 of 1

Loading...

exportRecord

This method is to export one or more records to EDF or CSV files.

You can export the raw EEG data, the motion data, the performance metrics and the band powers. The available data streams depend on the license of the record. You can check the field licenceScope in the Record object to know which data streams are available.

By default, you can only export the records that were created by your application. If you want to export a record that was created by another application (e.g. Emotiv PROarrow-up-right or EMOTIV LABSarrow-up-right) then you must provide the license id of this application in the parameter licenseIds.

In order to export a record created by EMOTIV LABSarrow-up-right, the current Cortex user must be the owner of the LABS experiment.

You must before you can export it. If you want to export a record immediately after you stop it then you must wait for the before you try to export.

The format of the exported files is described in .

This method was added in Cortex 2.1.1 to all desktop versions of Cortex. It was added to iOS and Android in Cortex 2.7.0

hashtag
Parameters

hashtag
Data streams

The parameter streamTypes must contain one or more values, chosen from this list: "EEG", "MOTION", "PM", "BP". If the format is "EDF" then only "EEG" and "MOTION" are available.

hashtag
Format and version

Depending on the parameters format and version Cortex will create different files.

hashtag
Format EDF, no version

This format is identical to the one used in Cortex 1.x

  • 1 EDF file for the EEG and CQ data

  • 1 EDF file for the motion data

  • 1 JSON file for the markers

Format EDFPLUS/BDFPLUS, no version (available since Cortex version 3.7.5)

  • 1 EDF+/BDF+ file for the EEG, CQ and Motion data

  • 1 JSON file for the markers

  • 1 CSV file for the markers if the parameter includeMarkerExtraInfos is true

hashtag
Format CSV, version V1

This format is identical to the one used in Cortex 1.x

  • 1 CSV file for the EEG and CQ data

  • 1 CSV file for the band powers

  • 1 CSV file for the motion data

hashtag
Format CSV, version V2

This format is the new format of Cortex 2.x

  • 1 CSV file for all the data streams (EEG, CQ, band powers, motion, PM)

  • 1 JSON file for the markers

  • 1 CSV file for the markers if the parameter includeMarkerExtraInfos is true

hashtag
Result

The result is an object that includes these fields:

In case of success, you get an object with these fields:

In case of failure, you get an object with these fields:

hashtag
Examples

hashtag
EDF

hashtag
CSV V1

hashtag
CSV V2

yes

The path of a local folder. Cortex will write the exported files in that folder. You must create this folder before you call this method. Cortex will return an error if the folder doesn't exist.

On iOS, this parameter doesn't exist. Cortex exports the data to the "Documents" folder of the current application.

streamTypes

array of strings

yes

List of the data streams you want to export.

format

string

yes

The format of the exported files. Must be "EDF", "EDFPLUS", "BDFPLUS" or "CSV".

version

string

no

If the format is "EDF", then you must omit this parameter.

If the format is "CSV", then this parameter must be "V1" or "V2".

licenseIds

array of strings

no

The default value is an empty list, which means that you can only export the records created by your application. You can provide the license ID of other applications in order to export the records created by these applications.

This parameter was added in Cortex 2.6.3

includeDemographics

boolean

no

If true then the exported JSON file will include the demographic data of the user. It is only for the records created by .

The default value is false.

This parameter was added in Cortex 2.6.3

includeSurvey

boolean

no

If true then the exported JSON file will include the survey data of the record. It is only for the records created by .

The default value is false.

This parameter was added in Cortex 2.6.3 From Cortex 3.5.0, survey data will be exported in a separate CSV file (along with JSON file).

includeMarkerExtraInfos

boolean

no

If true then the markers of the records will be exported to a CSV file. This file is compatible with .

The default value is false.

This parameter was added in Cortex 2.6.3

includeDeprecatedPM

boolean

no

If true then deprecated performance metrics (i.e. Focus) will be exported.

The default value is false. This parameter was added in Cortex 3.5.6

Export the band powers of each EEG sensor.

1 CSV file for the markers if the parameter includeMarkerExtraInfos is true
1 CSV file for the performance metrics
  • 1 JSON file for the markers

  • 1 CSV file for the markers if the parameter includeMarkerExtraInfos is true

  • Name

    Type

    Required

    Description

    cortexToken

    string

    yes

    A token returned by authorize.

    recordIds

    array of strings

    yes

    An array of record ids. These are the ids of the records you want to export.

    folder

    Stream

    Description

    EEG

    Export the raw EEG data, the contact quality of each EEG sensor, and the markers. The license scope of the record must contain the scope "eeg".

    MOTION

    Export the motion data.

    PM

    Export the results of the performance metric detection.

    If the license scope of the record contains the scope "pm" then Cortex will export the high resolution performance metrics, at 2 hertz. Otherwise Cortex will export the low resolution data, at 0.1 hertz.

    MC

    Export the results of the mental command detection.

    FE

    Export the results of the facial expression detection.

    Name

    Type

    Description

    success

    array of objects

    For each record you successfully exported, this array contains an object that includes the record id.

    failure

    array of objects

    For each record that couldn't be exported, this array contains an object that describes the error.

    Name

    Type

    Description

    recordId

    string

    The id of the record that was successfully exported.

    Name

    Type

    Description

    recordId

    string

    The id of the record that couldn't be exported.

    code

    number

    The error code.

    message

    string

    The error message.

    stop the record
    warning 30
    EmotivPRO user manualarrow-up-right

    string

    BP

    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "exportRecord",
        "params": {
            "cortexToken": "xxx",
            "folder": "/tmp/edf",
            "format": "EDF",
            "recordIds": [
                "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
            ],
            "streamTypes": [
                "EEG",
                "MOTION"
            ]
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
            "failure": [],
            "success": [
                {
                    "recordId": "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
                }
            ]
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "exportRecord",
        "params": {
            "cortexToken": "xxx",
            "folder": "/tmp/csv1",
            "format": "CSV",
            "recordIds": [
                "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
            ],
            "streamTypes": [
                "EEG",
                "MOTION",
                "PM",
                "BP"
            ],
            "version": "V1"
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
            "failure": [],
            "success": [
                {
                    "recordId": "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
                }
            ]
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "method": "exportRecord",
        "params": {
            "cortexToken": "xxx",
            "folder": "/tmp/csv2",
            "format": "CSV",
            "recordIds": [
                "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
            ],
            "streamTypes": [
                "EEG",
                "MOTION",
                "PM",
                "BP"
            ],
            "version": "V2"
        }
    }
    {
        "id": 1,
        "jsonrpc": "2.0",
        "result": {
            "failure": [],
            "success": [
                {
                    "recordId": "ec0ac33f-ad4e-48b1-bbc3-8502f5c49b62"
                }
            ]
        }
    }
    EMOTIV LABSarrow-up-right
    EMOTIV LABSarrow-up-right
    EEGLABarrow-up-right