Skip to content

Commit 50b4fd3

Browse files
committed
SPM12 r7487
1 parent 0f9eada commit 50b4fd3

File tree

1,046 files changed

+45830
-23530
lines changed

Some content is hidden

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

1,046 files changed

+45830
-23530
lines changed

@file_array/private/file2mat.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $Id: file2mat.c 6988 2017-01-16 12:38:29Z guillaume $
2+
* $Id: file2mat.c 7353 2018-06-19 10:39:55Z guillaume $
33
* John Ashburner
44
*/
55

@@ -26,8 +26,10 @@ Memory mapping is used by this module. For more information on this, see:
2626
HANDLE hFile, hMapping;
2727
typedef char *caddr_t;
2828
#if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS == 64
29+
#ifdef _MSC_VER_
2930
#define stat _stati64
3031
#define fstat _fstati64
32+
#endif
3133
#define open _open
3234
#define close _close
3335
#if defined _MSC_VER
@@ -625,13 +627,13 @@ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
625627
if (map.dtype->channels == 1)
626628
{
627629
plhs[0] = mxCreateNumericArray(ndim,odim,map.dtype->clss,mxREAL);
628-
#ifdef SPM_WIN32
630+
#ifdef _MSC_VER_
629631
/* https://msdn.microsoft.com/en-us/library/windows/desktop/aa366801.aspx */
630632
__try
631633
{
632634
#endif
633635
map.dtype->func(ndim-1, idim, iptr, idat, odim, mxGetData(plhs[0]));
634-
#ifdef SPM_WIN32
636+
#ifdef _MSC_VER_
635637
}
636638
__except(GetExceptionCode()==EXCEPTION_IN_PAGE_ERROR ?
637639
EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH)

@file_array/private/file2mat.mexw32

0 Bytes
Binary file not shown.

@file_array/private/file2mat.mexw64

-512 Bytes
Binary file not shown.

@file_array/private/init.mexw32

0 Bytes
Binary file not shown.

@file_array/private/init.mexw64

0 Bytes
Binary file not shown.

@file_array/private/mat2file.mexw32

0 Bytes
Binary file not shown.

@file_array/private/mat2file.mexw64

0 Bytes
Binary file not shown.

@file_array/size.m

+5-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
% Copyright (C) 2005-2017-2012 Wellcome Trust Centre for Neuroimaging
55

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

99

1010
sa = struct(a);
@@ -35,9 +35,8 @@
3535
d = d(1:lim);
3636

3737
if nargin > 1
38-
if varargin{1} <= length(d)
39-
d = d(varargin{1});
40-
else
41-
d = 1;
42-
end
38+
d_tmp = d;
39+
d = ones(size(varargin{1}));
40+
msk = varargin{1}<=length(d_tmp);
41+
d(msk) = d_tmp(varargin{1}(msk));
4342
end

@file_array/subsref.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
66

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

1010

1111
if isempty(subs), return; end

@gifti/Contents.m

+13-9
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,27 @@
66
% http://nifti.nimh.nih.gov/
77
%
88
% This MATLAB class is part of SPM:
9-
% http://www.fil.ion.ucl.ac.uk/spm/
9+
% https://www.fil.ion.ucl.ac.uk/spm/
1010
%
1111
% It relies on external libraries:
1212
% Base64, by Peter J. Acklam:
1313
% http://home.online.no/~pjacklam/
1414
% miniz, by Rich Geldreich:
15-
% http://code.google.com/p/miniz/
16-
% XMLTree, by Guillaume Flandin:
17-
% http://www.artefact.tk/software/matlab/xml/
15+
% https://github.com/richgel999/miniz
16+
% dzip, by Michael Kleder:
17+
% https://www.mathworks.com/matlabcentral/fileexchange/8899
18+
% XMLTree, mVTK and JSONio, by Guillaume Flandin:
19+
% https://www.artefact.tk/software/matlab/xml/
20+
% https://www.artefact.tk/software/matlab/mvtk/
21+
% https://www.artefact.tk/software/matlab/jsonio/
1822
%__________________________________________________________________________
19-
% Copyright (C) 2008-2015 Wellcome Trust Centre for Neuroimaging
23+
% Copyright (C) 2008-2018 Wellcome Trust Centre for Neuroimaging
2024

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

24-
% GIfTI file format for MATLAB (The Mathworks, Inc.).
25-
% Copyright (C) 2008-2015 Wellcome Trust Centre for Neuroimaging
28+
% GIfTI library for MATLAB
29+
% Copyright (C) 2008-2018 Wellcome Trust Centre for Neuroimaging
2630
%
2731
% This program is free software; you can redistribute it and/or
2832
% modify it under the terms of the GNU General Public License
@@ -36,4 +40,4 @@
3640
%
3741
% You should have received a copy of the GNU General Public License
3842
% along with this program; if not, write to the Free Software
39-
% Foundation Inc, 59 Temple Pl. - Suite 330, Boston, MA 02111-1307, USA.
43+
% Foundation Inc, 59 Temple Pl. - Suite 330, Boston, MA 02111-1307, USA.

@gifti/export.m

+8-3
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,17 @@
88
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
99

1010
% Guillaume Flandin
11-
% $Id: export.m 6401 2015-04-09 17:21:33Z guillaume $
12-
13-
if numel(this) > 1, warning('Only handle scalar objects yet.'); end
11+
% $Id: export.m 7383 2018-07-31 10:53:37Z guillaume $
1412

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

15+
if numel(this) > 1
16+
for i=1:numel(this)
17+
s(i) = export(this(i),target);
18+
end
19+
return;
20+
end
21+
1722
switch lower(target)
1823
case 'matlab'
1924
s = struct(this);

@gifti/gifti.m

+14-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
99

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

1313
switch nargin
1414

@@ -41,7 +41,7 @@
4141
elseif ishandle(varargin{1})
4242
this = struct('vertices',get(varargin{1},'Vertices'), ...
4343
'faces', get(varargin{1},'Faces'));
44-
if ~isempty(get(varargin{1},'FaceVertexCData'));
44+
if ~isempty(get(varargin{1},'FaceVertexCData'))
4545
this.cdata = get(varargin{1},'FaceVertexCData');
4646
end
4747
this = gifti(this);
@@ -76,7 +76,9 @@
7676
catch
7777
error('[GIFTI] Loading of file %s failed.', varargin{1});
7878
end
79-
elseif strcmpi(e,'.asc') || strcmpi(e,'.srf')
79+
elseif ismember(lower(e),{'.asc','.srf','.mgh','.mgz','.pial',...
80+
'.white','.inflated','.nofix','.orig','.smoothwm',...
81+
'.sphere','.reg','.surf','.curv','.area','.sulc'})
8082
this = read_freesurfer_file(varargin{1});
8183
this = gifti(this);
8284
elseif strcmpi(e,'.vtk')
@@ -85,6 +87,15 @@
8587
elseif strcmpi(e,'.obj')
8688
this = obj_read(varargin{1});
8789
this = gifti(this);
90+
elseif strcmpi(e,'.ply')
91+
this = ply_read(varargin{1});
92+
this = gifti(this);
93+
elseif strcmpi(e,'.stl')
94+
this = stl_read(varargin{1});
95+
this = gifti(this);
96+
elseif strcmpi(e,'.mz3')
97+
this = mz3_read(varargin{1});
98+
this = gifti(this);
8899
else
89100
this = read_gifti_file(varargin{1},giftistruct);
90101
this = class(this,'gifti');

@gifti/plot.m

+7-9
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
55

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

99
% if ishandle(varargin{1})
1010
% h = figure(varargin{1});
@@ -14,9 +14,9 @@
1414
% %axis off;
1515
% %camlight;
1616
% %camlight(-80,-10);
17-
% %lighting phong;
17+
% %lighting gouraud;
1818
% end
19-
% cameramenu;
19+
% cameratoolbar;
2020

2121

2222
cdata = [];
@@ -55,12 +55,10 @@
5555
set(hp,'FaceVertexCData',cdata(:,indc), 'FaceColor','interp')
5656
end
5757

58-
axes(ax);
59-
camlight;
60-
camlight(-80,-10);
61-
lighting phong;
62-
axes(ax);
63-
cameramenu;
58+
camlight(ax);
59+
camlight(ax,-80,-10);
60+
lighting(ax,'gouraud');
61+
cameratoolbar(h);
6462

6563
if nargout
6664
varargout{1} = hp;

@gifti/private/getdict.m

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
55

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

99
persistent dict;
1010
if ~isempty(dict)
@@ -13,8 +13,12 @@
1313
end
1414

1515
table = {...
16-
'NIFTI_TYPE_UINT8', 'uint8', '%d', @uint8, 'uint8'
17-
'NIFTI_TYPE_INT32', 'int32', '%d', @int32, 'int32'
16+
'NIFTI_TYPE_UINT8', 'uint8', '%d', @uint8, 'uint8'
17+
'NIFTI_TYPE_INT8', 'int8', '%d', @int8, 'int8'
18+
'NIFTI_TYPE_UINT16', 'uint16', '%d', @uint16, 'uint16'
19+
'NIFTI_TYPE_INT16', 'int16', '%d', @int16, 'int16'
20+
'NIFTI_TYPE_UINT32', 'uint32', '%d', @uint32, 'uint32'
21+
'NIFTI_TYPE_INT32', 'int32', '%d', @int32, 'int32'
1822
'NIFTI_TYPE_FLOAT32', 'float32', '%f', @single, 'single'
1923
'NIFTI_TYPE_FLOAT64', 'float64', '%f', @double, 'double'};
2024

0 commit comments

Comments
 (0)