JNIfTI Toolbox
Fast and portable NIfTI-1/2 reader/writer for MATLAB and Octave
🧠 What is JNIfTI?
JNIfTI is a fully functional NIfTI-1/2 reader/writer that supports both MATLAB and GNU Octave. It can read and write compressed/uncompressed NIfTI files (.nii, .nii.gz) and Analyze 7.5 files (.hdr/.img).
More importantly, JNIfTI converts NIfTI data to its JSON-based replacement format - providing a much more flexible, human-readable, and extensible alternative to the rigid binary NIfTI format.
🏆 NeuroJSON Project
JNIfTI is part of the NeuroJSON project (neurojson.org), funded by US NIH grant U24-NS124027. It implements the JNIfTI Specification Draft 2 for standardized neuroimaging data exchange.
📋 JNIfTI Format Advantages
JNIfTI (.jnii for text, .bnii for binary) provides a modern alternative to traditional NIfTI files:
🔍 Human-Readable
- Text-based JSON format (.jnii)
- Self-documenting structure
- Easy to inspect and validate
- Version control friendly
⚡ High Performance
- Binary format option (.bnii)
- Internal compression support
- Fast memory-mapped reading
- Efficient data storage
🌐 Cross-Platform
- JSON standard compatibility
- Python support via pyjdata
- JavaScript/web compatible
- Universal parsers available
📦 JData Compliant
- Follows JData specification
- Complex data annotations
- Metadata preservation
- Extension support
⚡ Key Capabilities
- Universal Compatibility: Works with MATLAB R2008a+ and GNU Octave 4.0+
- Complete NIfTI Support: Read/write NIfTI-1 and NIfTI-2 formats
- Compression Support: Handle .nii.gz files natively with optional ZMat acceleration
- Analyze 7.5 Support: Read legacy .hdr/.img format files
- Memory-Mapped I/O: Fast disk-based reading in MATLAB using memmapfile
- Bi-directional Conversion: Convert between NIfTI ↔ JNIfTI seamlessly
- Internal Compression: JNIfTI supports zlib, gzip, lzma compression
- Zero Dependencies: Basic NIfTI reading requires no additional toolboxes
![[Home]](upload/neurojson_banner_plain.png)