Skip to content

Commit

Permalink
SPM12 r7487
Browse files Browse the repository at this point in the history
  • Loading branch information
SPMcentral committed Nov 14, 2018
1 parent 0f9eada commit 50b4fd3
Show file tree
Hide file tree
Showing 1,046 changed files with 45,830 additions and 23,530 deletions.
8 changes: 5 additions & 3 deletions @file_array/private/file2mat.c
@@ -1,5 +1,5 @@
/*
* $Id: file2mat.c 6988 2017-01-16 12:38:29Z guillaume $
* $Id: file2mat.c 7353 2018-06-19 10:39:55Z guillaume $
* John Ashburner
*/

Expand All @@ -26,8 +26,10 @@ Memory mapping is used by this module. For more information on this, see:
HANDLE hFile, hMapping;
typedef char *caddr_t;
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
#ifdef _MSC_VER_
#define stat _stati64
#define fstat _fstati64
#endif
#define open _open
#define close _close
#if defined _MSC_VER
Expand Down Expand Up @@ -625,13 +627,13 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
if (map.dtype->channels == 1)
{
plhs[0] = mxCreateNumericArray(ndim,odim,map.dtype->clss,mxREAL);
#ifdef SPM_WIN32
#ifdef _MSC_VER_
/* https://msdn.microsoft.com/en-us/library/windows/desktop/aa366801.aspx */
__try
{
#endif
map.dtype->func(ndim-1, idim, iptr, idat, odim, mxGetData(plhs[0]));
#ifdef SPM_WIN32
#ifdef _MSC_VER_
}
__except(GetExceptionCode()==EXCEPTION_IN_PAGE_ERROR ?
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)
Expand Down
Binary file modified @file_array/private/file2mat.mexw32
Binary file not shown.
Binary file modified @file_array/private/file2mat.mexw64
Binary file not shown.
Binary file modified @file_array/private/init.mexw32
Binary file not shown.
Binary file modified @file_array/private/init.mexw64
Binary file not shown.
Binary file modified @file_array/private/mat2file.mexw32
Binary file not shown.
Binary file modified @file_array/private/mat2file.mexw64
Binary file not shown.
11 changes: 5 additions & 6 deletions @file_array/size.m
Expand Up @@ -4,7 +4,7 @@
% Copyright (C) 2005-2017-2012 Wellcome Trust Centre for Neuroimaging

%
% $Id: size.m 7147 2017-08-03 14:07:01Z spm $
% $Id: size.m 7440 2018-10-10 17:28:26Z john $


sa = struct(a);
Expand Down Expand Up @@ -35,9 +35,8 @@
d = d(1:lim);

if nargin > 1
if varargin{1} <= length(d)
d = d(varargin{1});
else
d = 1;
end
d_tmp = d;
d = ones(size(varargin{1}));
msk = varargin{1}<=length(d_tmp);
d(msk) = d_tmp(varargin{1}(msk));
end
2 changes: 1 addition & 1 deletion @file_array/subsref.m
Expand Up @@ -5,7 +5,7 @@
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging

%
% $Id: subsref.m 7209 2017-11-10 15:33:10Z guillaume $
% $Id: subsref.m 7439 2018-10-10 17:19:31Z john $


if isempty(subs), return; end
Expand Down
22 changes: 13 additions & 9 deletions @gifti/Contents.m
Expand Up @@ -6,23 +6,27 @@
% http://nifti.nimh.nih.gov/
%
% This MATLAB class is part of SPM:
% http://www.fil.ion.ucl.ac.uk/spm/
% https://www.fil.ion.ucl.ac.uk/spm/
%
% It relies on external libraries:
% Base64, by Peter J. Acklam:
% http://home.online.no/~pjacklam/
% miniz, by Rich Geldreich:
% http://code.google.com/p/miniz/
% XMLTree, by Guillaume Flandin:
% http://www.artefact.tk/software/matlab/xml/
% https://github.com/richgel999/miniz
% dzip, by Michael Kleder:
% https://www.mathworks.com/matlabcentral/fileexchange/8899
% XMLTree, mVTK and JSONio, by Guillaume Flandin:
% https://www.artefact.tk/software/matlab/xml/
% https://www.artefact.tk/software/matlab/mvtk/
% https://www.artefact.tk/software/matlab/jsonio/
%__________________________________________________________________________
% Copyright (C) 2008-2015 Wellcome Trust Centre for Neuroimaging
% Copyright (C) 2008-2018 Wellcome Trust Centre for Neuroimaging

% Guillaume Flandin
% $Id: Contents.m 6404 2015-04-13 14:29:53Z guillaume $
% $Id: Contents.m 7379 2018-07-25 09:11:24Z guillaume $

% GIfTI file format for MATLAB (The Mathworks, Inc.).
% Copyright (C) 2008-2015 Wellcome Trust Centre for Neuroimaging
% GIfTI library for MATLAB
% Copyright (C) 2008-2018 Wellcome Trust Centre for Neuroimaging
%
% This program is free software; you can redistribute it and/or
% modify it under the terms of the GNU General Public License
Expand All @@ -36,4 +40,4 @@
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation Inc, 59 Temple Pl. - Suite 330, Boston, MA 02111-1307, USA.
% Foundation Inc, 59 Temple Pl. - Suite 330, Boston, MA 02111-1307, USA.
11 changes: 8 additions & 3 deletions @gifti/export.m
Expand Up @@ -8,12 +8,17 @@
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Guillaume Flandin
% $Id: export.m 6401 2015-04-09 17:21:33Z guillaume $

if numel(this) > 1, warning('Only handle scalar objects yet.'); end
% $Id: export.m 7383 2018-07-31 10:53:37Z guillaume $

if nargin <= 1, target = 'MATLAB'; end

if numel(this) > 1
for i=1:numel(this)
s(i) = export(this(i),target);
end
return;
end

switch lower(target)
case 'matlab'
s = struct(this);
Expand Down
17 changes: 14 additions & 3 deletions @gifti/gifti.m
Expand Up @@ -8,7 +8,7 @@
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Guillaume Flandin
% $Id: gifti.m 7037 2017-03-15 11:45:13Z guillaume $
% $Id: gifti.m 7471 2018-11-02 11:14:39Z guillaume $

switch nargin

Expand Down Expand Up @@ -41,7 +41,7 @@
elseif ishandle(varargin{1})
this = struct('vertices',get(varargin{1},'Vertices'), ...
'faces', get(varargin{1},'Faces'));
if ~isempty(get(varargin{1},'FaceVertexCData'));
if ~isempty(get(varargin{1},'FaceVertexCData'))
this.cdata = get(varargin{1},'FaceVertexCData');
end
this = gifti(this);
Expand Down Expand Up @@ -76,7 +76,9 @@
catch
error('[GIFTI] Loading of file %s failed.', varargin{1});
end
elseif strcmpi(e,'.asc') || strcmpi(e,'.srf')
elseif ismember(lower(e),{'.asc','.srf','.mgh','.mgz','.pial',...
'.white','.inflated','.nofix','.orig','.smoothwm',...
'.sphere','.reg','.surf','.curv','.area','.sulc'})
this = read_freesurfer_file(varargin{1});
this = gifti(this);
elseif strcmpi(e,'.vtk')
Expand All @@ -85,6 +87,15 @@
elseif strcmpi(e,'.obj')
this = obj_read(varargin{1});
this = gifti(this);
elseif strcmpi(e,'.ply')
this = ply_read(varargin{1});
this = gifti(this);
elseif strcmpi(e,'.stl')
this = stl_read(varargin{1});
this = gifti(this);
elseif strcmpi(e,'.mz3')
this = mz3_read(varargin{1});
this = gifti(this);
else
this = read_gifti_file(varargin{1},giftistruct);
this = class(this,'gifti');
Expand Down
16 changes: 7 additions & 9 deletions @gifti/plot.m
Expand Up @@ -4,7 +4,7 @@
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Guillaume Flandin
% $Id: plot.m 5888 2014-02-19 19:54:12Z guillaume $
% $Id: plot.m 7381 2018-07-25 10:27:54Z guillaume $

% if ishandle(varargin{1})
% h = figure(varargin{1});
Expand All @@ -14,9 +14,9 @@
% %axis off;
% %camlight;
% %camlight(-80,-10);
% %lighting phong;
% %lighting gouraud;
% end
% cameramenu;
% cameratoolbar;


cdata = [];
Expand Down Expand Up @@ -55,12 +55,10 @@
set(hp,'FaceVertexCData',cdata(:,indc), 'FaceColor','interp')
end

axes(ax);
camlight;
camlight(-80,-10);
lighting phong;
axes(ax);
cameramenu;
camlight(ax);
camlight(ax,-80,-10);
lighting(ax,'gouraud');
cameratoolbar(h);

if nargout
varargout{1} = hp;
Expand Down
10 changes: 7 additions & 3 deletions @gifti/private/getdict.m
Expand Up @@ -4,7 +4,7 @@
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

% Guillaume Flandin
% $Id: getdict.m 4505 2011-09-30 11:45:58Z guillaume $
% $Id: getdict.m 7379 2018-07-25 09:11:24Z guillaume $

persistent dict;
if ~isempty(dict)
Expand All @@ -13,8 +13,12 @@
end

table = {...
'NIFTI_TYPE_UINT8', 'uint8', '%d', @uint8, 'uint8'
'NIFTI_TYPE_INT32', 'int32', '%d', @int32, 'int32'
'NIFTI_TYPE_UINT8', 'uint8', '%d', @uint8, 'uint8'
'NIFTI_TYPE_INT8', 'int8', '%d', @int8, 'int8'
'NIFTI_TYPE_UINT16', 'uint16', '%d', @uint16, 'uint16'
'NIFTI_TYPE_INT16', 'int16', '%d', @int16, 'int16'
'NIFTI_TYPE_UINT32', 'uint32', '%d', @uint32, 'uint32'
'NIFTI_TYPE_INT32', 'int32', '%d', @int32, 'int32'
'NIFTI_TYPE_FLOAT32', 'float32', '%f', @single, 'single'
'NIFTI_TYPE_FLOAT64', 'float64', '%f', @double, 'double'};

Expand Down

0 comments on commit 50b4fd3

Please sign in to comment.