11# JNIfTI Toolbox - Fast and portable NIfTI-1/2 reader and NIfTI-to-JNIfTI converter
22
3- * Copyright (C) 2019 Qianqian Fang <q.fang at neu.edu>
3+ * Copyright (C) 2019-2020 Qianqian Fang <q.fang at neu.edu>
44* License: GNU General Public License version 3 (GPL v3) or Apache License 2.0, see License* .txt
5- * Version: 0.5 (Ascendence )
5+ * Version: 0.6 (Epica )
66* URL: http://github.com/fangq/jnifti
77
88## Overview
99
1010This is a fully functional NIfTI-1/2 reader/writer that supports both
1111MATLAB and GNU Octave, and is capable of reading/writing both non-compressed
12- and compressed NIfTI files (.nii, .nii.gz) as well as two-part Analyze7.5/NIfTI
13- files (.hdr/.img and .hdr.gz/.img.gz).
12+ and compressed NIfTI files (` .nii, .nii.gz ` ) as well as two-part Analyze7.5/NIfTI
13+ files (` .hdr/.img ` and ` .hdr.gz/.img.gz ` ).
1414
1515More importantly, this is a toolbox that converts NIfTI data to its JSON-based
16- replacement, JNIfTI (.jnii for text-based and .bnii for binary-based), defined
16+ replacement, JNIfTI (` .jnii ` for text-based and ` .bnii ` for binary-based), defined
1717by the JNIfTI specification (http://github.com/fangq/jnifti ). JNIfTI is a
1818much more flexible, human-readable and extensible file format compared to the
1919more rigid and opaque NIfTI format, making the data much easier to manipulate
@@ -29,7 +29,7 @@ utilizes `memmapfile`-based disk-reading, making it very fast. For Octave,
2929` memmapfile ` is currently not implemented, so, a full reading is required.
3030
3131The JNIfTI toolbox is also capable of reading/writing gzip-compressed NIfTI and
32- Analyze7.5 files (.nii.gz, .hdr.gz, .img.gz). This feature is supported in MATLAB
32+ Analyze7.5 files (` .nii.gz, .hdr.gz, .img.gz ` ). This feature is supported in MATLAB
3333directly without needing another toolbox (MATLAB must be in the JVM-enabled mode).
3434
3535To process gzip-compressed NIfTI/Analyze files in Octave and MATLAB with ` -nojvm ` ,
@@ -41,7 +41,7 @@ MATLAB and Octave. They can be downloaded at
4141
4242To save NIfTI-1/2 data as JNIfTI files, one needs to install JSONLab. The JNIfTI
4343data format supports internal compression (as oppose to external compression such
44- as \ * .gz files). To create or read compressed JNIfTI files in Octave, one must
44+ as ` *.gz ` files). To create or read compressed JNIfTI files in Octave, one must
4545install the ZMat toolbox, as listed above.
4646
4747## Usage
@@ -81,3 +81,11 @@ Example:
8181 savejnifti(jnii, 'magic10.jnii');
8282 savejnifti(jnii, 'magic10_debug.bnii','Compression','gzip');
8383```
84+ ### ` jnii2nii ` - To convert a JNIfTI file or data structure to a NIfTI-1/2 file
85+ Example:
86+ ```
87+ nii=jnii2nii('test.jnii'); % read a .jnii file as an nii structure
88+ nii=jnii2nii('test.bnii'); % read a .bnii file as an nii structure
89+ jnii2nii('test.jnii', 'newdata.nii.gz'); % read a text-JNIfTI file to an .nii.gz file
90+ jnii2nii('test.bnii', 'newdata.nii'); % read a text-JNIfTI file to an .nii file
91+ ```
0 commit comments