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.
npm i biologic-converter
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)
**Sample output**
{
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,
//...
}
}
}
Test files from https://github.com/dgbowl/yadg