amisepa / BrainBeats

The BrainBeats toolbox, implemented as an EEGLAB plugin, allows joint processing and analysis of EEG and cardiovascular signals (ECG/PPG).
GNU General Public License v3.0
6 stars 4 forks source link

hrv_features not saved in history when you select it in the GUI #18

Closed arnodelorme closed 8 months ago

amisepa commented 1 year ago

History meaning eegh? Or the actual outputs? I had seen them exported properly in the Features output.

arnodelorme commented 1 year ago

Yes, eegh

On Aug 1, 2023, at 6:48 AM, Cedric Cannard @.***> wrote:

History meaning eegh? Or the actual outputs? I had seen them exported properly in the Features output.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

amanda-mccleery commented 1 year ago

Hi @arnodelorme @amisepa,
I am testing out the BrainBeats toolbox and I have a question - where do I find the HRV features output? Also, I receive the following error message: "EEGLAB error in function plot_features() at line 91: Unrecognized function or variable 'EEG' If you think this is a bug..." when I run the HRV analysis using process file (subject level). I'm guessing this pops up b/c I didn't select 'EEG features' on the menu, so it's not going to populate the EEG figures.

For the HRV features analysis - Figures 2 (filtered ECG signal + R peaks, RR intervals, and R events over time) & 3 (PSD HRV, MFE HRV, and a blank plot) are generated, but I don't see output for the HRV feature indices saved anywhere (e.g., a text file with SDNN, etc.).

Thanks in advance for your assistance and please let me know if you need additional information to help me resolve the EEGLAB error message (if it needs to be resolved) and to locate the output file.

amanda-mccleery commented 1 year ago

Fig 2 Fig 3

amisepa commented 1 year ago

Hi,

Did you install BrainBeats from the GitHub repo (unzip or cloning) or from the eeglab extension manager? If form GitHub, HRV features are stored in the 'EEG.features' structure (eeglab structure) of your file. Otherwise they are also saved in a Matlab structure in the same place as your file you loaded in eeglab. So if you go in the folder where you loaded your file, you should see a Matlab file called Features.mat (and make sure the save option is selected in parameters).

The 'EEG' error might be a bug yes when you don't select EEG features. And the blank area is for the EEG plots so that's why they're blank. I need to update the code adjust the figure for this situation. You may select EEG time features to avoid the error for now, and it's very fast to compute so it won't add time.

Cedric

amanda-mccleery commented 1 year ago

Hi, I added BrainBeats through the EEGlab extension manager. I see the features.mat file, but when I try to load the file in matlab nothing happens. How do you view the output from the features.mat file (e.g., import into in EEGlab, export to a text file, etc.)?

amanda-mccleery commented 1 year ago

Nevermind - I think I've got it! Thanks so much for your help - I will keep playing with the toolbox and will let you know if I have any questions or encounter error messages

amisepa commented 1 year ago

Ok. They're stored in the structures by domain: time, frequency, nonlinear. You can plot the same plots with plot_features(Features);

You can easily export as a csv file like this for example for SDNN writetable(struct2table(Features.time.SDNN),'SDNN.csv');

amanda-mccleery commented 1 year ago

Excellent - thanks so much!

amisepa commented 1 year ago

And you should use the more recent version from GitHub, some issues were fixed

amanda-mccleery commented 1 year ago

Will do re: Github version

amanda-mccleery commented 1 year ago

Hi @amisepa I installed BrainBeats from Github and encountered this error message:

image

amisepa commented 1 year ago

Ah sorry.. that is a from a recent merge and I didn't have time to test. I'll try to fix it in the next few days.

amanda-mccleery commented 1 year ago

No worries and thank you!