Code covered by the BSD License  

Highlights from
Load BIOPAC ACQ (AcqKnowledge for PC) data

4.625

4.6 | 8 ratings Rate this file 38 Downloads (last 30 days) File Size: 221 KB File ID: #14562

Load BIOPAC ACQ (AcqKnowledge for PC) data

by

 

09 Apr 2007 (Updated )

Load BIOPAC's *.acq file (AcqKnowledge for Windows data format).

| Watch this File

File Information
Description

"load_acq.m" will load BIOPAC's AcqKnowledge (ACQ) data to a structure containing ACQ header field and data matrix field.

It is based on Application Note #156 from BIOPAC web site (see attachment). The note mentioned that: "This document describes file formatting for all Windows versions of AcqKnowledge 3.9.x or below". Thanks to the open Python source code provided by Nathan Vack, this program can also read AcqKnowledge 4.0 & 4.1 data (with no documentation from BIOPAC). Compressed data is not supported by this program.

Usage: acq = load_acq(filename, [force_chan_by_chan_load])

acq - AcqKnowledge file structure containing ACQ header field, and data matrix.

filename - BIOPAC's AcqKnowledge file

force_chan_by_chan_load is an optional argument. By default, this optional flag will be set to 1, which means that when you use acq = load_acq(fname), the data will be loaded one channel after the other. This can avoid memory crash when you load very large ACQ data. If your ACQ data is not huge, I suggest that you set this optional flag to 0, i.e. acq = load_acq(fname, 0). In this case, the program will read data depending on the data type. If the program detects that the data type in ACQ file are different from channel to channel, it will still read data channel by channel. Otherwise, it will read whole data in one block (a lot faster than using traditional way from channel to channel with the same result).

A script called "acq2mat.m" is provided to help you convert all .acq files to .mat files in all specified folders in advance, since to load corresponding .mat files will be much quicker. i.e. In your MATLAB code, instead of using: acq = load_acq('MyGSR.acq'); you can now use: load('MyGSR.mat');

Acknowledgements

This file inspired Acqread.

MATLAB release MATLAB 5.3.1 (R11.1)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (17)
20 Jun 2012 Peter

In acq2mat.m flip the if statement to save lots of space and time

if str2num(v7(1))<7
save(mat_fn, '-V6', 'acq');
else
save(mat_fn, 'acq');
end

23 Feb 2011 Jimmy Shen

Thijs, thanks to the open Python source code provided by Nathan Vack, this program can now load both ACQ4.0 and ACQ4.1. However, there is no documentation about ACQ 4 data format from BIOPAC.

17 Feb 2011 Thijs Schrama

An Biopac ACQ4.0 version would be highly appriciated. Works great allready for 3.9.1, thanks!

15 Feb 2011 Oscar

Hi Nathan

Thanks for sharing the Python code.
i had to spend hours setting up python and its packages, and it was worth the effort!!! your code works excellent for AcqKnowledge 4.1.

14 Feb 2011 Jimmy Shen

The latest release of file format by BIOPAC is up to AcqKnowledge 3.9:
http://www.biopac.com/ResearchNotes.asp?Aid=&ANid=82&Level=4
According to BIOPAC's AcqKnowledge 4 Software Guide:
http://www.biopac.com/file.asp?ManualID=56
It is now also able to save data into MAT-file binary format.

13 Feb 2011 Anthi

hi Damien...
i am having the same problems with AcqKwoledge 4.1.Did you found a solution???

09 Dec 2010 Damien

hi Jimmy,

thanx a lot. There were problems with the version... I saved my file with 4.1, so the header was different...
Unfortunately BIOPAC does not support informations about 4.1 file format...

07 Dec 2010 Nathan Vack

FYI, I've written a package in Python that'll do the .ACQ -> .MAT conversion. As far as I know, it'll handle any .ACQ file out there, including compressed files and very new ones.

It's available here:

https://github.com/njvack/bioread

It'll also let you work with the files in Python, of course -- but this is a Matlab site ;-)

22 Nov 2010 Jimmy Shen

There are 4 places that are using 'dec2hex' command. They are: dec2hex(hdr.color_major_grid), dec2hex(hdr.color_minor_grid), dec2hex(hdr.rgb_color), dec2hex(hdr.active_seg_color).

Those values in ACQ file header are not supposed to be negative.

Since none of those values will affect the channel data, you can replace them with ' ' if you believe your ACQ data have no other problem.

22 Nov 2010 Damien

hi,
I've tried to use it, but it returned:
Error using ==> dec2hex
First argument must contain non-negative integers.
can u help me, please?
thanks a lot

14 Apr 2010 Jimmy Shen

Hi Dino:

Theoretically, the changes that you suggested will increase the speed. However, it doesn't seem to speed up, after I tried several datasets.

Anyway, thank you very much for the feedback, and I will make the change in the next version.

Jimmy

06 Apr 2010 Dino Dvorak

Great tool. Thank you.

Couple of things to fix:

line 375, add this: data = zeros(min_len, hdr.graph.num_channels);
line 409, change
data(:,i) = tmp(1:min_len);
to
data(1:min_len, i) = tmp(1:min_len);

02 May 2008 Alpesh Patel  
01 May 2008 Antonio Molins

Did not work for me as provided, but worked with significant changes: halted before getting to the foreign data section (missed it by 2 bytes), and did not read markers and positions. A new version has been offered to the author, and is available on request.

08 Nov 2007 Wojtek Grabski

Works.

10 Oct 2007 boris fain

Thank you, works great.

28 Jul 2007 Aida Jimenez-Gonzalez  
Updates
13 Apr 2007

Added rgb_color interpretation, and modified description.

23 Apr 2007

Added "force_chan_by_chan_load" option and set it to 1 by default to prevent out of memory problem when loading huge ACQ data

07 May 2007

Thanks to the bug report from Stefan Schumann in University of Freiburg, now my load_acq supports new versions of data with different sample dividers.

22 May 2007

Thanks to Aida Jimenez in University of Southampton, I fixed a bug when reading AcqKnowledge version 3.5 and earlier.

01 Aug 2007

Modify on 31-JUL-2007 by Julio Cruz (julio.cruz@juliocruz.info) to make the program also work on MAC OS.

02 May 2008

Thanks Antonio Molins (amolins@mit.edu) for the changes he made (all comments started with "AM").

02 May 2008

don't know why zip file on fileexchange is still old. upload the new one again.

10 Jun 2008

Found '&&' in last update, which cannot run under Matlab5. It has been fixed in 'load_acq_20080609.zip'.

09 Jun 2009

Fixed a bug when you use it with Matlab 6.5 and earlier.

11 Mar 2010

Fixed a bug in acq2mat.m script.

22 Feb 2011

Thanks to the open Python source code provided by Nathan Vack, this program can also read AcqKnowledge 4.0 & 4.1 data (with no documentation from BIOPAC).

Contact us