MarcusVollmer / HRV

Methods for analyzing Heart Rate Variability
http://marcusvollmer.github.io/HRV/
MIT License
85 stars 38 forks source link

Importing ACQ file #16

Open mmsarhan opened 2 years ago

mmsarhan commented 2 years ago

Hello, I am trying to input our HRV data into the HRVtool to view and analyze the data. The HRV Dato corresponds to each of the MRI scans we conducted. We save our files in .acq and in .mat files. We measure pulse from a thumb transduce and Heart rate from a belt that goes around their stomach. When I try to import one of our files, I get the image below, and I'm not sure what channel to select.

Screen Shot 2022-04-01 at 4 57 13 PM

I then click No for the next window to generate the annotation from the heart rate and then I choose "Human ECG (fast)" for the waveform.

It keeps loading for a very long time and I never end up seeing my data. Am I setting it up incorrectly?

MarcusVollmer commented 2 years ago

Hello,

As you have recorded a PPG you should try to select and load 'Pulse - PPG100C'. You should then choose ''Human Pulsatile (fast)'. To find out why it takes too much of time, please use the following code to check the recording length and sampling frequency:

matObj = load_acq(Filename);
hdr = struct2table(matObj.hdr.per_chan_data);
[s,v] = listdlg('PromptString', 'Select a channel:', 'SelectionMode', 'single', 'ListString', hdr.comment_text);
sig_waveform = matObj.data(:,s);
length(sig_waveform)
Fs = 1000/matObj.hdr.graph.sample_time
mmsarhan commented 2 years ago

I selected the choices you said to choose and I am waiting for it to load. I also tried running the command you gave me in the command window, and below I have pasted the output it gave me. Im not sure if I inputed it correctly or not.

matObj = load_acq(COCA_physic_30s_baseline_103_V1.acq); hdr = struct2table(matObj.hdr.per_chan_data); [s,v] = listdlg('PromptString', 'Pulse - PPG100C:', 'Human Pulsatile (fast)', 'single', 'ListString', hdr.comment_text); sig_waveform = matObj.data(:,s); lenght(sig_waveform Fs = 1000/matObj.hdr.graph.sample_time Unable to resolve the name COCA_physic_30s_baseline_103_V1.acq.

MarcusVollmer commented 2 years ago

It seems that you are new to Matlab. The filename must be passed in apostrophes: matObj = load_acq('COCA_physic_30s_baseline_103_V1.acq');

If the file is not in your working directory, the please use the full or relative path or set the directory first.

mmsarhan commented 2 years ago

Yes, Im still very newt to Matlab Im sorry. I added the apostrephes, but I think it did not run properly. I inputted the file name correctly, but Im not sure I put in the rest of the command correctly.

load_acq('/Volumes/One Touch/103/V1_physio/COCA_physio_30s_baseline_103_V1.acq'); hdr = struct2table(matObj.hdr.per_chan_data); [s,v] = listdlg('PromptString', 'Pulse - PPG100C:', 'Human Pulsatile (fast)', 'single', 'ListString', hdr.comment_text); sig_waveform = matObj.data(:,s); lenght(sig_waveform Fs = 1000/matObj.hdr.graph.sample_time Loading /Volumes/One Touch/103/V1_physio/COCA_physio_30s_baseline_103_V1.acq Done! Unable to resolve the name matObj.hdr.per_chan_data.

MarcusVollmer commented 2 years ago

You forgot to save the resulting data in the data object matObj: matObj = load_acq('/Volumes/One Touch/103/V1_physio/COCA_physio_30s_baseline_103_V1.acq');

mmsarhan commented 2 years ago

I was able to run it and load the file but I am not sure the command ran completely. Im very sorry. Im still trying to understand all of this and not sure what is wrong with my command. matObj = load_acq('/Volumes/One Touch/103/V1_physio/COCA_physio_30s_baseline_103_V1.acq'); hdr = struct2table(matObj.hdr.per_chan_data); [s,v] = listdlg('PromptString', 'Pulse - PPG100C:', 'Human Pulsatile (fast)', 'single', 'ListString', hdr.comment_text); sig_waveform = matObj.data(:,s); lenght(sig_waveform) Fs = 1000/matObj.hdr.graph.sample_time Loading /Volumes/One Touch/103/V1_physio/COCA_physio_30s_baseline_103_V1.acq Done! Error using listdlg (line 108) Unknown parameter name passed to LISTDLG. Name was Human Pulsatile (fast)

MarcusVollmer commented 2 years ago

Please do not change the code after loading the object with load_acq:

Path2File = '/Volumes/One Touch/103/V1_physio/COCA_physio_30s_baseline_103_V1.acq';
matObj = load_acq(Path2File);
hdr = struct2table(matObj.hdr.per_chan_data);
[s,v] = listdlg('PromptString', 'Select a channel:', 'SelectionMode', 'single', 'ListString', hdr.comment_text);
sig_waveform = matObj.data(:,s);
length(sig_waveform)
Fs = 1000/matObj.hdr.graph.sample_time

listdlg will open a dialog window to select the signal for further processing. The corresponding waveform will be extracted from the data object and the recording length and sampling frequency will be printed.