3. creating a @cortex object

There are currently 4 ways to create a @cortex object:

  1. using a standard CORTEX data file as source
  2. using a .nex file generated by Neuroexplorer (part of the Plexon recording system) as source
  3. reloading a previously generated object from a "dump" file
  4. creating an empty object

1. Standard CORTEX data file as source

To create a @cortex object you need a source CORTEX data file, and you need to know a couple of things about it:

  1. its name and location (path);
  2. the range of cluster (spike) codes that may be present in it;

Actually, there are a few more things that you should know, and that are stored in a text file called 'giucode.def'. Changing some of the values in giucode.def will affect the way a @cortex object is created. See comments in the distribution file for more details on the matter.

Syntax:
cobj = cortex (path_and_file_name, spike_range)

The argument spike_range is an array that contains all "possible" cluster codes in the data file. Any encode included in spike_range will be counted as a spike. Data files collected using a standard, single-electrode CORTEX setup are likely to contain cluster codes [1,2] only; on a multi-electrode setup the assignements may vary. Although it's OK to specify a large range (e.g., 1000:1500), the larger the array, the slower the object construction. Thus, use as specific a range as possible, if speed is a concern (e.g.,  [1000:1003, 1100:1103, 1400:1403]).

Example:
>> cobj = cortex ('c:\data\cfile.1', [1,2,1000:1010]);

Note that even if your CORTEX file only contains behavioral data (no spikes), you still need to send a spike_range argument to the constructor. In such cases, simply pass a number that is certainly NOT used as an encode.

Example:
>> cobj = cortex ('c:\data\cfile.1', 20000);

Once you have created a @cortex object, you can save it on disk in a preprocessed ("dump") format. Reloading of a "dump" file is much faster than creating the object from the original data file, so it is recommended that you "dump" an object to file every time you plan to use those data over multiple sessions.

To write a "dump" file, first create a regular @cortex object, then use the following syntax:

cobj.save (path_and_file_name)

Example:
>> cobj = cortex ('c:\data\cfile.1', [1000:1400]);
>> cobj.save ('c:\data\dcfile');

2. Neuroexplorer's .nex files as data source

coming soon!

3. Loading a "dump" file

Syntax:
cobj = cortex (path_and_file_name)

Example:
>> clear cobj;
>> cobj = cortex ('c:\data\dcfile'); % much faster!

Note that attempting to load a standard CORTEX file using the single-argument syntax results in errors. Conversely, to create an object based on a "dump" file, you must not use any arguments other than path_and_file_name.

4. Empty @cortex objects

cobj = cortex

This will create an object with the same structure as a "real" @cortex object, but with no data in it. It is not yet particularly useful, but it's there for future developments.

Previous <-> Next