[FieldTrip] hdr_read_header

Schoffelen, J.M. (Jan Mathijs) janmathijs.schoffelen at donders.ru.nl
Sat Oct 30 21:35:12 CEST 2021


Hi Eva,

Perhaps the following quote - from the help documentation of the read_edf.m function, which is in fieldtrip/fileio/private, and which is used under the hood by ft_read_header - may give you some ‘aanknopingspunten’:

% READ_EDF reads specified samples from an EDF datafile. It neglects all trial or
% data block boundaries as if the data was acquired in non-continuous mode.
%
% Note that since FieldTrip only accommodates a single sampling rate in a given
% dataset, whereas EDF allows specification of a sampling rate for each channel.  If
% there are heterogenous sampling rates then this function will automatically choose
% a subset.  If the last such channel is different from the rest, the assumption will
% be made that it is the annotation channel and the rest will be selected.  If that
% is not the case, then the largest subset of channels with a consistent sampling
% rate will be chosen.  To avoid this automatic selection process, the user may
% specify their own choice of channels using chanindx.  In this case, the automatic
% selection will only occur if the user selected channels still have heterogenous
% sampling rates.  In this case the automatic selection will occur amongst the user
% specified channels.  While reading the header the resulting channel selection
% decision will be stored in hdr.orig.chansel and the contents of this field will
% override chanindx during data reading.

Best wishes,
Jan-Mathijs


On 19 Oct 2021, at 10:06, Eva Schlösser via fieldtrip <fieldtrip at science.ru.nl<mailto:fieldtrip at science.ru.nl>> wrote:

Dear all,

Hope you are doing okay.

I'm making two script for selecting EEG or aEEG data.
When I use the ft_read_header function for EEG data (edf file), my script is working and selecting all the right channels (because of the frequency of the EEG data is most common in the edf file).

However, when I have the aEEG .edf file, hdr_read_header is taking the 1 [Hz] channels instead of the channels of the aEEG, because the 1 [Hz] is now more common in the edf. file, but those channels I don't need!

I tried to use the edf2fieldtrip function, ft_channelselection and ft_selectdata.
Now it is possible to get the data for only the aEEG channels. However,  I want to read this data with the ft_read_header function, so I can use the same hdr.Fs (for example) in my script.

Can somebody help me with this?

Kind regards,
Eva
<hdr_read_header.txt>_______________________________________________
fieldtrip mailing list
https://mailman.science.ru.nl/mailman/listinfo/fieldtrip
https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!HJOPV4FYYWzcc1jazlU!offyjAwct_fSvMS6_c7A5F5Ahr6lp9sKbYcMFxRum_u-eLxv9HCRjbqfjCCIEBGl0kEAD-nawGnngUQ$

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20211030/633f0d87/attachment.htm>


More information about the fieldtrip mailing list