Skip to content

Commit 607c5e4

Browse files
committed
sync jsonlab and jnifty to the latest versions
1 parent ab2878a commit 607c5e4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+887
-688
lines changed

Content.txt

+27-27
Original file line numberDiff line numberDiff line change
@@ -2931,7 +2931,7 @@
29312931
initially created on 2013/08/17
29322932

29332933
Format specifications:
2934-
Binary JData (BJData):https://github.com/fangq/bjdata
2934+
Binary JData (BJData):https://github.com/NeuroJSON/bjdata
29352935
UBJSON: https://github.com/ubjson/universal-binary-json
29362936
MessagePack: https://github.com/msgpack/msgpack
29372937

@@ -3074,7 +3074,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
30743074
including uint16(u), uint32(m), uint64(M) and half-precision float (h)
30753075

30763076
Format specifications:
3077-
Binary JData (BJD): https://github.com/fangq/bjdata
3077+
Binary JData (BJD): https://github.com/NeuroJSON/bjdata
30783078
UBJSON: https://github.com/ubjson/universal-binary-json
30793079
MessagePack: https://github.com/msgpack/msgpack
30803080

@@ -3430,7 +3430,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
34303430

34313431
savejmesh(node,face,elem,fname,opt)
34323432

3433-
export a mesh to the JMesh format defined in http://github.com/fangq/jmesh
3433+
export a mesh to the JMesh format defined in http://github.com/NeuroJSON/jmesh
34343434

34353435

34363436
input:
@@ -3469,7 +3469,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
34693469
jnii=loadjnifti(inputfile, 'Param1',value1, 'Param2',value2,...)
34703470

34713471
Load a standard NIFTI-1/2 file or text or binary JNIfTI file with
3472-
format defined in JNIfTI specification: https://github.com/fangq/jnifti
3472+
format defined in JNIfTI specification: https://github.com/NeuroJSON/jnifti
34733473

34743474

34753475
input:
@@ -3504,7 +3504,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
35043504
savejnifti(jnii, outputfile, 'Param1',value1, 'Param2',value2,...)
35053505

35063506
Save an in-memory JNIfTI structure into a JNIfTI file with format
3507-
defined in JNIfTI specification: https://github.com/fangq/jnifti
3507+
defined in JNIfTI specification: https://github.com/NeuroJSON/jnifti
35083508

35093509

35103510
input:
@@ -3559,7 +3559,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
35593559
img: this is a numerical array to be stored in the NIfTI file
35603560
filename: output file name, can have a suffix of '.nii' or '.nii.gz'
35613561
if a .gz suffix is used, this function needs the JSONLab
3562-
(http://gitlab.com/fangq/jsonlab) and ZMat (http://gitlab.com/fangq/zmat)
3562+
(http://gitlab.com/fangq/jsonlab) and ZMat (http://gitlab.com/NeuroJSON/zmat)
35633563
to perform the compression.
35643564
rawhdr (optional): a struct, as a pre-created/loaded NIfTI header data structure
35653565
if rawhdr is 'nifti1' or 'nifti2', this function calls
@@ -3767,7 +3767,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
37673767
fname: (optional) output file name; if not given, save to 'jamdata.jamm'
37683768
if fname has a '.json' or '.jdt' suffix, a text-based
37693769
JSON/JData file will be created (slow); if the suffix is '.jamm' or
3770-
'.jdb', a Binary JData (https://github.com/fangq/bjdata/) file will be created.
3770+
'.jdb', a Binary JData (https://github.com/NeuroJSON/bjdata/) file will be created.
37713771
opt: (optional) a struct to store parsing options, opt can be replaced by
37723772
a list of ('param',value) pairs - the param string is equivallent
37733773
to a field in opt. opt can have the following
@@ -3868,7 +3868,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
38683868
input:
38693869
img: set the jnii.NIFTIData section
38703870
'header_i': the header subfield name defined in the JNIfTI
3871-
specification, see https://github.com/fangq/jnifti
3871+
specification, see https://github.com/NeuroJSON/jnifti
38723872
value_i: set the value for the specified JNIfTI header field
38733873

38743874
output:
@@ -3903,7 +3903,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
39033903

39043904
A fast and portable NIFTI-1/2 and Analyze7.5 file parser and converter
39053905
to the text and binary JNIfTI formats defined in JNIfTI specification:
3906-
https://github.com/fangq/jnifti
3906+
https://github.com/NeuroJSON/jnifti
39073907

39083908
This function is compatible with both MATLAB and GNU Octave.
39093909
It accepts .nii, .nii.gz, .hdr/.img and .hdr.gz/.img.gz input files
@@ -3952,7 +3952,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
39523952
No external dependency if reading .nii/.hdr/.img files;
39533953

39543954
To load gzipped input files (.nii.gz/.hdr.gz/.img.gz), one must
3955-
install the ZMat Toolbox (http://github.com/fangq/zmat) and
3955+
install the ZMat Toolbox (http://github.com/NeuroJSON/zmat) and
39563956
JSONLab Toolbox (http://github.com/fangq/jsonlab);
39573957

39583958
To save files into the text/binary JNIfTI formatted files, one
@@ -4007,7 +4007,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
40074007
dependency:
40084008

40094009
To load a JNIfTI file with compression or niifile ends with (.nii.gz/.hdr.gz/.img.gz),
4010-
one must install the ZMat Toolbox (http://github.com/fangq/zmat) and
4010+
one must install the ZMat Toolbox (http://github.com/NeuroJSON/zmat) and
40114011
JSONLab Toolbox (http://github.com/fangq/jsonlab);
40124012

40134013

@@ -4074,7 +4074,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
40744074
savebnii(jniidata, bniifile, 'Param1',value1, 'Param2',value2,...)
40754075

40764076
Save an in-memory JNIfTI structure into a binary-JNIfTI file with format
4077-
defined in JNIfTI specification: https://github.com/fangq/jnifti
4077+
defined in JNIfTI specification: https://github.com/NeuroJSON/jnifti
40784078

40794079

40804080
input:
@@ -4103,7 +4103,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
41034103
savejnii(jniidata, jniifile, 'Param1',value1, 'Param2',value2,...)
41044104

41054105
Save an in-memory JNIfTI structure into a text-JNIfTI file with format
4106-
defined in JNIfTI specification: https://github.com/fangq/jnifti
4106+
defined in JNIfTI specification: https://github.com/NeuroJSON/jnifti
41074107

41084108

41094109
input:
@@ -4135,7 +4135,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
41354135
Compress a string or numerical array using the ZLIB-compression
41364136

41374137
This function depends on JVM in MATLAB or, can optionally use the ZMat
4138-
toolbox (http://github.com/fangq/zmat)
4138+
toolbox (http://github.com/NeuroJSON/zmat)
41394139

41404140
Copyright (c) 2012, Kota Yamaguchi
41414141
URL: https://www.mathworks.com/matlabcentral/fileexchange/39526-byte-encoding-utilities
@@ -4164,7 +4164,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
41644164

41654165
Decompressing a ZLIB-compressed byte-stream to recover the original data
41664166
This function depends on JVM in MATLAB or, can optionally use the ZMat
4167-
toolbox (http://github.com/fangq/zmat)
4167+
toolbox (http://github.com/NeuroJSON/zmat)
41684168

41694169
Copyright (c) 2012, Kota Yamaguchi
41704170
URL: https://www.mathworks.com/matlabcentral/fileexchange/39526-byte-encoding-utilities
@@ -4197,7 +4197,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
41974197
Compress a string or numerical array using the GZIP-compression
41984198

41994199
This function depends on JVM in MATLAB or, can optionally use the ZMat
4200-
toolbox (http://github.com/fangq/zmat)
4200+
toolbox (http://github.com/NeuroJSON/zmat)
42014201

42024202
Copyright (c) 2012, Kota Yamaguchi
42034203
URL: https://www.mathworks.com/matlabcentral/fileexchange/39526-byte-encoding-utilities
@@ -4226,7 +4226,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
42264226

42274227
Decompressing a GZIP-compressed byte-stream to recover the original data
42284228
This function depends on JVM in MATLAB or, can optionally use the ZMat
4229-
toolbox (http://github.com/fangq/zmat)
4229+
toolbox (http://github.com/NeuroJSON/zmat)
42304230

42314231
Copyright (c) 2012, Kota Yamaguchi
42324232
URL: https://www.mathworks.com/matlabcentral/fileexchange/39526-byte-encoding-utilities
@@ -4258,7 +4258,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
42584258

42594259
Compress a string or a numerical array using LZMA-compression
42604260

4261-
This function depends on the ZMat toolbox (http://github.com/fangq/zmat)
4261+
This function depends on the ZMat toolbox (http://github.com/NeuroJSON/zmat)
42624262

42634263

42644264
input:
@@ -4283,7 +4283,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
42834283
output = lzmadecode(input,info)
42844284

42854285
Decompressing an LZMA-compressed byte-stream to recover the original data
4286-
This function depends on the ZMat toolbox (http://github.com/fangq/zmat)
4286+
This function depends on the ZMat toolbox (http://github.com/NeuroJSON/zmat)
42874287

42884288

42894289
input:
@@ -4312,7 +4312,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
43124312

43134313
Compress a string or a numerical array using LZip-compression
43144314

4315-
This function depends on the ZMat toolbox (http://github.com/fangq/zmat)
4315+
This function depends on the ZMat toolbox (http://github.com/NeuroJSON/zmat)
43164316

43174317

43184318
input:
@@ -4337,7 +4337,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
43374337
output = lzipdecode(input,info)
43384338

43394339
Decompressing an Lzip-compressed byte-stream to recover the original data
4340-
This function depends on the ZMat toolbox (http://github.com/fangq/zmat)
4340+
This function depends on the ZMat toolbox (http://github.com/NeuroJSON/zmat)
43414341

43424342

43434343
input:
@@ -4366,7 +4366,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
43664366

43674367
Compress a string or a numerical array using LZ4-compression
43684368

4369-
This function depends on the ZMat toolbox (http://github.com/fangq/zmat)
4369+
This function depends on the ZMat toolbox (http://github.com/NeuroJSON/zmat)
43704370

43714371

43724372
input:
@@ -4391,7 +4391,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
43914391
output = lz4decode(input,info)
43924392

43934393
Decompressing an LZ4-compressed byte-stream to recover the original data
4394-
This function depends on the ZMat toolbox (http://github.com/fangq/zmat)
4394+
This function depends on the ZMat toolbox (http://github.com/NeuroJSON/zmat)
43954395

43964396

43974397
input:
@@ -4420,7 +4420,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
44204420

44214421
Compress a string or a numerical array using LZ4HC-compression
44224422

4423-
This function depends on the ZMat toolbox (http://github.com/fangq/zmat)
4423+
This function depends on the ZMat toolbox (http://github.com/NeuroJSON/zmat)
44244424

44254425

44264426
input:
@@ -4445,7 +4445,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
44454445
output = lz4hcdecode(input,info)
44464446

44474447
Decompressing an LZ4HC-compressed byte-stream to recover the original data
4448-
This function depends on the ZMat toolbox (http://github.com/fangq/zmat)
4448+
This function depends on the ZMat toolbox (http://github.com/NeuroJSON/zmat)
44494449

44504450

44514451
input:
@@ -4472,7 +4472,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
44724472

44734473
Decoding a Base64-encoded byte-stream to recover the original data
44744474
This function depends on JVM in MATLAB or, can optionally use the ZMat
4475-
toolbox (http://github.com/fangq/zmat)
4475+
toolbox (http://github.com/NeuroJSON/zmat)
44764476

44774477
Copyright (c) 2012, Kota Yamaguchi
44784478
URL: https://www.mathworks.com/matlabcentral/fileexchange/39526-byte-encoding-utilities
@@ -4499,7 +4499,7 @@ LOADMSGPACK parses a msgpack byte buffer into Matlab data structures
44994499
Encoding a binary vector or array using Base64
45004500

45014501
This function depends on JVM in MATLAB or, can optionally use the ZMat
4502-
toolbox (http://github.com/fangq/zmat)
4502+
toolbox (http://github.com/NeuroJSON/zmat)
45034503

45044504
Copyright (c) 2012, Kota Yamaguchi
45054505
URL: https://www.mathworks.com/matlabcentral/fileexchange/39526-byte-encoding-utilities

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,12 @@ are even more popular than Iso2Mesh itself. For example:
6565
encoder and decoder [(Editor Pick-of-the-week, Popular File 2018)](https://www.mathworks.com/matlabcentral/fileexchange/33381-jsonlab-a-toolbox-to-encode-decode-json-files)
6666
- Brain2Mesh (http://mcx.space/brain2mesh): a fully automated
6767
high-quality brain mesh generation toolbox built on Iso2Mesh
68-
- JNIfTI (http://github.com/fangq/jnifti): a fast and portable
68+
- JNIfTI (http://github.com/NeuroJSON/jnifti): a fast and portable
6969
NIfTI-1/2 reader/writer and next-gen NIfTI file format
7070
- Metch (http://iso2mesh.sf.net/metch): a 3D mesh registration toolbox
7171
- JData specification (http://openjdata.org): a highly portable
7272
easy-to-use scientific data annotation method and specification
73-
- ZMat (http://github.com/fangq/zmat): a data compression library
73+
- ZMat (http://github.com/NeuroJSON/zmat): a data compression library
7474
and MATLAB/Octave toolbox
7575

7676
Currently, Iso2Mesh and its submodules are broadly distributed

README.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,12 @@ are even more popular than Iso2Mesh itself. For example:
6161
encoder and decoder ([https://www.mathworks.com/matlabcentral/fileexchange/33381-jsonlab-a-toolbox-to-encode-decode-json-files Editor Pick-of-the-week, Popular Files 2018])
6262
* Brain2Mesh (http://mcx.space/brain2mesh): a fully automated \
6363
high-quality brain mesh generation toolbox built on Iso2Mesh
64-
* JNIfTI (http://github.com/fangq/jnifti): a fast and portable \
64+
* JNIfTI (http://github.com/NeuroJSON/jnifti): a fast and portable \
6565
NIfTI-1/2 reader/writer and next-gen NIfTI file format
6666
* Metch (http://iso2mesh.sf.net/metch): a 3D mesh registration toolbox
6767
* JData specification (http://openjdata.org): a highly portable \
6868
easy-to-use scientific data annotation method and specification
69-
* ZMat (http://github.com/fangq/zmat): a data compression library \
69+
* ZMat (http://github.com/NeuroJSON/zmat): a data compression library \
7070
and MATLAB/Octave toolbox
7171

7272
Currently, Iso2Mesh and its submodules are broadly distributed

base64decode.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
%
55
% Decoding a Base64-encoded byte-stream to recover the original data
66
% This function depends on JVM in MATLAB or, can optionally use the ZMat
7-
% toolbox (http://github.com/fangq/zmat)
7+
% toolbox (http://github.com/NeuroJSON/zmat)
88
%
99
% Copyright (c) 2012, Kota Yamaguchi
1010
% URL: https://www.mathworks.com/matlabcentral/fileexchange/39526-byte-encoding-utilities
@@ -34,7 +34,7 @@
3434
output=zmat(varargin{1},0,'base64');
3535
return;
3636
elseif(isoctavemesh)
37-
error('You must install the ZMat toolbox (http://github.com/fangq/zmat) to use this function in Octave');
37+
error('You must install the ZMat toolbox (http://github.com/NeuroJSON/zmat) to use this function in Octave');
3838
end
3939

4040
error(javachk('jvm'));

base64encode.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
% Encoding a binary vector or array using Base64
66
%
77
% This function depends on JVM in MATLAB or, can optionally use the ZMat
8-
% toolbox (http://github.com/fangq/zmat)
8+
% toolbox (http://github.com/NeuroJSON/zmat)
99
%
1010
% Copyright (c) 2012, Kota Yamaguchi
1111
% URL: https://www.mathworks.com/matlabcentral/fileexchange/39526-byte-encoding-utilities

blosc2decode.m

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
function varargout = blosc2decode(varargin)
2+
%
3+
% output = blosc2decode(input,codec)
4+
% output = blosc2decode(input)
5+
% or
6+
% output = blosc2decode(input,info)
7+
%
8+
% Decompressing an blosc2-compressed byte-stream to recover the original data
9+
% This function depends on the ZMat toolbox (http://github.com/NeuroJSON/zmat)
10+
%
11+
% authors:Qianqian Fang (q.fang <at> neu.edu)
12+
%
13+
% input:
14+
% input: a string, int8/uint8 vector or numerical array to store blosc2-compressed data
15+
% codec: if the 2nd input is a string, it is treated as a compression method that
16+
% blosc2 supports, it can be one of:
17+
% 'blosc2blosclz', 'blosc2lz4', 'blosc2lz4hc', 'blosc2zlib' and 'blosc2zstd'
18+
% if no codec is specified, 'blosc2blosclz' method is assumed
19+
% info (optional): a struct produced by the zmat/blosc2encode function during
20+
% compression; if not given, the inputs/outputs will be treated as a
21+
% 1-D vector
22+
%
23+
% output:
24+
% output: the decompressed byte stream stored in a uint8 vector; if info is
25+
% given, output will restore the original data's type and dimensions
26+
%
27+
% examples:
28+
% [bytes, info]=blosc2encode(eye(10));
29+
% orig=blosc2decode(bytes,info);
30+
%
31+
% license:
32+
% BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details
33+
%
34+
% -- this function is part of JSONLab toolbox (http://iso2mesh.sf.net/cgi-bin/index.cgi?jsonlab)
35+
%
36+
37+
if (nargin == 0)
38+
error('you must provide at least 1 input');
39+
end
40+
if (exist('zmat', 'file') == 2 || exist('zmat', 'file') == 3)
41+
if (nargin >= 2 && ischar(varargin{2}))
42+
[varargout{1:nargout}] = zmat(varargin{1}, 0, varargin{2:end});
43+
elseif (nargin > 1)
44+
[varargout{1:nargout}] = zmat(varargin{1}, varargin{2:end});
45+
else
46+
[varargout{1:nargout}] = zmat(varargin{1}, 0, 'blosc2blosclz', varargin{2:end});
47+
end
48+
else
49+
error('you must install ZMat toolbox to use this feature: http://github.com/NeuroJSON/zmat');
50+
end

blosc2encode.m

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
function varargout = blosc2encode(varargin)
2+
%
3+
% output = blosc2encode(input)
4+
% or
5+
% [output, info] = blosc2encode(input)
6+
%
7+
% Compress a string or a numerical array using LZ4-compression
8+
%
9+
% This function depends on the ZMat toolbox (http://github.com/NeuroJSON/zmat)
10+
%
11+
% authors:Qianqian Fang (q.fang <at> neu.edu)
12+
%
13+
% input:
14+
% input: the original data, can be a string, a numerical vector or array
15+
%
16+
% output:
17+
% output: the compressed byte stream stored in a uint8 vector
18+
% info: (optional) a struct storing the metadata of the input, see "help zmat" for details
19+
%
20+
% examples:
21+
% [bytes, info]=blosc2encode(eye(10));
22+
% orig=blosc2decode(bytes,info);
23+
%
24+
% license:
25+
% BSD or GPL version 3, see LICENSE_{BSD,GPLv3}.txt files for details
26+
%
27+
% -- this function is part of JSONLab toolbox (http://iso2mesh.sf.net/cgi-bin/index.cgi?jsonlab)
28+
%
29+
30+
if (nargin == 0)
31+
error('you must provide at least 1 input');
32+
end
33+
34+
if (exist('zmat', 'file') == 2 || exist('zmat', 'file') == 3)
35+
if (nargin > 1 && ischar(varargin{2}))
36+
[varargout{1:nargout}] = zmat(varargin{1}, 1, varargin{2:end});
37+
else
38+
[varargout{1:nargout}] = zmat(varargin{1}, 1, 'blosc2blosclz', varargin{2:end});
39+
end
40+
return
41+
else
42+
error('you must install ZMat toolbox to use this feature: http://github.com/NeuroJSON/zmat');
43+
end

0 commit comments

Comments
 (0)