-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error in Physical maximum and minimum values for EDF in writeeeg #246
Comments
Would you mind providing an example demonstrating the problem? We will look into it. |
Would you mind sharing the file you are trying to export. It is unclear what the spreadsheet represents. @alois.schloegl@gmail.com what do you think? |
Hey! Here's the drive link to the file: |
As a workaround, use the tool "Unify resolution", it's in the Tools menu of EDFbrowser. https://www.teuniz.net/edfbrowser/EDFbrowser%20manual.html#Unify_resolution |
@amisepa you are the EDF expert. Would you mind checking if we can close this report? |
Sorry, I don't know much on this. @Teuniz In what situation is the physical value not homogenous? Impedance during recording? Glitchy electrode? Can you share how you unify the resolution in EDFBrowser so we could add a similar feature in EEGLAB? |
It appears that the writeeeg function uses the actual peak values found in the signal's samples for pys max and phys min. |
@Teuniz Thank you very much for pointing it out. @arnodelorme I'll let you decide whether you make this adjustment in writeeeg. |
This is a reasonable assumption, @cll008 would you mind looking at it. Also, test files https://github.com/amisepa/import_EDF |
fix sccn#246 by unifying resolution across channels Potential issue if one channel is EXG or AUX and range is very different from the rest of the data (e.g. EEG)
Thanks for reporting the problem @SparshJ and your input, @Teuniz and @amisepa |
Is the ADC range somewhere in the metadata? Looks like Excerpt from EDF FAQ
|
EXG and AUX channels usually have different scales/ranges compared to EEG channels. |
@arnodelorme we can store PhysMax and PhysMin in EEG.etc 33c425c and pass this as an argument to pop_writeeeg and as an option to writeeeg. Thoughts? |
Funny, I think I just run into this problem randomly trying to export some preprocessed data as .bdf or .edf: I think we should hardcode the physMax and PhysMin to the values suggested by Teuniz above (e.g.,, +3200 uV and -3200 uV). That is when the info is not available in the original EDF file header as suggested. |
|
[-32768 32768] is already implemented as digital min/max. I tested [-3200 3200] physical min max as suggested, and found that while EEG channels are okay (0.02% difference from import>export>reimport due to rounding error), ECG channel in test dataset was different by up to 50%. This is because the test file had physical range of [-5353 5353] and the ECG signal was bottomed out to begin with. @arnodelorme we can either make the physical range larger, we implement storing the header info somewhere. |
@cll008 I still get this error when importing a .bdf file with biosig toolbox, and try to export it as .bdf Looks like the physical min/max is not allocated to each channel maybe? There might be solutions to this issues in the conversation shared by Teuniz above. e.g.: Hope this helps |
Thanks for the input and the summary from the other thread Cedric. The PhysMax and Min are in, but I'm going to check the rest of your test files to see if +-5353 is a more common range than +-3200. PhysDimCode seems to code for the unit, I guess |
Just to clarify: Is it possible to define PhysMax/Min for each channel in writeeg or pop_writeeg? Or do you need to expand dataduration to do that? |
Yes currently in |
Turns out the test files have inconsistent |
Sounds good. FYI: I don't know how these files were recorded and with what system, so I don't know if we should base this decision on them (although helpful). Maybe you can double-check with some more standard files (e.g., biosemi file attached) Cedric |
Hey!
While using the writeeeg function on a data matrix ( channels X samples), the resultant EDF shows different physical maximum and minimum values for different channels even though no such info is passed to writeeeg. This error occurs only for some subjects, whereas for other subjects the physical maximum and minimum values are identical across the channels. Please help!
Thanks!!
The text was updated successfully, but these errors were encountered: