Skip to content
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

allow _ to separate signal and sensor spec in labels #71

Closed
wants to merge 3 commits into from

Conversation

kleinschmidt
Copy link
Member

This is one possible fix to #70 . I'm honestly not sure if this is a good idea or not; on the one hand, it does allow us to handle things like "EEG_C3-A2", but on the other hand, the EDF+ spec is fairly clear that the signal/sensor separator should be a single space. HOWEVER, we allow all kinds of other crap in there besides just a single space so I'm not too bothered by deviating from that slightly.

The alternative would be to require users pre-process the label field into something spec-compliant enough to be matched with OndaEDF.match_edf_label.

ararslan
ararslan previously approved these changes Apr 19, 2023
@ararslan ararslan dismissed their stale review April 19, 2023 15:28

Oh wait, CI is failing and looks related?

@kleinschmidt
Copy link
Member Author

WTH I did not touch anything related to export??

@ararslan
Copy link
Member

Looks like a round-tripping issue perhaps

@kleinschmidt
Copy link
Member Author

ah yeah, it's because the generated names for some of the signals have _ in them which messes up the new regex (since the signal type capture group needs to use lazy matching):

julia> [e.header.label for e in exported_edf.signals if !(e isa EDF.AnnotationsSignal)]
25-element Vector{String}:
 "EEG F3-M2"
 "EEG F4-M1"
 "EEG C3-M2"
 "EEG O1-M2"
 "EEG C4-M1"
 "EEG O2-A1"
 "EEG FPZ-Ref"
 "EOG LEFT"
 "EOG RIGHT"
 "ECG AVR"
 "ECG AVL"
 "EMG LEFT_ANTERIOR_TIBIALIS"
 "EMG RIGHT_ANTERIOR_TIBIALIS"
 "EMG INTERCOSTAL"
 "HEART_RATE HEART_RATE"
 "TIDAL_VOLUME TIDAL_VOLUME"
 "RESPIRATORY_EFFORT CHEST"
 "RESPIRATORY_EFFORT ABDOMEN"
 "SNORE SNORE"
 "POSITIVE_AIRWAY_PRESSURE IPAP"
 "POSITIVE_AIRWAY_PRESSURE EPAP"
 "PAP_DEVICE_LEAK PAP_DEVICE_LEAK"
 "PAP_DEVICE_CFLOW PAP_DEVICE_CFLOW"
 "SAO2 SAO2"
 "PTAF PTAF"

@kleinschmidt
Copy link
Member Author

I'm gonna close this, I don't think this is a solvable issue without a much deeper dive than I have the bandwidth for at the moment...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants