0.6.0 • Published 1 year ago

biologic-converter v0.6.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

biologic-converter

NPM version build status Test coverage npm download

Convert BioLogic file format.

There are 3 possible extensions:

  • .mpr : Raw binary file containing the data
  • .mpt : .mpr into Text file
  • .mps : experiment Settings text file.

Other files: sometimes the data may be in a .txt file. This is very rare but if this is the case, report it and we will add support for these. Other files created by the software are ignored by the parser.

Installation

npm i biologic-converter

Usage

import { readFileSync as rfs } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'node:path';

// import the parser you need
import { parseMPR, /*parseMPT, parseMPS*/ } from 'biologic-converter';

// build the path
const __dirname = dirname(fileURLToPath(import.meta.url))
// get buffer
const mpr = rfs(join(__dirname, 'testDirectory/ca/ca.mpr'));
const result = parseMPR(mpr); //JSON-like object
console.log(result)
{
  name: 'BIO-LOGIC MODULAR FILE',
  settings: {
    header: {
      shortName: 'VMP Set',
      longName: 'VMP settings',
      length: 6691,
      version: 0,
      date: '04/29/19'
    },
    variables: {
      technique: 'CA',
      comments: '',
      activeMaterialMass: 0.875,
      atX: 0,
      molecularWeight: 0.0010000000474974513,
      atomicWeight: 0.0010000000474974513,
      //...
      params: [Object]
    }
  },
  data: {
    header: {
      shortName: 'VMP data',
      longName: 'VMP data',
      length: 55923,
      version: 3,
      date: '04/29/19'
    },
    variables: {
      z: [Object],
      y: [Object],
      x: [Object],
      w: [Object],
      //...
    }
  },
  log: {
    header: {
      shortName: 'VMP LOG',
      longName: 'VMP LOG',
      length: 7742,
      version: 0,
      date: '05/01/19'
    },
    variables: {
      runOnChannel: [Object],
      eweControlRange: [Object],
      oleTimestamp: 43584.65494212963,
      //...
    }
  }
}

License

MIT

Test files from https://github.com/dgbowl/yadg

0.3.0

2 years ago

0.2.0

2 years ago

0.5.0

1 year ago

0.3.2

2 years ago

0.4.0

2 years ago

0.3.1

2 years ago

0.6.0

1 year ago

0.3.3

2 years ago

0.1.0

2 years ago

0.0.1

2 years ago