Skip to content

Commit

Permalink
fix loadjd and savejd file extension match, add jbids
Browse files Browse the repository at this point in the history
  • Loading branch information
fangq committed Feb 24, 2023
1 parent 29bac9d commit 408cc2e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions loadjd.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
%
% input:
% inputfile: the input hierarchical container data file, supporting:
% *.json,.jnii,.jdt,.jmsh,.jnirs: JSON/JData based data files, see https://neurojson.org/jdata/draft2
% *.json,.jnii,.jdt,.jmsh,.jnirs,.jbids: JSON/JData based data files, see https://neurojson.org/jdata/draft2
% *.bjd,.bnii,.jdb,.bmsh,.bnirs: binary JData (BJData) files, see https://neurojson.org/bjdata/draft2
% *.ubj: UBJSON-encoded files, see http://ubjson.org
% *.msgpack: MessagePack-encoded files, see http://msgpack.org
Expand Down Expand Up @@ -43,9 +43,9 @@
error('you must provide file name');
end

if(regexpi(filename,'\.json$|\.jnii$\.jdt$\.jdat$|\.jmsh$|\.jnirs$'))
if(regexpi(filename,'\.json$|\.jnii$|\.jdt$|\.jdat$|\.jmsh$|\.jnirs|\.jbids$'))
[varargout{1:nargout}]=loadjson(filename,varargin{:});
elseif(regexpi(filename,'\.bjd$|\.bnii$\.jdb$\.jbat$|\.bmsh$|\.bnirs$'))
elseif(regexpi(filename,'\.bjd$|\.bnii$|\.jdb$|\.jbat$|\.bmsh$|\.bnirs$'))
[varargout{1:nargout}]=loadbj(filename,varargin{:});
elseif(regexpi(filename,'\.ubj$'))
[varargout{1:nargout}]=loadubjson(filename,varargin{:});
Expand All @@ -57,5 +57,5 @@
end
[varargout{1:nargout}]=loadh5(filename,varargin{:});
else
error('file suffix must be one of .json,.jnii,.jdt,.jmsh,.jnirs,.bjd,.bnii,.jdb,.bmsh,.bnirs,.ubj,.msgpack,.h5,.hdf5,.snirf');
error('file suffix must be one of .json,.jnii,.jdt,.jmsh,.jnirs,.jbids,.bjd,.bnii,.jdb,.bmsh,.bnirs,.ubj,.msgpack,.h5,.hdf5,.snirf');
end
8 changes: 4 additions & 4 deletions savejd.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
% obj: a MATLAB object (array, cell, cell array, struct, struct array,
% class instance).
% outputfile: the output file name to the hierarchical container file
% *.json,.jnii,.jdt,.jmsh,.jnirs: JSON/JData based data files, see https://neurojson.org/jdata/draft2
% *.json,.jnii,.jdt,.jmsh,.jnirs,.jbids: JSON/JData based data files, see https://neurojson.org/jdata/draft2
% *.bjd,.bnii,.jdb,.bmsh,.bnirs: binary JData (BJData) files, see https://neurojson.org/bjdata/draft2
% *.ubj: UBJSON-encoded files, see http://ubjson.org
% *.msgpack: MessagePack-encoded files, see http://msgpack.org
Expand Down Expand Up @@ -64,9 +64,9 @@
if(~exist('filename','var'))
filename='.json';
end
if(regexpi(filename,'\.json$|\.jnii$\.jdt$\.jdat$|\.jmsh$|\.jnirs$'))
if(regexpi(filename,'\.json$|\.jnii$|\.jdt$|\.jdat$|\.jmsh$|\.jnirs$'))
[varargout{1:nargout}]=savejson(varargin{:});
elseif(regexpi(filename,'\.bjd$|\.bnii$\.jdb$\.jbat$|\.bmsh$|\.bnirs$'))
elseif(regexpi(filename,'\.bjd$|\.bnii$|\.jdb$|\.jbat$|\.bmsh$|\.bnirs$'))
[varargout{1:nargout}]=savebj(varargin{:});
elseif(regexpi(filename,'\.ubj$'))
[varargout{1:nargout}]=saveubjson(varargin{:});
Expand All @@ -85,5 +85,5 @@
end
[varargout{1:nargout}]=saveh5(varargin{2},filename, opt);
else
error('file suffix must be one of .json,.jnii,.jdt,.jmsh,.jnirs,.bjd,.bnii,.jdb,.bmsh,.bnirs,.ubj,.msgpack,.h5,.hdf5,.snirf');
error('file suffix must be one of .json,.jnii,.jdt,.jmsh,.jnirs,.jbids,.bjd,.bnii,.jdb,.bmsh,.bnirs,.ubj,.msgpack,.h5,.hdf5,.snirf');
end

0 comments on commit 408cc2e

Please sign in to comment.