Skip to content
This repository has been archived by the owner on Dec 14, 2017. It is now read-only.

Getting started

ASOBOLEV edited this page Feb 28, 2014 · 4 revisions

Support: Email || Guides: Installation | Getting started || Reference: General | Retrieval | Upload | Utilities

Before using the toolbox, you should set up your MATLAB environment and initialize a session.

% Move all toolbox functions into scope
import gnode.*;

% Prepare MATLAB
set_up_classpath();

% Initialize session. 'default' will use the account settings specified
% during installation.
session = init('default');

Now the toolbox is ready for use. It requires a network connection for all operations involving download or upload. The G-Node data store uses a simple object model similar to NEO. All your data is stored in a set of object types tailored to electrophysiology, such as blocks, segments, recording channels, signals et cetera.

In the MATLAB environment, we represent these objects as structures. Here is a basic example for creating and uploading such an object.

% Create a structure containing signal data

signal = make_dummy(session, 'analogsignal');

signal.name = 'My brand new signal';
signal.sampling_rate = struct('units', 'Hz', 'data', 12000);
signal.t_start = struct('units', 'ms', 'data', 0);
signal.signal = struct('units', 'mV', 'data', my_data);

% This returns the ID of the newly created object in
% the G-Node data store

new_object = create(session, signal);

Subsequent object retrieval is equally straightforward and supports various access methods (e.g., single ID, array of IDs, numeric range). Here are a few examples to get you going:

% Lists of objects
my_list = get_list(g, 'analogsignal');

% Single objects
my_recording = get(session, 'analogsignal_947');

% Multiple objects
all = { 'analogsignal_948', 'segment_43', 'unit_8' };
my_recordings = get(session, all);

% Ranges
more_recordings = get_range(session, 'analogsignal', 947, 1002);

More advanced operations (e.g., updates, download queues, batch object creation and upload, and so on) are described in the reference.

Support: Email || Guides: Installation | Getting started || Reference: General | Retrieval | Upload | Utilities

Clone this wiki locally