Package Exports
- nifti-reader-js
- nifti-reader-js/src/nifti
- nifti-reader-js/src/nifti.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nifti-reader-js) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
NIFTI-Reader-JS
A JavaScript NIfTI file format reader. This reader supports both NIfTI-1 and NIfT1-2 file formats, both compressed (.nii.gz) and uncompressed (.nii).
Usage
API, drawing to canvas example and more
var data = // an ArrayBuffer
var niftiHeader = null,
niftiImage = null,
niftiExt = null;
if (nifti.isCompressed(data)) {
data = nifti.decompress(data);
}
if (nifti.isNIFTI(data)) {
niftiHeader = nifti.readHeader(data);
console.log(niftiHeader.toFormattedString());
niftiImage = nifti.readImage(niftiHeader, data);
if (nifti.hasExtension(niftiHeader)) {
niftiExt = nifti.readExtensionData(niftiHeader, data);
}
}Install
Get a packaged source file:
Or install via NPM:
npm install nifti-reader-jsOr install via Bower:
bower install nifti-reader-jsTesting
npm testBuilding
See the release folder for the latest builds or build it yourself using:
npm run buildThis will output nifti-reader.js and nifti-reader-min.js to build/.
Acknowledgments
NIFTI-Reader-JS makes use of the following third-party libraries:
- fflate — for GZIP inflating