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
Size: 1085
Language: Julia
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.