XDF based protocols¶
This kind of file format is our preferred file format. It is open-source, well-defined and extensible and has pxdf to load it with Python. You will need one file.
.xdf
Data¶
Because LabRecorder can record multiple streams into a single .xdf
-file. These files can contain therefore not only EEG and EMG, but also e.g. pupilometric data, respiration effort, grip force, and many more. As it allows to record multiple streams, it also offers the option to record coordinates (as e.g. sent with every pulse from localite version 4.0) together with the raw data (as sent e.g. by eego or bvr) and additional markers.
Coordinates¶
In the optimal case, the .xdf
-file contains already sufficient information about the coordinates, and pairing is automatic. Yet, there will be some .xdf
-files, where not all streams were recorded. This might have happened e.g. due to errors in the recording script, an erroneous automated recording, or during manual recording with LabRecorder. In these cases, information about coordinates or other markers can be missing. The pairing of coordinates with a specific trace needs to be reconstructed manually (see Manually linking the coordinates).
If multiple protocols were recorded in one xdf
-file, as often happened during manual recording, we will have hundreds of stimuli. Worse, it can be that even marker-streams are missing, and there is no information when a protocol started within the long recording. Linking them to the correct coordinates is tricky, and the best chance is probably taking account of the relative latency between subsequent stimuli.
-
cut_traces
(xdffile, annotation)[source] cut the tracedate from a matfile given Annotations :param xdfile: the xdffile for cutting the data. must correspond in name to the one specified in the annotation :type xdfile: FileName :type annotation:
Dict
[str
,Any
] :param annotation: the annotations specifying e.g. onsets as well as pre and post durations :type annotation: Annotations- Returns
traces (List[TraceData])
-
prepare_annotations
(xdffile, channel, pre_in_ms, post_in_ms, xmlfile=None, event_name='coil_0_didt', event_stream='localite_marker', comment_name=None)[source] load a documentation.txt and cnt-files and distill annotations from them
- Parameters
xmlfile (FileName) – an option xml file with information about the target coordinates
readout (str) – which readout to use
channel (str) – which channel to pick
pre_in_ms (float) – how many ms to cut before the tms
post_in_ms (float) – how many ms to cut after the tms
xdffile (FileName) – the
.xdf
-file with the recorded streams, e.g. data and markers
- Returns
annotation (Annotations) – the annotations for this origin files