Physiology Format

From 2015, CSPM uses a new file format for physiology. The old one was "hd2000", which ran separately, but which was very clunky.

Raw data

In the study data folder, the "raw" data is from whatever recording we had: Biopac, IFF-PHYS, instrunet,or WHH. The "phys" folder contains the data in a universal format. (The MRI equivalent is DICOM, PAR/REC, Analyze for the raw, and nifti for the converted.)

phys folder

Each channel is saved as a MATLAB timeseries object, with asynchronous (that is, not necessarily uniformly sampled) time values. 

File

Structure

Fields

Subfields

Description



File

Structure

Fields

Subfields

Description



phys[protocol_id].mat

phys*

.study_id



link to study in database; 0 before saving

* saved as "-struct", so individual variables loaded with phys = load(...)







.name



name







.start_time

(optional)



date-time: precise start time of recording

Optional because for some fMRI physiology we don't have this, or it's not synced with scanner.







.num_chans











.chan{1:N}



cell array of channels



 

 

 

.id

unique identifier

added 2022 - needed to link created channels

 







.name

channel name









.type

"rec" (recorded) or "calc" (calculated)









.filename

mat file of timeseries object; variable has channel name. File is located in phys folder). The channels are synchronized such that the time is equivalent (this is critical for events). The time should start at 0.

Time is in seconds.









.ts (memory only)

the timeseries when loaded; this is not saved in the file, and is only loaded when needed. It slows things down a lot if it gets loaded every time.









.sample_rate

empty for asynchronous









.offset

time offset (relative to phys.start_time if present)









.calc_sourcechans

for calculated channels; cell array of "rec" channel names used to calculate "calc" channel









.descr

description (optional)









.units

units (optional)









.num_features

number of features (types of markers, eg. resp peaks/troughs, ECG Q/R/S









.feature{1:N}

cell array of features (optional)











.type

feature type (peak/trough, ECG)









.descr

description (optional)









.num_markers











.marker_list











.marker

cell array or markers











.name











.x











.y











.shortname











.color





.num_events



this includes states (events with non-zero duration)







.event{1:N}



Cell array of events or states; note that these are all events, not only those in the database. For analysis, we will use the database events and select segments of the timeseries. For this reason, the names don't matter too much, as we can select events for analysis and classify them at the same time we incorporate them into the database.









.time

time in seconds, relative to phys.start_time









.event_id

event_id from database









.duration

empty or 0 for event, time for "state"









.type (optional?)





Example (phys file incorrect size - earlier version where timeseries was saved in phys object)

CSPM  functions that read/write in this format

  • phys_format_whh.m: converts raw WHH data.

  • db_convertphys2spm12 reads old into new data format.