[FieldTrip] Warning OPENEDF: Physical Minimum larger than Maximum\n

Simeon Wong simeon.wong at sickkids.ca
Wed Nov 18 19:22:36 CET 2020


Hi Katarina,

The fread command advances the file pointer. Therefore the 4 lines are reading consecutive values from the EDF file.
https://www.mathworks.com/help/matlab/ref/fread.html?searchHighlight=fread&s_tid=doc_srchtitle#d122e421874:~:text=and%20positions%20the%20file%20pointer%20after%20the%20last%20value%20read

With that being said, some EDF export software (for better or for worse) set identical physical values if channels are switched off or for channels without physical units (ie. trigger channels or misc channels).




All the best,
Simeon


[cid:a581ee8a-f956-4ec0-896f-a88e64846b6f]

Simeon Wong

Ibrahim Lab

Neurosciences & Mental Health


686 Bay Street, Toronto ON  M5G 0A4

P 416.813.7654  x303697

________________________________
From: fieldtrip <fieldtrip-bounces at science.ru.nl> on behalf of Katarina Bendtz <katarina.bendtz at gmail.com>
Sent: November 18, 2020 12:50
To: fieldtrip at science.ru.nl <fieldtrip at science.ru.nl>
Subject: [FieldTrip] Warning OPENEDF: Physical Minimum larger than Maximum\n

Dear experts:
Me and my colleague at another university idependently I get this warning when we try to open an edf file:

Warning OPENEDF: Physical Minimum larger than Maximum\n


I’m using fieldtrip 2020113. Looking at the source code
https://github.com/fieldtrip/fieldtrip/blob/master/private/openedf.m<https://urldefense.com/v3/__https://github.com/fieldtrip/fieldtrip/blob/master/private/openedf.m__;!!D0zGoin7BXfl!tHOzBhC87IDZICVPmzh1QeJQI1pBz7wzlyRm7uCUqe_WlgHxjVh2sShWYk0yjAhO9UAo$>

I read:

if (any(EDF.PhysMin >= EDF.PhysMax))

fprintf(2,'Warning OPENEDF: Physical Minimum larger than Maximum\n');

EDF.PhysMin = EDF.DigMin;

        EDF.PhysMax = EDF.DigMax;

end

but then a couple of lines up, I see both EDF.PhysMin and EDF.PhysMax, (and also EDF.DigMin and EDF.DigMax) being set to the same thing:

EDF.PhysMin= str2num(char(fread(EDF.FILE.FID,[8,EDF.NS],'char')'));
EDF.PhysMax= str2num(char(fread(EDF.FILE.FID,[8,EDF.NS],'char')'));
EDF.DigMin = str2num(char(fread(EDF.FILE.FID,[8,EDF.NS],'char')')); %
EDF.DigMax = str2num(char(fread(EDF.FILE.FID,[8,EDF.NS],'char')')); %

So it is quite reasonable that I will get this warning. I’m puzzled.

1. What’s purpose of this warning?
2. Why are the variables set to the same value?
3. Can I safely ignore this warning?
4. Or is there something I misunderstood.

Thanks a lot,

Best,
Kat



Katarina Bendtz, PhD
Research Fellow
Kreiman Lab
Boston Children's Hospital
Harvard University

+1 (617) 390 45 16
3 Blackfan Circle
Boston, USA





________________________________

This e-mail may contain confidential, personal and/or health information(information which may be subject to legal restrictions on use, retention and/or disclosure) for the sole use of the intended recipient. Any review or distribution by anyone other than the person for whom it was originally intended is strictly prohibited. If you have received this e-mail in error, please contact the sender and delete all copies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201118/c8fc062a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook-gb44xqtx.png
Type: image/png
Size: 1756 bytes
Desc: Outlook-gb44xqtx.png
URL: <http://mailman.science.ru.nl/pipermail/fieldtrip/attachments/20201118/c8fc062a/attachment.png>


More information about the fieldtrip mailing list