<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Hi Alex and Katarina,</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif; font-size: 10pt;"><br>
</span></div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<span style="color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif; font-size: 10pt;">According to the EDF standard, inverted physical min/max values are used to implement the negative-up convention in clinical neurophysiology: <a href="https://www.edfplus.info/specs/edfplus.html#:~:text=5.%20'Digital%20maximum'%20must%20be%20larger,by%200'%20errors%20by%20some%20viewers).">https://www.edfplus.info/specs/edfplus.html#:~:text=5.%20'Digital%20maximum'%20must%20be%20larger,by%200'%20errors%20by%20some%20viewers).</a></span><br>
</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
Therefore, it would appear (without further evidence to the contrary) that your data is ok, and the headers are simply indicating a negative gain.</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
If you're trying to only copy the data, I'd suggest doing it digitally (ie. without any conversion into physical units) using lower-level functions. This will ensure the data is not "altered". In our lab, we also have a similar use case where we extract only
 scalp electrodes during specified times into separate EDF files. We do this in Python using pyedflib, mainly because some of our other analysis code was already in Python, not for any particular advantage of the language or toolbox over Fieldtrip: <a href="https://gist.github.com/dtxe/a74bd43f4106281b86b9171bf5efe73d" style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt;">https://gist.github.com/dtxe/a74bd43f4106281b86b9171bf5efe73d</a></div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
I'm speculating the reason the data changes after the 2nd decimal place is due to rounding:</div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<ol>
<li>Data is stored in EDF format as 16-bit integers <a href="https://www.edfplus.info/specs/edf.html#:~:text=each%20sample%20value%20is%20represented%20as%20a%202%2Dbyte%20integer" title="https://www.edfplus.info/specs/edf.html#:~:text=each%20sample%20value%20is%20represented%20as%20a%202%2Dbyte%20integer">
(ref)</a></li><li>On import, the data is converted into physical units using digital min/max, physical min/max</li><li>On export, the data is converted back into digital units</li><ol style="list-style: lower-alpha;">
<li>The header field for physical min/max only accommodates 8 characters, hence lines 91-95</li><li>Fieldtrip optimizes the dynamic range by using the physical signal's min/max, which is likely different than the original EDF file's physical min/max</li><li>After converting back into digital units, the data is <i>rounded to the nearest int16</i>.</li></ol>
</ol>
<div><br>
</div>
<div><br>
</div>
<div>I hope this helps,</div>
<div><br>
</div>
<div>Simeon</div>
<div><br>
</div>
<div><br>
</div>
<div>
<div style="font-family: Arial, Helvetica, sans-serif; font-size: 10pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="Signature">
<div>
<div style="font-family:Arial,Helvetica,sans-serif; font-size:10pt; color:rgb(0,0,0)">
</div>
<div></div>
<div></div>
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:10pt; color:#000000; font-family:Helvetica,Arial,sans-serif">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="color:rgb(33,33,33); font-family:wf_segoe-ui_normal,"Segoe UI","Segoe WP",Tahoma,Arial,sans-serif,serif,EmojiFont; font-size:15px; margin:0px">
<br>
<br>
<table style="border-collapse:collapse; border:none">
<tbody>
<tr style="">
<td width="174" style="width:130.25pt; border:none; border-right:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt">
<div align="center" style="margin:0px 0cm 0.000133333px; font-size:11pt; font-family:Calibri,sans-serif; text-align:center">
<img class="EmojiInsert" style="max-width:100%" data-outlook-trace="F:1|T:1" src="cid:2cc287ba-1b09-4751-9231-2940fe7f4f40"><br>
</div>
</td>
<td width="346" style="width:259.6pt; border:none; padding:0cm 5.4pt 0cm 5.4pt">
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:Calibri,sans-serif; margin-left:8.1pt; line-height:120%; text-autospace:none">
<b><span style="font-size:9.0pt; font-family:"Arial",sans-serif; color:black">Simeon Wong</span></b><span style="font-size:9.0pt; font-family:"Arial",sans-serif; color:black"></span></p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:Calibri,sans-serif; margin-left:8.1pt; line-height:120%; text-autospace:none">
<span style="font-size:9.0pt; font-family:"Arial",sans-serif; color:black">Ibrahim Lab</span></p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:Calibri,sans-serif; margin-left:8.1pt; line-height:120%; text-autospace:none">
<span style="font-size:9.0pt; font-family:"Arial",sans-serif; color:black">Neurosciences & Mental Health</span></p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:Calibri,sans-serif; margin-left:8.1pt; line-height:120%; text-autospace:none">
<span style="font-size:9.0pt; font-family:"Arial",sans-serif; color:black"></span></p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:Calibri,sans-serif; margin-left:8.1pt; line-height:120%; text-autospace:none">
<br>
</p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:Calibri,sans-serif; margin-left:8.1pt; line-height:120%; text-autospace:none">
<span style="font-size:9.0pt; font-family:"Arial",sans-serif; color:black">686 Bay Street, Toronto ON<span style=""> 
</span>M5G 0A4</span></p>
<p style="margin:0cm 0cm 0.0001pt; font-size:11pt; font-family:Calibri,sans-serif; margin-left:8.1pt; line-height:120%; text-autospace:none">
<span style="font-size:9.0pt; font-family:"Arial",sans-serif; color:black">P 416.813.7654<span style=""> 
</span>x303697</span></p>
</td>
</tr>
</tbody>
</table>
<br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> fieldtrip <fieldtrip-bounces@science.ru.nl> on behalf of Lepauvre, Alex <alex.lepauvre@ae.mpg.de><br>
<b>Sent:</b> November 20, 2020 06:12<br>
<b>To:</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Subject:</b> Re: [FieldTrip] Warning OPENEDF: Physical Minimum larger than Maximum\n</font>
<div> </div>
</div>
<style>
<!--
@font-face
        {font-family:Helvetica}
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:"Segoe UI"}
@font-face
        {font-family:Consolas}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif}
a:link, span.x_MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.x_MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
p.x_msonormal0, li.x_msonormal0, div.x_msonormal0
        {margin-right:0cm;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif}
span.x_apple-converted-space
        {}
span.x_xpl-cce
        {}
span.x_xapple-tab-span
        {}
span.x_EmailStyle21
        {font-family:"Calibri",sans-serif;
        color:#1F497D}
span.x_EmailStyle22
        {font-family:"Calibri",sans-serif;
        color:#1F497D}
.x_MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:72.0pt 72.0pt 72.0pt 72.0pt}
div.x_WordSection1
        {}
-->
</style>
<div lang="EN-US" link="blue" vlink="purple">
<div class="x_WordSection1">
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">Dear Fieldtrip community,</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">Following on the messages below, I performed comparison between the saved signal and the original signal. To give a little more context, our single goal here
 is to load our EDF signal in fieldtrip to then chop it into pieces to be able to save each piece separately. We are required to do so as we are having very long EDFs and because we have to format our data in these specific pieces for data ingestion in XNAT.
</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">The written function (see attached) loads the EDF of interest and using a photodiode trigger channel, we parse our signal in “blocks”, enabling the user of
 the code to adjust detected onsets manually to account for misdetection by our algorithm. The EDF signal is cut from onsets to onsets and stored in separated files. We need to make sure that this procedure doesn’t alter our raw signal in any ways. To check
 whether this happens, following the data saving, the saved data are being reloaded and compared to the original data that were parsed. If the comparison yields anything else than 0s, then it means that the data were altered in some way.
</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">When running the function, the first thing I notice is that following saving, the size of the signal.trial{1,1} matrices has been changed. Following some
 digging in the edf write function, I noticed that the data are being saved to the EDF in 1 seconds chunks, while it is not in our original signal (0.625seconds instead). I assume that this is not a big deal as this doesn’t really alter the data. However, what
 I believe is problematic is that the signal gets altered after the second decimal place across all channels. I am assuming that this has something to do with the conversion to uint16? I am a bit puzzled about why this is the case and how we can get around
 this issue to save our data and keep them pristine. Has anyone been encountering similar issues and/or knows a way?</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">Kind regards,</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">Alex
</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_MsoNormal"><b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> fieldtrip <fieldtrip-bounces@science.ru.nl>
<b>On Behalf Of </b>Lepauvre, Alex<br>
<b>Sent:</b> Thursday, 19 November 2020 14:01<br>
<b>To:</b> FieldTrip discussion list <fieldtrip@science.ru.nl><br>
<b>Subject:</b> Re: [FieldTrip] Warning OPENEDF: Physical Minimum larger than Maximum\n</span></p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">Dear Simeon, deaf Fieldtrip community</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">Thanks a lot for your helpful feedback. To give you a little bit more context, our EDFs are from iEEG data.  I have been digging a little bit more into this
 issue with our data. First of all, it turns out that the warning isn’t thrown by the opnedEDF function, but by the read_edf.m one. It seems that in our files, the accessed PhysMin and PhysMax are reversed. Indeed, most values in the PhysMax are negative (-8711uV,
 except for some misc channels), while the PhysMin is the exact opposite (+8711), which seems to be the prime reason for this error.  I am not sure why that is the case. According to what you were saying @Simeon, this might be due to our EDF export software
 doing something odd with the headers? Can this harm our data? </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">Also, another aspect I am confused about is that we are currently using fieldtrip to chop our single big EDFs into smaller more manageable files. We therefore
 load the data triggering the warning, then chop them and adjust the headers, and save the chunks separately. However, when reloading the newly saved data, the warning isn’t there anymore, which has me worried that the data have been altered in some way.
</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">After digging in the function write_edf a little bit more, I am supposing that the issue doesn’t appear anymore because fieldtrip compute the max and min
 amplitude of the signal, and fill it in in the PhyMax and PhysMin headers itself, correct?
</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">Finally, another issue we are facing is that for some of our EDF files, the write_EDF function doesn’t work with some of our EDFs (I am unfortunately not
 allowed to share any data due to strong data privacy policies In our project, my apologies). While for some of our files it did work, for at least one, the write_edf returns the following error:</span></p>
<p class="x_MsoNormal"><img width="980" height="174" id="x_Picture_x0020_1" style="width:10.2083in; height:1.8125in" data-outlook-trace="F:1|T:1" src="cid:image003.jpg@01D6BF33.9D87D350"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"></span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">I again dived into the function write_edf and located the issue here:
</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="x_MsoNormal"><img width="1006" height="220" id="x_Picture_x0020_2" style="width:10.4739in; height:2.2916in" data-outlook-trace="F:1|T:1" src="cid:image005.jpg@01D6BF33.9D87D350"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"></span></p>
<div>
<div style="border:none; border-top:solid #E1E1E1 1.0pt; padding:3.0pt 0cm 0cm 0cm">
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D">I am not entirely sure what the purpose of these statements is. It seems to reduce the decimal places of the physical minimum (and then maximum) to find which
 approximation fits the expected size (8*nchans). However, none of the 5 options fit. Surprisingly enough, going one more would work: in my signal %-8.2g fits exactly nchans*8. I am not sure why that is the case nor what it would entail for my data if I were
 to change it in the code myself. Could someone enlighten me?</span></p>
<p class="x_MsoNormal"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif; color:#1F497D"> </span></p>
<p class="x_MsoNormal"><b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> fieldtrip <<a href="mailto:fieldtrip-bounces@science.ru.nl">fieldtrip-bounces@science.ru.nl</a>>
<b>On Behalf Of </b>Katarina Bendtz<br>
<b>Sent:</b> Wednesday, 18 November 2020 20:20<br>
<b>To:</b> FieldTrip discussion list <<a href="mailto:fieldtrip@science.ru.nl">fieldtrip@science.ru.nl</a>><br>
<b>Subject:</b> Re: [FieldTrip] Warning OPENEDF: Physical Minimum larger than Maximum\n</span></p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Dear Simeon!</p>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal">Thank you so much for your quick reply! I understand!</p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal">Do you think I can safely ignore this or should I try to find out which channels this applies to? That is, if the trigger channels are set to identical values, will this in some way compromise/change the data?</p>
</div>
<div>
<p class="x_MsoNormal"> </p>
</div>
<div>
<p class="x_MsoNormal">best,</p>
</div>
<div>
<p class="x_MsoNormal">Kat</p>
<div>
<div>
<div>
<p class="x_MsoNormal"><span style="color:black"><br>
<br>
<br>
<b>Katarina Bendtz</b>, PhD<br>
Research Fellow<br>
Kreiman Lab<br>
Boston Children's Hospital<br>
Harvard University<br>
<br>
+1 (617) 390 45 16<br>
3 Blackfan Circle <br>
Boston, USA</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="color:black"> </span></p>
</div>
</div>
<p class="x_MsoNormal" style="margin-bottom:12.0pt"> </p>
</div>
<div>
<p class="x_MsoNormal" style="margin-bottom:12.0pt"> </p>
<blockquote style="margin-top:5.0pt; margin-bottom:5.0pt">
<div>
<p class="x_MsoNormal">On Nov 18, 2020, at 1:22 PM, Simeon Wong <<a href="mailto:simeon.wong@sickkids.ca">simeon.wong@sickkids.ca</a>> wrote:</p>
</div>
<p class="x_MsoNormal"> </p>
<div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif">Hi Katarina,</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif">The fread command advances the file pointer. Therefore the 4 lines are reading consecutive values from the EDF file.</span></p>
</div>
<div>
<p class="x_MsoNormal"><a href="https://urldefense.com/v3/__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__;I34lJSUlJSUlJSU!!D0zGoin7BXfl!r4QJaRIZ-3FdVMHleuLbLlEDUz6WEdLbbNCQa6ENyxDrfsWOU5abThVtTfOyf5ZSROzo$"><span style="font-size:10.0pt; font-family:"Arial",sans-serif">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</span></a><span style="font-size:10.0pt; font-family:"Arial",sans-serif"></span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif">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).</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif">All the best,</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif">Simeon</span></p>
</div>
<div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.0pt; font-family:"Arial",sans-serif"> </span></p>
</div>
<div id="x_Signature">
<div>
<div id="x_divtagdefaultwrapper">
<div>
<div>
<div>
<p class="x_MsoNormal"><span style="font-size:11.5pt; font-family:"Segoe UI",sans-serif; color:#212121"> </span></p>
<table class="x_MsoNormalTable" border="0" cellspacing="0" cellpadding="0" style="border-collapse:collapse">
<tbody>
<tr>
<td width="129" style="width:130.25pt; border:none; border-right:solid windowtext 1.0pt; padding:0cm 5.4pt 0cm 5.4pt">
<p class="x_MsoNormal" align="center" style="text-align:center"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"><Outlook-gb44xqtx.png></span></p>
</td>
<td width="225" style="width:259.6pt; padding:0cm 5.4pt 0cm 5.4pt">
<div style="margin-left:8.1pt">
<p class="x_MsoNormal" style="line-height:13.2pt"><b><span style="font-size:9.0pt; font-family:"Arial",sans-serif">Simeon Wong</span></b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"></span></p>
</div>
<div style="margin-left:8.1pt">
<p class="x_MsoNormal" style="line-height:13.2pt"><span style="font-size:9.0pt; font-family:"Arial",sans-serif">Ibrahim Lab</span><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"></span></p>
</div>
<div style="margin-left:8.1pt">
<p class="x_MsoNormal" style="line-height:13.2pt"><span style="font-size:9.0pt; font-family:"Arial",sans-serif">Neurosciences & Mental Health</span><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"></span></p>
</div>
<div style="margin-left:8.1pt">
<p class="x_MsoNormal" style="line-height:13.2pt"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> </span></p>
</div>
<div style="margin-left:8.1pt">
<p class="x_MsoNormal" style="line-height:13.2pt"><span style="font-size:9.0pt; font-family:"Arial",sans-serif">686 Bay Street, Toronto ON <span class="x_apple-converted-space"> </span>M5G 0A4</span><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"></span></p>
</div>
<div style="margin-left:8.1pt">
<p class="x_MsoNormal" style="line-height:13.2pt"><span style="font-size:9.0pt; font-family:"Arial",sans-serif">P 416.813.7654 <span class="x_apple-converted-space"> </span>x303697</span><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"></span></p>
</div>
</td>
</tr>
</tbody>
</table>
<p class="x_MsoNormal"><span style="font-size:11.5pt; font-family:"Segoe UI",sans-serif; color:#212121"> </span></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="x_MsoNormal" align="center" style="text-align:center">
<hr size="4" width="982" align="center" style="width:368.25pt">
</div>
<div id="x_divRplyFwdMsg">
<p class="x_MsoNormal"><b><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">From:</span></b><span class="x_apple-converted-space"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif"> </span></span><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">fieldtrip
 <</span><a href="mailto:fieldtrip-bounces@science.ru.nl"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">fieldtrip-bounces@science.ru.nl</span></a><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">> on behalf of Katarina Bendtz
 <</span><a href="mailto:katarina.bendtz@gmail.com"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">katarina.bendtz@gmail.com</span></a><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">><br>
<b>Sent:</b><span class="x_apple-converted-space"> </span>November 18, 2020 12:50<br>
<b>To:</b><span class="x_apple-converted-space"> </span></span><a href="mailto:fieldtrip@science.ru.nl"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">fieldtrip@science.ru.nl</span></a><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">
 <</span><a href="mailto:fieldtrip@science.ru.nl"><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">fieldtrip@science.ru.nl</span></a><span style="font-size:11.0pt; font-family:"Calibri",sans-serif">><br>
<b>Subject:</b><span class="x_apple-converted-space"> </span>[FieldTrip] Warning OPENEDF: Physical Minimum larger than Maximum\n</span><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"></span></p>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">Dear experts:</span></p>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">Me and my colleague at another university idependently I get this warning when we try to open an edf file:</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:Consolas; color:#032F62; background:white">Warning OPENEDF: Physical</span></p>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:Consolas; color:#032F62; background:white">Minimum larger than Maximum<span class="x_xpl-cce">\n</span></span><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"></span></p>
</div>
<div>
<p class="x_MsoNormal" style="margin-bottom:12.0pt"><span class="x_xpl-cce"><span style="font-family:Consolas; color:#032F62; background:white"> </span></span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<div>
<div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">I’m using fieldtrip 2020113. Looking at the source code </span></p>
<blockquote style="margin-top:5.0pt; margin-bottom:5.0pt">
<p class="x_MsoNormal"><a href="https://urldefense.com/v3/__https:/github.com/fieldtrip/fieldtrip/blob/master/private/openedf.m__;!!D0zGoin7BXfl!tHOzBhC87IDZICVPmzh1QeJQI1pBz7wzlyRm7uCUqe_WlgHxjVh2sShWYk0yjAhO9UAo$"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">https://github.com/fieldtrip/fieldtrip/blob/master/private/openedf.m</span></a><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"></span></p>
</blockquote>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">I read:</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Segoe UI",sans-serif; color:#24292E; background:white">if (any(EDF.PhysMin >= EDF.PhysMax))</span><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"></span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Segoe UI",sans-serif; color:#24292E; background:white">fprintf(2,'Warning OPENEDF: Physical Minimum larger than Maximum\n');</span><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"></span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Segoe UI",sans-serif; color:#24292E; background:white">EDF.PhysMin = EDF.DigMin;</span><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"></span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Segoe UI",sans-serif; color:#24292E; background:white">        EDF.PhysMax = EDF.DigMax;</span><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"></span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:10.5pt; font-family:"Segoe UI",sans-serif; color:#24292E; background:white">end</span><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"></span></p>
</div>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">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:</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">EDF.PhysMin= str2num(char(fread(EDF.FILE.FID,[8,EDF.NS],'char')'));</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">EDF.PhysMax= str2num(char(fread(EDF.FILE.FID,[8,EDF.NS],'char')'));</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">EDF.DigMin = str2num(char(fread(EDF.FILE.FID,[8,EDF.NS],'char')')); %</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">EDF.DigMax = str2num(char(fread(EDF.FILE.FID,[8,EDF.NS],'char')')); %</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">So it is quite reasonable that I will get this warning. I’m puzzled. </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">1. What’s purpose of this warning?</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">2. Why are the variables set to the same value?</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">3. Can I safely ignore this warning?</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">4. Or is there something I misunderstood.</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">Thanks a lot,</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">Best,</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">Kat</span></p>
</div>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"><br>
<br>
<b>Katarina Bendtz</b>, PhD<br>
Research Fellow<br>
Kreiman Lab<br>
Boston Children's Hospital<br>
Harvard University<br>
<br>
+1 (617) 390 45 16<br>
3 Blackfan Circle <br>
Boston, USA</span></p>
</div>
<div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
</div>
<p class="x_MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
<p class="x_MsoNormal"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"> </span></p>
</div>
</div>
<p class="x_MsoNormal"> </p>
<div class="x_MsoNormal" align="center" style="text-align:center">
<hr size="4" width="100%" align="center">
</div>
<p class="x_MsoNormal"><span style="font-size:7.5pt; font-family:"Arial",sans-serif; color:gray"><br>
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.<br>
</span><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">_______________________________________________<br>
fieldtrip mailing list<br>
</span><a href="https://urldefense.com/v3/__https://mailman.science.ru.nl/mailman/listinfo/fieldtrip__;!!D0zGoin7BXfl!r4QJaRIZ-3FdVMHleuLbLlEDUz6WEdLbbNCQa6ENyxDrfsWOU5abThVtTfOyf5sM8xsl$"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">https://mailman.science.ru.nl/mailman/listinfo/fieldtrip</span></a><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif"><br>
</span><a href="https://urldefense.com/v3/__https://doi.org/10.1371/journal.pcbi.1002202__;!!D0zGoin7BXfl!r4QJaRIZ-3FdVMHleuLbLlEDUz6WEdLbbNCQa6ENyxDrfsWOU5abThVtTfOyfw9x0Kj7$"><span style="font-size:9.0pt; font-family:"Helvetica",sans-serif">https://doi.org/10.1371/journal.pcbi.1002202</span></a></p>
</div>
</blockquote>
</div>
<p class="x_MsoNormal"> </p>
</div>
</div>
</div>
<br>
<hr>
<font face="Arial" color="Gray" size="1"><br>
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.<br>
</font>
</body>
</html>