Skip to main content

A python library for reading and writing AxoGraph data files

Project description

axographio is a library that makes it easy to read and write binary data files in the AxoGraph file format.

AxoGraph X is a commercial software package used for data acquisition and analysis that is widely used in electrophysiological research (see http://axographx.com for more details). While it can read and write files in text format, its binary format is much smaller and faster to load and save; thus many users preferentially use this format. The company distributes the details of the file format along with sample C++ code for reading and writing to these files with AxoGraph X.

Python is a powerful and easy to use general purpose programming language (see http://python.org for more details). There are many useful python libraries available for scientific data analysis and data visualization such as scipy, matplotlib and MayaVI.

This library provides a simple interface for loading AxoGraph data files into a python program or interactive session. If you want to analyze data you recorded in AxoGraph using python based tools, this library provides the glue code you’ll need.

Installation

Preinstallation Requirements

  • A working Python installation

  • The setuptools package

  • The NumPy package

  • The Cython package

Note that NumPy takes a bit of work to build, so it may be easiest to install it from a repository (if you’re using Linux) or install a Python distribution containing it, such as the Enthought Python Distribution. On OS/X 10.5 (and probably other platforms), it looks like you can just use the following:

sudo easy_install numpy sudo easy_install Cython

Installation

Once all the preinstallation requirements have been met, you can download and install axographio using easy_install by typing the following command in a terminal window:

easy_install axographio

Usage

Loading a data file is as easy as calling read:

>>> import axographio
>>>
>>> f = axographio.read("AxoGraph X File.axgx")

At this point the variable f will contain a file_contents object with the column names and data from the file. For example, you could now plot the first two columns using matplotlib:

>>> import matplotlib.pyplot as plt
>>>
>>> plt.plot(f.data[0], f.data[1])
>>> plt.xlabel(f.names[0])
>>> plt.ylabel(f.names[1])
>>> plt.show()

Of course, you probably have grander plans than just plotting the data. The column data supports the standard sequence interfaces (i.e. indexing, iteration, etc.) and can be converted to a scipy or numpy array using the asarray functions in these packages, e.g.:

>>> import scipy as sp
>>>
>>> times = sp.asarray(f.data[0])

Writing files is also relatively easy. You simply create a new file_contents object (or use one you loaded earlier), and then call write. For example, the following code creates a file called “my60Hz.axgd” with two channels with 60 Hz sine waves

>>> import axographio
>>> import numpy as np
>>>
>>> times = np.arange(0,10,0.0001)
>>> column1 = np.sin(2*np.pi * 60 * times)
>>> column2 = np.cos(2*np.pi * 60 * times)
>>> f = axographio.file_contents(
...    ['time (s)', 'my recording (V)', 'your recording (V)'],
...    [times, column1, column2])
>>> f.write("my60Hz.axgd")

Questions and Support

Please post any questions, problems, comments, or suggestions on the axographio group on google groups (http://groups.google.com/group/axographio)

Acknowledgments

This initial version of this project was written in the Chiel Laboratory at Case Western Reserve University, with support from NIH grant NS047073, an Ohio Innovation Incentive Award Fellowship, and the Case Western Reserve MSTP (NIH T32 GM007250). This project builds on a number of other open source projects, including Python, C++ AxoGraph file input/output code from AxoGraph Scientific (placed in the public domain; a modified version is included with the project source code), Cython, and many others.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

axographio-0.1.0.tar.gz (77.1 kB view details)

Uploaded Source

Built Distributions

axographio-0.1.0-py2.6-macosx-10.3-fat.egg (112.2 kB view details)

Uploaded Source

axographio-0.1.0-py2.6-linux-x86_64.egg (132.6 kB view details)

Uploaded Source

File details

Details for the file axographio-0.1.0.tar.gz.

File metadata

  • Download URL: axographio-0.1.0.tar.gz
  • Upload date:
  • Size: 77.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for axographio-0.1.0.tar.gz
Algorithm Hash digest
SHA256 7340a44363822e66b554717e40159fd9dbe172e50de434111968f42988d76ce4
MD5 f64074197cd6c945a6063bc79656cd98
BLAKE2b-256 2816773999722b4a25721f195869d82e10df93eb3b357893208cff073541cfe9

See more details on using hashes here.

File details

Details for the file axographio-0.1.0-py2.6-macosx-10.3-fat.egg.

File metadata

File hashes

Hashes for axographio-0.1.0-py2.6-macosx-10.3-fat.egg
Algorithm Hash digest
SHA256 d9814d2e2237ab6cb9118e30271e8c7f638ab24e88be5c03fcc2fcfad8c3497c
MD5 a8774509c56a8fa7297444a835fc0fc8
BLAKE2b-256 f0d47f9e337bdcbc565257e599f6a412809364bb5aeafe605c795dce92e679b8

See more details on using hashes here.

File details

Details for the file axographio-0.1.0-py2.6-linux-x86_64.egg.

File metadata

File hashes

Hashes for axographio-0.1.0-py2.6-linux-x86_64.egg
Algorithm Hash digest
SHA256 24312be3fd030143e317cbaa1fe52d160f5037da160dc56aa2d25ebbd7320810
MD5 69c12f6504bc40f48c28f5d979ce7069
BLAKE2b-256 b6d24748dd6b6a07cf2b3c121fd291ea14e69737875248c4c85f632d8b917acd

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page