Ephus data files are termed XSG files (named after the program in charge of creating them: experimentSavingGUI).
A single .xsg file contains data and header information from all running Ephus programs, and is stored in the binary Matlab mat format. As such, a .xsg file is best analyzed within Matlab. One way to load .xsg data into Matlab for analysis is with the following command:
>> d = load('pathtofile.xsg', '-mat') d = header: [1x1 struct] data: [1x1 struct]
For example, if during your acquisition the Ephys program was running, then any data acquired on channel #1 would be found as:
tr = d.data.ephys.trace_1;
While the sampling rate used for this data would be found as:
sr = d.header.ephys.ephys.sampleRate;
From here, you should be able to analyze the data directly in Matlab, or export to a data file format that suits your existing analysis methods.
Typical data situations
- Single stimulation trace, e.g. short train of voltage steps
- A single .xsg file contains the data for the entire stimulation. See above for how the data is stored.
- Sequence of simulations, e.g. a family of current steps with increasing amplitude
- LoopGui CPU mode: each iteration is saved as a single .xsg file. Each such file can be accessed as above, and analyzed individually or combined with data from other steps in the family.
- LoopGui DAQ mode: a single .xsg file contains one (long) continuous trace spanning all iterations in the loop (including time between iterations). This file can be accesses as above - during analysis, you will need to index into the trace to isolate individual stimulation steps.
- Mapping
- The mapper acquires each map in DAQ mode, i.e. as a single continuous trace containing data from all stimulation sites in the order they were stimulated. For each map, the mapper creates a folder, e.g. map01, and saves a single .xsg file.
- To "decode" the continuous map trace as a two-dimensional map, one must use the map pattern to index into the trace appropriately. The map pattern is an array in the header field, called header.mapper.mapper.mapPatternArray. With knowledge of the trace length (e.g. 0.4 seconds), sampling rate (e.g. 10 kHz), and map pattern, one can select the samples corresponding to a particular stimulus location.
- In practice, one uses a separate analysis program called MapAnalysis, which provides this functionality and much more.
dumpXsgHeader - Dump the entire header of an xsg file to the screen for review