JuliaIO/NIfTI.jl

Name: NIfTI.jl

Owner: JuliaIO

Description: Julia module for reading/writing NIfTI MRI files

Created: 2013-01-20 23:17:51.0

Updated: 2017-10-30 12:27:27.0

Pushed: 2017-10-30 09:55:09.0

Homepage:

Size: 1085

Language: Julia

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

NIfTI.jl

Build Status

Usage

To read a NIfTI file:

g NIfTI
 niread("my.nii")
 niread("my.nii.gz") # gzipped NIfTI files are detected automatically

The header is in nii.header; NIfTI extensions are in nii.extensions; the raw volume is in nii.raw.

To mmap the NIfTI file:

 niread("my.nii", mmap=true)

To get the TR and voxel size:

e = voxel_size(ni.header)    # In mm
 time_step(ni.header)        # In ms

To get the value of the volume along a given dimension:

vox(ni, x, y, z, t)       # Scaled by slope and intercept given in header, zero-based indexes
ni[x, y, z, t]            # Scaled by slope and intercept given in header, one-based indexes
ni.raw[x, y, z, t]        # Unscaled, one-based indexes

Colons works everywhere, even with vox

To write a volume:

ite("my.nii", ni)

It is also possible to construct a new volume from scratch; see the NIVolume constructor in the source for documentation.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.