npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

nifti-js

v1.0.1

Published

NIfTI support for Javascript

Downloads

4,049

Readme

NIfTI support for Javascript

This can parse files in the Neuroimaging Informatics Technology Initiative format (version 1). Currently, data (as opposed to the header) can only be read from ".nii" files (files that include both the header and the data in one file), you can still read the header from a header-only file though.

build status

Note that the output is compatible with what is output by nrrd-js. The main area where this breaks down (so far) is encoding orientation information. The NIfTI file format allows for two different transformations in one file (with various options for specifying the transformations). In contrast, the NRRD format only supports a very simple scheme whereby the "data axes" can be mapped to basis vectors in the physical space (in addition to another scheme more or less corresponding to "method 1" in the NIfTI format). Currently, nifti-js simply discards one type of transformation (the sform transformation).

Also note that for now quite a lot of what is read from the NIfTI file is discarded. The idea is that eventually most of what is now discarded should be mapped to NRRD attributes as much as possible, with the rest mapping to key/value pairs (for example).

Example

To use with ndarray, proceed as follows:

var file = nifti.parse(...);
var array = ndarray(file.data, file.sizes.slice().reverse());

Install

Install using npm:

npm install nifti-js

API

require("nifti-js").parse(buffer)

Parses header and data from buffer, returning an object with NRRD-compatible properties. Expects an ArrayBuffer or Buffer object.

require("nifti-js").parseHeader(buffer)

Parses just the header from buffer, returning an object with NRRD-compatible properties. Expects an ArrayBuffer or Buffer object.

require("nifti-js").parseNIfTIHeader(buffer)

Parses just the header from buffer, returning an object with the raw NIfTI information. Expects an ArrayBuffer or Buffer object.

License

(c) 2015 Jasper van de Gronde. MIT License