I am hoping to use your great-looking toolbox to analyse my SCR data.
Unfortunately, I seem to be stuck at importing the data from the .acq format. I have traced the problem to line 69 in acqread.m:
info.lVersion = fread(fid,1,'int32'); % File version identifier
In my case it returns large number (2030043136) and so subsequently the error few lines below gets called:
if (info.lVersion<30) || (info.lVersion>45)
error (['Unable to read file "',filename,'" : invalid file type, or unsupported file version.'])
end
I also used alternative function (found here: https://uk.mathworks.com/matlabcentral/fileexchange/14562-load-biopac-acq--acqknowledge-for-pc--data) and they attempt to read the file in the same way, see 'load_acq.m'.
The difference is that if the number is too large they attempt to change the endian in fopen by changing the third input to 'b' (fopen(fid, 'r', 'b')). This returns a more reasonable value of 121 which they accept (accepted values there are 0 to 150).
As you already pointed out, the import function for .acq files in PsPM only supports file versions up to 3.9. For newer file versions we encourage you to convert the .acq files to .mat files using bioread (available here https://github.com/njvack/bioread or over pip) and then import them with the implemented PsPM import function ("bioread-converted Biopac Acqknowledge" / acq_bioread).
As the load_acq.m does not support as many file versions as bioread does, we decided not to implement load_acq.m in PsPM.
Best
Tobias
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
I am hoping to use your great-looking toolbox to analyse my SCR data.
Unfortunately, I seem to be stuck at importing the data from the .acq format. I have traced the problem to line 69 in acqread.m:
info.lVersion = fread(fid,1,'int32'); % File version identifier
In my case it returns large number (2030043136) and so subsequently the error few lines below gets called:
if (info.lVersion<30) || (info.lVersion>45)
error (['Unable to read file "',filename,'" : invalid file type, or unsupported file version.'])
end
I also used alternative function (found here: https://uk.mathworks.com/matlabcentral/fileexchange/14562-load-biopac-acq--acqknowledge-for-pc--data) and they attempt to read the file in the same way, see 'load_acq.m'.
The difference is that if the number is too large they attempt to change the endian in fopen by changing the third input to 'b' (fopen(fid, 'r', 'b')). This returns a more reasonable value of 121 which they accept (accepted values there are 0 to 150).
I wonder if this is related to the fact that the file format specified here https://www.biopac.com/wp-content/uploads/app156.pdf, which PsPM references, has been updated. All more recent links lead to this site: https://www.biopac.com/product/api-biopac-file-formats/?attribute_pa_size=api-for-biopac-file-formats.
The data were acquired using AcqKnowledge 4.3.
I am readig them on Matlab 2017b, Linux Mint 17.
I should be able to work around that since I can read the data using the above mentioned function but I thought I should give you the feedback.
Best,
Ondrej
Hi Ondrej
Thank you for the report.
As you already pointed out, the import function for .acq files in PsPM only supports file versions up to 3.9. For newer file versions we encourage you to convert the .acq files to .mat files using bioread (available here https://github.com/njvack/bioread or over pip) and then import them with the implemented PsPM import function ("bioread-converted Biopac Acqknowledge" / acq_bioread).
As the load_acq.m does not support as many file versions as bioread does, we decided not to implement load_acq.m in PsPM.
Best
Tobias