Releases: NeuroJSON/jnifti
JNIfTI Specification - Draft 2
JNIfTI: a JSON/binary JSON extension to the NIfTI-1/2 formats
- Copyright: (C) 2019-2025 Qianqian Fang <q.fang at neu.edu>, 2020 Edward Xu <xu.ed at northeastern.edu>
- License: Apache License, Version 2.0
- Version: V1 (Draft 2)
- URL: https://neurojson.org/jnifti/draft2
- Status: Frozen on March 23, 2025. For future updates, please see the Development URL below
- Development: https://github.com/NeuroJSON/jnifti
Acknowledgement: We would like to thank @calvinchai for the contributions of the QForm/SForm section and additional Intent codes.
ChangeLog
2025-03-23 [a2023d5] [spellcheck] fix spellchecker error
2025-03-23 [a0cff78] [release] tag Draft 2 of the spec
2025-03-23 [55bf04c] [spellcheck] fix spellchecker
2025-03-23 [00732ed] [spec] make SForm/QForm accept strings, add missing links
2025-03-23 [fb1e311] [sample] regenerate all sample data using the latest jsonlab/jnifty
2025-03-23 [6d37d74] [forum] add forum link
2025-03-23 [ae6e878] [typo] fix typos, add names to wordlist
2025-03-23 [1607cb5] [feat] add spellchecker
2024-10-03 [10fa770] Merge pull request #8 from calvinchai/master
2024-10-03 [748df9d] Reanme "mni" to "mni_152" and align cell boundaries
2024-10-02 [6cf2273] [repo] update all embedded libraries to NeuroJSON github repo
2024-10-01 [8842a48] Add XForm code strings
2024-10-01 [dccb6f6] Add intents field values for community applications
2024-04-20 [4d1dcdb] [lib] update jsonlab
2024-04-19 [e1669cc] [lib] update jsonlab, pyjdata, pybj, easyh5
2023-06-14 [2198d91] add blosc2 codec tests
2022-08-10 [831efae] update octave folder to the new octave9853 branch of jnifty
JNIfTI specification - Draft 1
JNIfTI: a JSON/binary JSON extension to the NIfTI-1/2 formats
- Copyright: (C) 2019-2022 Qianqian Fang <q.fang at neu.edu>,
2020 Edward Xu <xu.ed at northeastern.edu> - License: Apache License, Version 2.0
- Version: V1 (Draft 1)
- URL: https://neurojson.org/jnifti/draft1
- Status: Frozen on March 23, 2025. For future updates, please see the Development URL below
- Development: https://github.com/NeuroJSON/jnifti
ChangeLog
2022-06-11 [6e8292d] Update JNIfTI_specification.md
2022-06-03 [dff6363] update mailing list url, update repo owner
2022-06-03 [178fac1] update submodule and root git repo to NeuroJSON org
2022-05-20 [11f7670] Merge pull request #6 from NeuroJSON/master
2022-04-15 [35fa1b3] add digimouse atlas with 0.2mm voxels
2022-04-15 [710cc8a] Merge pull request #5 from NeuroJSON/master
2022-04-15 [0c57d65] Merge branch 'fangq:master' into master
2022-03-12 [9f4a13d] remove redundant line
2022-03-11 [b7968dd] Merge branch 'fangq:master' into master
2022-03-11 [70d273d] upgrade all bnii samples to BJD Draft 2, add DataInfo, fix #2, fix #3
2022-02-22 [677a87c] Update README.md
2022-02-08 [5b8eb89] replace all saveubjson by savebj, clarify row-major/column-major conversion
2021-11-27 [54a9cb3] Revert "revert a change" - stick with NIFTIExtension as used in jnifty toolbox
2020-07-14 [f8726b4] revert a change
2020-07-14 [da4f928] Full proof-reading by Edward Xu
2020-07-13 [630a349] add python module to read .bnii/.jnii files
2020-06-23 [bfec783] Create INDEX
2020-06-23 [bcc5cf1] Create DESCRIPTION
2020-06-15 [c520638] Update UBJSON to BJData spec
2020-06-14 [6da6ddc] Update README.md
2019-11-29 [07af1e5] add jnii2nii to convert jnii back to nii for compatibility
2019-11-06 [038b917] simplify speed test script
2019-11-02 [aa32bfc] Update create_headct_jnii.m
2019-11-02 [37be9f2] Merge branch 'master' of https://github.com/fangq/jnifti
2019-11-02 [5c75c0a] update benchmark script, print timing info
2019-10-30 [073b916] add the missing .gitmodules file
2019-10-25 [498b9b6] update samples using jsonlab v1.9.8
2019-09-14 [de634d7] change comment markers to make it compatible for both matlab and octave
2019-09-13 [6860348] jnifti toolbox v0.5
2019-09-13 [5cde8e5] change gitlab links to github
2019-09-13 [0744785] add Version field in niftiinfo.m
2019-09-13 [18185fd] add README for the JNIfTI toolbox
2019-09-12 [18a6e64] complete nifti toolbox for reading and writing, will submit to octave
2019-09-11 [272764c] add help info to memmapstream
2019-09-11 [b16bbbc] JNIFTI MATLAB library is now supports .nii.gz and Octave
2019-08-29 [346fb89] warn users to download zmat if to use lzma
2019-06-23 [8c8c4ec] Language polish
2019-06-21 [32493f2] handle endianness,add bilateral mapping from code to human-readable strings
2019-06-20 [108fdba] Use an empty string for unknown extension type
2019-06-18 [8dc6f7e] Fix slicetype format
2019-06-18 [876fdcd] Correct typo
2019-06-18 [cc39e16] update jnifti encoder and decoder and all examples with the new header names
2019-06-18 [ab393d2] define string forms for SliceType, Intent, add meaningful Orientation, merge Quatern into structs
2019-06-18 [875b338] depreciate NIIHeaderSize and NIIByteOffset in new JNIfTI files
2019-06-18 [d75fe1d] depreciates DataTypeName, rename to A75DataTypeName
2019-06-18 [34cf2ad] Depreciates DataTypeName as DataType already supports descriptive string types
2019-06-18 [2f65f9b] add nifti-2 example
2019-06-18 [905aff6] properly read NIFTI-2 extension flags
2019-06-17 [897a68b] Minor format change on table 2
2019-06-17 [4ec9a77] More format updates to the mapping table
2019-06-17 [ecf1248] Remove extra letter
2019-06-17 [915e31a] Mapping table format updates
2019-06-17 [ee12d20] Use U+2000 for space
2019-06-17 [a140119] Update mapping table
2019-06-14 [ffed2e8] Fix typo in README
2019-06-14 [90ae001] Provide the JData spec link in README
2019-06-14 [8c3f42e] Update magic field length for NIFTI-1/2
2019-06-14 [dab0080] add origin for nii2jnii.m
2019-06-14 [38c5161] minor text format update
2019-06-14 [a38bb5f] minor update to the basic example
2019-06-14 [531bc6e] convert all sample code using the new unified save/load interfaces
2019-06-14 [2022691] add importer and exporter for jnifti files
2019-06-14 [db8748b] jnifticreate header only mode
2019-06-14 [d79809d] polishing help info for nii2jnii
2019-06-14 [58b9184] Remove the extra ArrayIsComplex tag for composite data types
2019-06-14 [1523e5d] Add the types for NIFTI-2 header
2019-06-14 [1d2417a] support nift-2 in nii2jnii, add headct example from mricrogl sample data
2019-06-13 [d64a3c1] add matlab file to create jnii header, add 3 examples
2019-06-13 [a6bbc3c] add matlab converter from nii to jnifti
2019-06-13 [960304c] rename JNifTi to JNIfTI to follow upstream naming convention
2019-06-13 [2494690] simplify keywords changing ArrayCompression to ArrayZip
2019-06-09 [81f84f9] Change GLMax to GlobalMax
2019-06-09 [93e342d] Update nifti 1/2 links
2019-06-09 [55e471b] Language polishing
2019-06-08 [a85bd5f] Fix toc broken links
2019-06-08 [3b8f01c] fix the description of long double
2019-06-08 [2c76570] More Table 1 format update
2019-06-08 [0d2ce90] fix unit toc link
2019-06-08 [29ab625] Update Table 1 formatting
2019-06-08 [4674e4a] Update format for Table 3
2019-06-08 [4aa9a21] minor typo fix
2019-06-08 [cb8e80c] Fix some typos and formatting issues
2019-06-08 [7967c7e] Depreciated field: NIIByteOffset
2019-06-08 [bd4af87] Complete the very first full draft
2019-06-08 [fbe9106] Add UBJSON example for compressed data
2019-06-08 [cd3caf4] Add table captions
2019-06-08 [0d6bc5b] Update JNifTi_specification.md
2019-06-07 [967682b] Update table format
2019-06-07 [a6f3548] initial version
JNIfTI Toolbox v0.6 - Epica
JNIfTI Toolbox - Fast and portable NIfTI-1/2 reader and NIfTI-to-JNIfTI converter
- Copyright (C) 2019-2020 Qianqian Fang <q.fang at neu.edu>
- License: GNU General Public License version 3 (GPL v3) or Apache License 2.0, see License*.txt
- Version: 0.6 (Epica)
- URL: http://github.com/fangq/jnifti
Overview
This is a fully functional NIfTI-1/2 reader/writer that supports both
MATLAB and GNU Octave, and is capable of reading/writing both non-compressed
and compressed NIfTI files (.nii, .nii.gz) as well as two-part Analyze7.5/NIfTI
files (.hdr/.img and .hdr.gz/.img.gz).
More importantly, this is a toolbox that converts NIfTI data to its JSON-based
replacement, JNIfTI (.jnii for text-based and .bnii for binary-based), defined
by the JNIfTI specification (http://github.com/fangq/jnifti). JNIfTI is a
much more flexible, human-readable and extensible file format compared to the
more rigid and opaque NIfTI format, making the data much easier to manipulate
and share.
Installation
The JNIfTI toolbox includes a stand-alone NIfTI-1/2 parser that works on both
MATLAB and GNU Octave without needing additional components. To just reading and
writing the un-compressed NIfTI and Analyze7.5 files (.nii, .hdr/.img), one
only needs to run addpath('/path/to/jnifti'). For MATLAB, JNIfTI toolbox
utilizes memmapfile-based disk-reading, making it very fast. For Octave,
memmapfile is currently not implemented, so, a full reading is required.
The JNIfTI toolbox is also capable of reading/writing gzip-compressed NIfTI and
Analyze7.5 files (.nii.gz, .hdr.gz, .img.gz). This feature is supported in MATLAB
directly without needing another toolbox (MATLAB must be in the JVM-enabled mode).
To process gzip-compressed NIfTI/Analyze files in Octave and MATLAB with -nojvm,
one need to install the open-source JSONLab and ZMat toolboxes, both supporting
MATLAB and Octave. They can be downloaded at
- JSONLab: http://github.com/fangq/jsonlab
- ZMat: http://github.com/fangq/zmat
To save NIfTI-1/2 data as JNIfTI files, one needs to install JSONLab. The JNIfTI
data format supports internal compression (as oppose to external compression such
as *.gz files). To create or read compressed JNIfTI files in Octave, one must
install the ZMat toolbox, as listed above.
Usage
nii2jnii - To convert a NIfTI-1/2 file to a JNIfTI file or data structure
Example:
nii=nii2jnii('test.nii', 'nii'); % read a .nii file as a nii structure
nii=nii2jnii('test.nii.gz'); % read a .nii.gz file as a jnii structure
nii2jnii('test.nii.gz', 'newdata.jnii') ;% read a .nii.gz file and convert to a text-JNIfTI file
nii2jnii('test.nii.gz', 'newdata.bnii','compression','zlib'); % read a .nii.gz file and convert to a binary-JNIfTI file with compression
loadnifti - To read a NIfTI-1/2 (.nii or .nii.gz) file (alias to nii2jnii)
Example:
nii=loadnifti('test.nii.gz'); % read a .nii.gz file as a jnii structure
nii=loadnifti('test.nii', 'nii'); % read a .nii file as a nii structure
savenifti - To write an image as NIfTI-1/2 (.nii or .nii.gz) file
Example:
savenifti(img,'test.nii.gz'); % save an array img to a compressed nifti file
savenifti(img, 'test.nii', 'nifti2'); % save an array img to a nifti-2 file file
savenifti(img, 'test.nii', header); % save an array img with an existing header
loadjnifti - To read a JNIfTI (.jnii or .bnii) file
Example:
jnii=nii2jnii('test.nii.gz');
savejnifti(jnii, 'magic10.bnii','Compression','gzip');
newjnii=loadjnifti('magic10.bnii');
savejnifti - To write a JNIfTI structure into a file (.jnii or .bnii)
Example:
jnii=jnifticreate(uint8(magic(10)),'Name','10x10 magic matrix');
savejnifti(jnii, 'magic10.jnii');
savejnifti(jnii, 'magic10_debug.bnii','Compression','gzip');
jnii2nii - To convert a JNIfTI file or data structure to a NIfTI-1/2 file
Example:
nii=jnii2nii('test.jnii'); % read a .jnii file as an nii structure
nii=jnii2nii('test.bnii'); % read a .bnii file as an nii structure
jnii2nii('test.jnii', 'newdata.nii.gz'); % read a text-JNIfTI file to an .nii.gz file
jnii2nii('test.bnii', 'newdata.nii'); % read a text-JNIfTI file to an .nii file
JNIfTI Toolbox v0.5 - Ascendance
JNIfTI Toolbox - Fast and portable NIfTI-1/2 reader and NIfTI-to-JNIfTI converter
- Copyright (C) 2019 Qianqian Fang <q.fang at neu.edu>
- License: GNU General Public License version 3 (GPL v3) or Apache License 2.0, see License*.txt
- Version: 0.5 (Ascendence)
- URL: http://github.com/fangq/jnifti
Overview
This is a fully functional NIfTI-1/2 reader/writer that supports both
MATLAB and GNU Octave, and is capable of reading/writing both non-compressed
and compressed NIfTI files (.nii, .nii.gz) as well as two-part Analyze7.5/NIfTI
files (.hdr/.img and .hdr.gz/.img.gz).
More importantly, this is a toolbox that converts NIfTI data to its JSON-based
replacement, JNIfTI (.jnii for text-based and .bnii for binary-based), defined
by the JNIfTI specification (http://github.com/fangq/jnifti). JNIfTI is a
much more flexible, human-readable and extensible file format compared to the
more rigid and opaque NIfTI format, making the data much easier to manipulate
and share.
Installation
The JNIfTI toolbox includes a stand-alone NIfTI-1/2 parser that works on both
MATLAB and GNU Octave without needing additional components. To just reading and
writing the un-compressed NIfTI and Analyze7.5 files (.nii, .hdr/.img), one
only needs to run addpath('/path/to/jnifti'). For MATLAB, JNIfTI toolbox
utilizes memmapfile-based disk-reading, making it very fast. For Octave,
memmapfile is currently not implemented, so, a full reading is required.
The JNIfTI toolbox is also capable of reading/writing gzip-compressed NIfTI and
Analyze7.5 files (.nii.gz, .hdr.gz, .img.gz). This feature is supported in MATLAB
directly without needing another toolbox (MATLAB must be in the JVM-enabled mode).
To process gzip-compressed NIfTI/Analyze files in Octave and MATLAB with -nojvm,
one need to install the open-source JSONLab and ZMat toolboxes, both supporting
MATLAB and Octave. They can be downloaded at
- JSONLab: http://github.com/fangq/jsonlab
- ZMat: http://github.com/fangq/zmat
To save NIfTI-1/2 data as JNIfTI files, one needs to install JSONLab. The JNIfTI
data format supports internal compression (as oppose to external compression such
as *.gz files). To create or read compressed JNIfTI files in Octave, one must
install the ZMat toolbox, as listed above.
Usage
nii2jnii - To convert a NIfTI-1/2 file to a JNIfTI file or data structure
Example:
nii=nii2jnii('test.nii', 'nii'); % read a .nii file as a nii structure
nii=nii2jnii('test.nii.gz'); % read a .nii.gz file as a jnii structure
nii2jnii('test.nii.gz', 'newdata.jnii') ;% read a .nii.gz file and convert to a text-JNIfTI file
nii2jnii('test.nii.gz', 'newdata.bnii','compression','zlib'); % read a .nii.gz file and convert to a binary-JNIfTI file with compression
loadnifti - To read a NIfTI-1/2 (.nii or .nii.gz) file (alias to nii2jnii)
Example:
nii=loadnifti('test.nii.gz'); % read a .nii.gz file as a jnii structure
nii=loadnifti('test.nii', 'nii'); % read a .nii file as a nii structure
savenifti - To write an image as NIfTI-1/2 (.nii or .nii.gz) file
Example:
savenifti(img,'test.nii.gz'); % save an array img to a compressed nifti file
savenifti(img, 'test.nii', 'nifti2'); % save an array img to a nifti-2 file file
savenifti(img, 'test.nii', header); % save an array img with an existing header
loadjnifti - To read a JNIfTI (.jnii or .bnii) file
Example:
jnii=nii2jnii('test.nii.gz');
savejnifti(jnii, 'magic10.bnii','Compression','gzip');
newjnii=loadjnifti('magic10.bnii');
savejnifti - To write a JNIfTI structure into a file (.jnii or .bnii)
Example:
jnii=jnifticreate(uint8(magic(10)),'Name','10x10 magic matrix');
savejnifti(jnii, 'magic10.jnii');
savejnifti(jnii, 'magic10_debug.bnii','Compression','gzip');
