Socket
Socket
Sign inDemoInstall

nifti-reader-js

Package Overview
Dependencies
1
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    nifti-reader-js

A JavaScript NIfTI file format reader.


Version published
Weekly downloads
3.1K
decreased by-15.25%
Maintainers
2
Created
Weekly downloads
 

Readme

Source

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

Using in a HTML script tag to emulate older behaviour prior to the esbuild changes in v0.6.4:

<script type="module">
    import * as nifti from './nifti-reader.js';
    window.nifti = nifti.default;
    console.log(nifti);
</script>
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-js

Or install via Bower:

bower install nifti-reader-js

Testing

npm test

Building

See the release folder for the latest builds or build it yourself using:

npm run build

This will output nifti-reader.js and nifti-reader-min.js to build/.

Acknowledgments

NIFTI-Reader-JS makes use of the following third-party libraries:

Keywords

FAQs

Last updated on 16 Nov 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc