Hi,
I am new to pspm and I have some questions.
I am working with ECG data that I imported in pspm as matlab files.
I have one channel with the ecg data and one channel with markers (a vector of all 0 and 10 or 20 as markers).
When I plot my data with pspm I can easily see my markers but when I look inside the imported data or I use the "extract event marker info ", the cell "markerinfo.value" is zero for both markers (but the timestamps are correct). What is wrong?
Moreover, is it possible to trim data in other ways from the one listed (from start of the file, from marker), for example from the end of the recording instead of the start?
Thank you
Claudia
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Yes of course!
I am sure I put something wrong but I am new to this toolbox and I cannot find what is the problem.
My original files where in .Poly5 format so I readjusted them in single .mat files per subject.
Attached you can find one of this .mat files. The first column contained ECG data, the second one is timepoints and the third one is the marker channel.
Hi Claudia
To the first error: I think there occurs an error while the import. I used your pre-import data and saw that the markerinfo is set to the wrong values. I fixed the error on the SVN version. You can just download it from sourceforge and check if it works now for all your subjects.
To the question about the trim possibilities: There are only these ways listed to trim the data. At the moment I'm working at a functionality such that you can chose to trim from the first marker having a value xxx to the first marker having a value yyy, but your suggested way is not possible yet.
Best,
Laure
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You have to download the new version of pspm_get_events.m (the script which contained the bug) and update this file in your folder. You can find the new version on sourceforge by clicking on "Code" -> "trunk" and look in this folder for a file called "pspm_get_events.m". By clicking on this file, you will get you to a page, where you can download this specific file.
I hope this helps a little.
Laure
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I actually have also another problem. I am used to spm and I usually set up a batch from the GUI and then I change all the field I need to change for every participants in a loop. I don't know whether this is possible with pspm too.
Even if the batch is filled correctly, I always get this error:
No executable modules, but still unresolved dependencies or incomplete module inputs.
The following modules did not run:
Skipped: Import
If the problem can be fixed without modifying the job, the computation can be resumed by running
cfg_util('cont',1)
from the MATLAB command line.
Error using MATLABbatch system
Job execution failed. The full log of this run can be found in MATLAB command window, starting with the lines (look for the line
showing the exact #job as displayed in this error message)
I tried also like this:
filename = 'X:\Clau\State-dependet_opioid_modulation\ANALYZED\ANALYZED_HR_prova\HR_finaldata\data_ID_1_2.mat';
fs = 1024
to troubleshoot the matlabbatch problem: can you save the variable matlabbatch in mat file, and try to open it in the matlabbatch GUI? Ideally this will show up that/where something is missing, or if it is a code bug.
Best
Dominik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am new to pspm and I have some questions.
I am working with ECG data that I imported in pspm as matlab files.
I have one channel with the ecg data and one channel with markers (a vector of all 0 and 10 or 20 as markers).
When I plot my data with pspm I can easily see my markers but when I look inside the imported data or I use the "extract event marker info ", the cell "markerinfo.value" is zero for both markers (but the timestamps are correct). What is wrong?
Moreover, is it possible to trim data in other ways from the one listed (from start of the file, from marker), for example from the end of the recording instead of the start?
Thank you
Claudia
Hi Claudia
thanks for posting. I'll look into it. Perhaps you could send a sample pre-import file?
Dominik
Yes of course!
I am sure I put something wrong but I am new to this toolbox and I cannot find what is the problem.
My original files where in .Poly5 format so I readjusted them in single .mat files per subject.
Attached you can find one of this .mat files. The first column contained ECG data, the second one is timepoints and the third one is the marker channel.
Thank you for the help!
Claudia
Last edit: Claudia Massaccesi 2018-11-09
Hi Claudia
To the first error: I think there occurs an error while the import. I used your pre-import data and saw that the markerinfo is set to the wrong values. I fixed the error on the SVN version. You can just download it from sourceforge and check if it works now for all your subjects.
To the question about the trim possibilities: There are only these ways listed to trim the data. At the moment I'm working at a functionality such that you can chose to trim from the first marker having a value xxx to the first marker having a value yyy, but your suggested way is not possible yet.
Best,
Laure
Dear Laure,
thank you for your reply, but I did not get what I have to download to see if it is working with my participants :D
Sorry!
Claudia
Dear Claudia
You have to download the new version of pspm_get_events.m (the script which contained the bug) and update this file in your folder. You can find the new version on sourceforge by clicking on "Code" -> "trunk" and look in this folder for a file called "pspm_get_events.m". By clicking on this file, you will get you to a page, where you can download this specific file.
I hope this helps a little.
UPDATE: I solved this issue like this:
(I guess it is not possible to do it with matlabbatch from the command line..)
filename = [Sourcedir,'data_ID_', num2str(sub), '_', num2str(n_rec), '.mat'];
options = struct('overwrite', false);
import = {struct('type', 'ecg', 'channel', 1, 'sr', 1024),...
struct('type', 'custom', 'channel', 2, 'sr', 1024),...
struct('type', 'marker', 'channel', 3, 'sr', 1024)};
imported_file = pspm_import(filename, 'mat', import, options);
I actually have also another problem. I am used to spm and I usually set up a batch from the GUI and then I change all the field I need to change for every participants in a loop. I don't know whether this is possible with pspm too.
This is my script to import data:
clear all;
% Add pspm path
pspm_path = 'C:\toolbox\';
addpath ( pspm_path );
%% IMPORT AS PSPM.MAT
Sourcedir_batches = 'X:\Clau\State-dependet_opioid_modulation\ANALYZED\ANALYZED_HR_prova\HR_finaldata\batch\';
Sourcedir = 'X:\Clau\State-dependet_opioid_modulation\ANALYZED\ANALYZED_HR_prova\HR_finaldata\';
subjects = 1:45;
rec = 1:6;
for i = 1:length(subjects)
sub = subjects(i);
for n = 1:length(rec)
n_rec = rec(n);
end
Even if the batch is filled correctly, I always get this error:
No executable modules, but still unresolved dependencies or incomplete module inputs.
The following modules did not run:
Skipped: Import
If the problem can be fixed without modifying the job, the computation can be resumed by running
cfg_util('cont',1)
from the MATLAB command line.
Error using MATLABbatch system
Job execution failed. The full log of this run can be found in MATLAB command window, starting with the lines (look for the line
showing the exact #job as displayed in this error message)
I tried also like this:
filename = 'X:\Clau\State-dependet_opioid_modulation\ANALYZED\ANALYZED_HR_prova\HR_finaldata\data_ID_1_2.mat';
fs = 1024
mat.datafile = filename;
mat.importtype{1}.ecg.chan_nr.chan_nr_spec = 1;
mat.importtype{1}.ecg.sample_rate = fs;
mat.importtype{2}.custom.chan_nr.chan_nr_spec = 2;
mat.importtype{2}.custom.sample_rate = fs;
mat.importtype{3}.marker.chan_nr.chan_nr_spec = 3;
mat.importtype{3}.marker.sample_rate = fs;
matlabbatch{1}.pspm{1}.prep{1}.import.datatype.mat = mat;
matlabbatch{1}.pspm{1}.prep{1}.import.overwrite = false ;
% run batch
pspm_jobman('initcfg');
pspm_jobman('run', matlabbatch );
But I got exaclty the same error...
Sorry for the long post.
Thank you again
Claudia
Last edit: Claudia Massaccesi 2018-11-12
Hi Claudia
to troubleshoot the matlabbatch problem: can you save the variable matlabbatch in mat file, and try to open it in the matlabbatch GUI? Ideally this will show up that/where something is missing, or if it is a code bug.
Best
Dominik
Thank you a lot I will definitely do it!
Best,
Claudia