{% verbatim %} Neo Visualizer example

Human Brain Project logo Neo visualizer service

This server hosts a demonstration instance of the Neo Viewer REST API, which, together with the neural-activity-visualizer Javascript app, enables web-browser visualisation of electrophysiology datafiles in any format supported by the Neo library.

At present, this service is open, with no quality of service guarantees. In future, access will require an API key and the rate of requests will be throttled.

You can also host an instance of this server yourself - see documentation.

If you encounter any problems, please let us know.

This project has received funding from the European Union’s Horizon 2020 Framework Programme for Research and Innovation under the Specific Grant Agreement No. 785907 (Human Brain Project SGA2).

Example

<head>
    ...

    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.6/nv.d3.min.css">

    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular.js/1.7.5/angular-resource.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/nvd3/1.8.6/nv.d3.min.js"></script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/angular-nvd3/1.0.9/angular-nvd3.min.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/gh/NeuralEnsemble/neo-viewer@master/js/src/visualizer.js"></script>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/gh/NeuralEnsemble/neo-viewer@master/js/src/services.js"></script>
</head>
<body>
    <div class="container">
        ...
        <div class="row" ng-app="neo-visualizer">
            <visualizer-view
                source="https://object.cscs.ch/v1/AUTH_c0a333ecf7c045809321ce9d9ecdfdea/Migliore_2018_CA1/exp_data/abf-int-bAC/Ivy_960711AHP3/96711008.abf"
                height=300>
            </visualizer-view>
        </div>
    </div>
</body>
            

Example with dynamic source

<div ng-controller="URLFormController">
    <form class="form-inline">
        <div class="form-group">
            <label for="dataFileURL">URL of data file:</label>
            <input type="text" class="form-control" ng-model="dataFileURL" id="dataFileURL" placeholder="enter data file URL here" style="width: 600px;">
        </div>
        </form>

    <visualizer-view ng-if="dataFileURL"
        source="{{dataFileURL}}"
        height=300>
    </visualizer-view>
</div>
            

Example with spike trains

Example with tag attributes

downsamplefactor for down sampling the signal by specified positive integral value (default = 1, i.e. no down sampling); segmentid for auto displaying specified segment; signalid for auto displaying specified signal; spiketrainselect for displaying spike trains of segment.
<visualizer-view
    source="https://drive.humanbrainproject.eu/f/01927e7e3cff4010a98a/?dl=1"
    downsamplefactor=4
    segmentid="1"
    signalid="0"
    spiketrainselect="true"
    height=300>
</visualizer-view>
            

API Documentation

The API follows the Neo container structure: the outermost container is the Block, which contains one or more Segments (a continuous recording period, corresponding for example to one trial or one stimulus presentation). Each segment contains one or more AnalogSignals, each of which may be multi-channel.

Events and Epochs are not yet supported, but are coming soon!

All endpoints support only GET requests.

/blockdata/

Return a list of all the Blocks in the file.

URL Params

Required:
url=[URL]
Location of data file to be viewed

Success Response:

Code:
200 OK
Content:
{
    "block": [
        {
            "annotations": {
                "key1": "value1",
                "key2": "value2"
            },
            "name": "Name of data block",
            "description": "Description of data block",
            "file_origin": "original_file_name.dat",
            "rec_datetime": "2018-04-01T12:00:00",
            "segments": [
                {
                    "name": "Name of data segment",
                    "annotations": {
                        "key3": "value3",
                        "key4": "value4"
                    },
                    "description": "Description of data segment",
                    "rec_datetime": "2018-04-01T12:00:00",
                    "file_origin": "original_file_name.dat",
                    "analogsignals": [],
                },
                {
                    ...
                },
                ...
            ]
        },
        {
            ...
        },
        ...
    ]
}
                                

Error Responses:

Code:
404 Not Found
Content:
{ error : "File doesn't exist at this URL" }
Code:
415 Unsupported Media Type
Content:
{ error : "Neo is unable to read this file" }

/segmentdata/

Return information about an individual Segment, including metadata about the signals contained in the segment, but not the signal data themselves.

URL Params

Required:
url=[URL]
Location of data file to be viewed
Optional:
segment_id=[integer]
ID of the segment to be viewed

Success Response:

Code:
200 OK
Content:
{
    "name": "Name of the segment",
    "description": "Description of the segment",
    "file_origin": "original_file_name.dat",
    "annotations": {
        "key3": "value3",
        "key4": "value4"
    }
    "analogsignals": [{}, {}, ...],
    "as_prop": [
        {"size": 1000, "name": "signal1_name"},
        {"size": 500, "name": "signal2_name"},
        ...
    ]
}
                                    

Error Responses:

Code:
404 Not Found
Content:
{ error : "File doesn't exist at this URL" }
Code:
415 Unsupported Media Type
Content:
{ error : "Neo is unable to read this file" }

/analogsignaldata/

Return an individual AnalogSignal, both metadata and the data array.

URL Params

Required:
url=[URL]
Location of data file to be viewed
Optional:
segment_id=[integer]
ID of the segment containing the signal
analog_signal_id=[integer]
ID of the signal to be viewed

Success Response:

Code:
200 OK
Content:
{
    "name": "Name of the signal",
    "values": [-71.0, -72.0, -71.5, -71.5, -71.5, -71.0, -72.0, -71.0, -71.5, -71.0, -71.0, -72.0, ...],
    "values_units": "mV",
    "times": [0.0, 0.0001, 0.0002, 0.0003, 0.0004, 0.0005, 0.0006, 0.0007, 0.0008, 0.0009, 0.001, ...],
    "times_dimensionality": "ms",
    "t_start": 0.0,
    "t_stop": 1000.0,
    "sampling_rate": 10.0,
    "sampling_rate_units": "kHz"
}
                                

Error Responses:

Code:
404 Not Found
Content:
{ error : "File doesn't exist at this URL" }
Code:
415 Unsupported Media Type
Content:
{ error : "Neo is unable to read this file" }
{% endverbatim %}