Skip to content

Commit 0f9eada

Browse files
committed
SPM12 r7219
1 parent 015b151 commit 0f9eada

File tree

1,775 files changed

+57726
-28932
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,775 files changed

+57726
-28932
lines changed

@file_array/Contents.m

+3-5
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,8 @@
4141
% size(fa4)
4242
% size(fa2)
4343
% length(fa0)
44-
% _________________________________________________________________________
45-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
44+
%__________________________________________________________________________
45+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
4646

4747
%
48-
% $Id: Contents.m 2696 2009-02-05 20:29:48Z guillaume $
49-
50-
48+
% $Id: Contents.m 7147 2017-08-03 14:07:01Z spm $

@file_array/cat.m

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,40 @@
11
function o = cat(dr,varargin)
22
% Concatenate file_array objects. The result is a non-simple object
33
% that can no longer be reshaped.
4-
% _______________________________________________________________________
5-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
4+
%__________________________________________________________________________
5+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
66

77
%
8-
% $Id: cat.m 4136 2010-12-09 22:22:28Z guillaume $
8+
% $Id: cat.m 7147 2017-08-03 14:07:01Z spm $
99

1010

11-
if dr>32 || dr<0, error('Unknown command option.'); end;
11+
if dr>32 || dr<0, error('Unknown command option.'); end
1212
dr = max(round(dr),1);
1313
d = ones(nargin-1,16);
1414
tmp = {};
1515
dpos = 0;
16-
for i=1:nargin-1,
16+
for i=1:nargin-1
1717
vi = varargin{i};
1818
if strcmp(class(vi),'file_array')
1919
sz = size(vi);
2020
d(i,1:length(sz)) = sz;
2121
svi = struct(vi);
2222
svi = svi(:);
23-
for j=1:length(svi(:)),
23+
for j=1:length(svi(:))
2424
if length(svi(j).pos)<dr
2525
svi(j).pos((length(svi(j).pos)+1):dr) = 1;
2626
end
2727
svi(j).pos(dr)= svi(j).pos(dr) + dpos;
28-
end;
28+
end
2929
dpos = dpos + d(i,dr);
3030
tmp{i} = svi;
3131
else
3232
error(['Conversion to file_array from ' class(vi) ' is not possible.']);
33-
end;
34-
end;
33+
end
34+
end
3535
if any(diff(d(:,[1:(dr-1) (dr+1):end]),1,1))
3636
error('All matrices on a row in the bracketed expression must have the same number of rows.');
3737
else
3838
o = vertcat(tmp{:});
3939
o = file_array(o);
40-
end;
40+
end

@file_array/ctranspose.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
function varargout = ctranspose(varargin)
22
% Transposing not allowed
3-
% _______________________________________________________________________
4-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
3+
%__________________________________________________________________________
4+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
55

66
%
7-
% $Id: ctranspose.m 1143 2008-02-07 19:33:33Z spm $
7+
% $Id: ctranspose.m 7147 2017-08-03 14:07:01Z spm $
88

99
error('file_array objects can not be transposed.');

@file_array/disp.m

+14-15
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
11
function disp(obj)
22
% Display a file_array object
3-
% _______________________________________________________________________
4-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
3+
%__________________________________________________________________________
4+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
55

66
%
7-
% $Id: disp.m 4136 2010-12-09 22:22:28Z guillaume $
7+
% $Id: disp.m 7147 2017-08-03 14:07:01Z spm $
88

99

10-
if numel(struct(obj))>1,
10+
if numel(struct(obj))>1
1111
fprintf(' %s object: ', class(obj));
1212
sz = size(obj);
13-
if length(sz)>4,
13+
if length(sz)>4
1414
fprintf('%d-D\n',length(sz));
1515
else
16-
for i=1:(length(sz)-1),
16+
for i=1:(length(sz)-1)
1717
fprintf('%d-by-',sz(i));
18-
end;
18+
end
1919
fprintf('%d\n',sz(end));
20-
end;
20+
end
2121
else
2222
disp(mystruct(obj))
23-
end;
24-
return;
25-
%=======================================================================
23+
end
2624

27-
%=======================================================================
25+
26+
%==========================================================================
27+
% function t = mystruct(obj)
28+
%==========================================================================
2829
function t = mystruct(obj)
2930
fn = fieldnames(obj);
3031
for i=1:length(fn)
3132
t.(fn{i}) = subsref(obj,struct('type','.','subs',fn{i}));
32-
end;
33-
return;
34-
%=======================================================================
33+
end

@file_array/display.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
function display(obj)
22
% Display a file_array object
3-
% _______________________________________________________________________
4-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
3+
%__________________________________________________________________________
4+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
55

66
%
7-
% $Id: display.m 1143 2008-02-07 19:33:33Z spm $
7+
% $Id: display.m 7147 2017-08-03 14:07:01Z spm $
88

99

1010
disp(' ');

@file_array/double.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
% Convert to double precision
33
% FORMAT double(fa)
44
% fa - a file_array
5-
% _______________________________________________________________________
6-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
5+
%__________________________________________________________________________
6+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
77

88
%
9-
% $Id: double.m 1143 2008-02-07 19:33:33Z spm $
9+
% $Id: double.m 7147 2017-08-03 14:07:01Z spm $
1010

11-
out = double(numeric(fa));
1211

12+
out = double(numeric(fa));

@file_array/end.m

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
function en = end(a,k,n)
22
% Overloaded end function for file_array objects.
3-
% _______________________________________________________________________
4-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
3+
%__________________________________________________________________________
4+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
55

66
%
7-
% $Id: end.m 1143 2008-02-07 19:33:33Z spm $
7+
% $Id: end.m 7147 2017-08-03 14:07:01Z spm $
8+
89

910
dim = size(a);
1011
if k>length(dim)
1112
en = 1;
1213
else
13-
if n<length(dim),
14+
if n<length(dim)
1415
dim = [dim(1:(n-1)) prod(dim(n:end))];
15-
end;
16+
end
1617
en = dim(k);
17-
end;
18+
end

@file_array/fieldnames.m

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
function t = fieldnames(obj)
22
% Fieldnames of a file-array object
3-
% _______________________________________________________________________
4-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
3+
%__________________________________________________________________________
4+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
55

66
%
7-
% $Id: fieldnames.m 1143 2008-02-07 19:33:33Z spm $
7+
% $Id: fieldnames.m 7147 2017-08-03 14:07:01Z spm $
8+
89

910
t = {...
1011
'fname'

@file_array/file_array.m

+14-15
Original file line numberDiff line numberDiff line change
@@ -9,34 +9,33 @@
99
% scl_slope - scalefactor (default = 1)
1010
% scl_inter - DC offset, such that dat = raw*scale + inter (default = 0)
1111
% permission - Write permission, either 'rw' or 'ro' (default = 'rw')
12-
% _______________________________________________________________________
13-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
12+
%__________________________________________________________________________
13+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
1414

1515
%
16-
% $Id: file_array.m 4136 2010-12-09 22:22:28Z guillaume $
16+
% $Id: file_array.m 7147 2017-08-03 14:07:01Z spm $
1717

1818

1919
if nargin==1
20-
if isstruct(varargin{1}),
20+
if isstruct(varargin{1})
2121
a = class(varargin{1},'file_array');
2222
return;
23-
elseif isa(varargin{1},'file_array'),
23+
elseif isa(varargin{1},'file_array')
2424
a = varargin{1};
2525
return;
26-
end;
27-
end;
26+
end
27+
end
2828
a = struct('fname','','dim',[0 0],'dtype',2,...
2929
'be',0,'offset',0,'pos',[],'scl_slope',[],'scl_inter',[], 'permission','rw');
3030
%a = class(a,'file_array');
3131

32-
if nargin>=1, a = fname(a,varargin{1}); end;
33-
if nargin>=2, a = dim(a,varargin{2}); end;
34-
if nargin>=3, a = dtype(a,varargin{3}); end;
35-
if nargin>=4, a = offset(a,varargin{4}); end;
36-
if nargin>=5, a = scl_slope(a,varargin{5}); end;
37-
if nargin>=6, a = scl_inter(a,varargin{6}); end;
38-
if nargin>=7, a = permission(a,varargin{7}); end;
32+
if nargin>=1, a = fname(a,varargin{1}); end
33+
if nargin>=2, a = dim(a,varargin{2}); end
34+
if nargin>=3, a = dtype(a,varargin{3}); end
35+
if nargin>=4, a = offset(a,varargin{4}); end
36+
if nargin>=5, a = scl_slope(a,varargin{5}); end
37+
if nargin>=6, a = scl_inter(a,varargin{6}); end
38+
if nargin>=7, a = permission(a,varargin{7}); end
3939

4040
a.pos = ones(size(a.dim));
4141
a = file_array(a);
42-

@file_array/horzcat.m

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
function o = horzcat(varargin)
22
% Horizontal concatenation of file_array objects
3-
% _______________________________________________________________________
4-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
3+
%__________________________________________________________________________
4+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
55

66
%
7-
% $Id: horzcat.m 1143 2008-02-07 19:33:33Z spm $
7+
% $Id: horzcat.m 7147 2017-08-03 14:07:01Z spm $
88

9-
o = cat(2,varargin{:});
10-
return;
119

10+
o = cat(2,varargin{:});

@file_array/initialise.m

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ function initialise(fa)
44
% This creates a file on disk with the appropriate size by explicitly
55
% writing data to prevent a sparse file.
66
%__________________________________________________________________________
7-
% Copyright (C) 2013 Wellcome Trust Centre for Neuroimaging
7+
% Copyright (C) 2013-2017 Wellcome Trust Centre for Neuroimaging
88

99
%
10-
% $Id: initialise.m 5458 2013-05-01 14:32:23Z guillaume $
10+
% $Id: initialise.m 7147 2017-08-03 14:07:01Z spm $
1111

1212

1313
% first approach

@file_array/isnan.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22
% Convert to numeric form
33
% FORMAT isnan(fa)
44
% fa - a file_array
5-
% _______________________________________________________________________
6-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
5+
%__________________________________________________________________________
6+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
77

88
%
9-
% $Id: isnan.m 1301 2008-04-03 13:21:44Z john $
9+
% $Id: isnan.m 7147 2017-08-03 14:07:01Z spm $
10+
1011

1112
bs = 10240;
1213
m = size(fa);
1314
fa = reshape(fa,prod(m),1);
1415
n = prod(m);
1516
out = false(m);
16-
for i=1:ceil(n/bs),
17+
for i=1:ceil(n/bs)
1718
ii = ((((i-1)*bs)+1):min((i*bs),n))';
1819
tmp = subsref(fa,struct('type','()','subs',{{ii}}));
1920
out(ii) = isnan(tmp);
2021
end
21-

@file_array/length.m

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
function l = length(x)
22
% Overloaded length function for file_array objects
3-
% _______________________________________________________________________
4-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
3+
%__________________________________________________________________________
4+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
55

66
%
7-
% $Id: length.m 1143 2008-02-07 19:33:33Z spm $
7+
% $Id: length.m 7147 2017-08-03 14:07:01Z spm $
88

99

1010
l = max(size(x));
11-

@file_array/loadobj.m

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
function b = loadobj(a)
22
% loadobj for file_array class
3-
% _______________________________________________________________________
4-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
3+
%__________________________________________________________________________
4+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
55

66
%
7-
% $Id: loadobj.m 1544 2008-05-06 10:34:36Z guillaume $
7+
% $Id: loadobj.m 7147 2017-08-03 14:07:01Z spm $
8+
89

910
if isa(a,'file_array')
1011
b = a;
1112
else
1213
a = permission(a, 'rw');
1314
b = file_array(a);
14-
end
15+
end

@file_array/ndims.m

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
function out = ndims(fa)
22
% Number of dimensions
3-
%_______________________________________________________________________
4-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
3+
%__________________________________________________________________________
4+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
55

66
%
7-
% $Id: ndims.m 1143 2008-02-07 19:33:33Z spm $
7+
% $Id: ndims.m 7147 2017-08-03 14:07:01Z spm $
88

99

1010
out = size(fa);
1111
out = length(out);
12-

@file_array/numel.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
function t = numel(obj)
22
% Number of simple file arrays involved.
3-
% _______________________________________________________________________
4-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
3+
%__________________________________________________________________________
4+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
55

66
%
7-
% $Id: numel.m 1143 2008-02-07 19:33:33Z spm $
7+
% $Id: numel.m 7147 2017-08-03 14:07:01Z spm $
88

99

1010
% Should be this, but it causes problems when accessing

@file_array/numeric.m

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@
22
% Convert to numeric form
33
% FORMAT numeric(fa)
44
% fa - a file_array
5-
% _______________________________________________________________________
6-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
5+
%__________________________________________________________________________
6+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
77

88
%
9-
% $Id: numeric.m 1143 2008-02-07 19:33:33Z spm $
9+
% $Id: numeric.m 7147 2017-08-03 14:07:01Z spm $
1010

1111

1212
[vo{1:ndims(fa)}] = deal(':');
1313
out = subsref(fa,struct('type','()','subs',{vo}));
14-

@file_array/permute.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
function varargout = permute(varargin)
2-
% Can not be permuted.
3-
% _______________________________________________________________________
4-
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging
2+
% file_array objects can not be permuted
3+
%__________________________________________________________________________
4+
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging
55

66
%
7-
% $Id: permute.m 1143 2008-02-07 19:33:33Z spm $
7+
% $Id: permute.m 7147 2017-08-03 14:07:01Z spm $
88

99

1010
error('file_array objects can not be permuted.');

0 commit comments

Comments
 (0)