# mentalCommandBrainMap

This method returns the brain map of a profile. The brain map is a graphic representation of the mental command training of the user. It indicates which actions are most distinct from each other and from the neutral state as measured by how often the training data is misclassified. The better training you do, the more separated the coordinates will be.

Check out the usage in our [BCI](https://emotiv.gitbook.io/emotivbci/mental-commands/brain-space-diagram) app.

## Parameters

| Name        | Type     | Required | Description                                                                                           |
| ----------- | -------- | -------- | ----------------------------------------------------------------------------------------------------- |
| cortexToken | `string` | yes      | A token returned by [authorize](https://emotiv.gitbook.io/cortex-api/authentication/authorize).       |
| profile     | `string` | no       | A profile name.                                                                                       |
| session     | `string` | no       | A session id returned by [createSession](https://emotiv.gitbook.io/cortex-api/session/createsession). |

You must set one of these 2 parameters: **profile** or **session**. [Read this](https://emotiv.gitbook.io/cortex-api/advanced-bci/..#profile-name-or-session-id) for details.

## Result

The result is an array of objects. Each object is represents a trained actions and contains these fields: &#x20;

| Name        | Type                 | Description                                                                                                                 |
| ----------- | -------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| action      | `string`             | The action name.                                                                                                            |
| coordinates | `array of 2 numbers` | <p>The (x, y) coordinates of this action in the brain map.<br>x is in range \[-1.0, 1.0] and y is in range \[0.0, 1.0].</p> |

## Examples

{% tabs %}
{% tab title="Request" %}

```javascript
{
    "id": 5891714,
    "jsonrpc": "2.0",
    "method": "mentalCommandBrainMap",
    "params": {
        "cortexToken": "xxx",
        "profile": "cortex-v2-example",
        "session": "1d5d3655-d570-4731-9faf-967bc5440dc5"
    }
}
```

{% endtab %}

{% tab title="Response" %}

```javascript
{
    "id": 5891714,
    "jsonrpc": "2.0",
    "result": [
        {
            "action": "neutral",
            "coordinates": [0,0]
        },
        {
            "action": "push",
            "coordinates": [0.08947246481272716,0.1596770200887308]
        }
    ]
}
```

{% endtab %}
{% endtabs %}
