forked from fieldtrip/fieldtrip
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ENH - added missing mex files (fieldtrip#2419)
* ENH - added missing mex files * ENH - updated spm_platform * ENH - updated large part of spm code to dev-version on github * ENH - also updated code from lower level folders * added to-be-ignored word
- Loading branch information
1 parent
90f0d93
commit e1f7d03
Showing
245 changed files
with
3,820 additions
and
3,220 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,38 @@ | ||
function o = cat(dr,varargin) | ||
% Concatenate file_array objects. The result is a non-simple object | ||
% that can no longer be reshaped. | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
|
||
% | ||
% $Id: cat.m 4136 2010-12-09 22:22:28Z guillaume $ | ||
% Copyright (C) 2005-2022 Wellcome Centre for Human Neuroimaging | ||
|
||
|
||
if dr>32 || dr<0, error('Unknown command option.'); end; | ||
if dr>32 || dr<0, error('Unknown command option.'); end | ||
dr = max(round(dr),1); | ||
d = ones(nargin-1,16); | ||
tmp = {}; | ||
dpos = 0; | ||
for i=1:nargin-1, | ||
for i=1:nargin-1 | ||
vi = varargin{i}; | ||
if strcmp(class(vi),'file_array') | ||
sz = size(vi); | ||
d(i,1:length(sz)) = sz; | ||
svi = struct(vi); | ||
svi = svi(:); | ||
for j=1:length(svi(:)), | ||
for j=1:length(svi(:)) | ||
if length(svi(j).pos)<dr | ||
svi(j).pos((length(svi(j).pos)+1):dr) = 1; | ||
end | ||
svi(j).pos(dr)= svi(j).pos(dr) + dpos; | ||
end; | ||
end | ||
dpos = dpos + d(i,dr); | ||
tmp{i} = svi; | ||
else | ||
error(['Conversion to file_array from ' class(vi) ' is not possible.']); | ||
end; | ||
end; | ||
end | ||
end | ||
if any(diff(d(:,[1:(dr-1) (dr+1):end]),1,1)) | ||
error('All matrices on a row in the bracketed expression must have the same number of rows.'); | ||
else | ||
o = vertcat(tmp{:}); | ||
o = file_array(o); | ||
end; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
function varargout = ctranspose(varargin) | ||
% Transposing not allowed | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
|
||
% Copyright (C) 2005-2022 Wellcome Centre for Human Neuroimaging | ||
|
||
% | ||
% $Id: ctranspose.m 1143 2008-02-07 19:33:33Z spm $ | ||
|
||
error('file_array objects can not be transposed.'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,31 @@ | ||
function disp(obj) | ||
% Display a file_array object | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
|
||
% | ||
% $Id: disp.m 4136 2010-12-09 22:22:28Z guillaume $ | ||
% Copyright (C) 2005-2022 Wellcome Centre for Human Neuroimaging | ||
|
||
|
||
if numel(struct(obj))>1, | ||
if numel(struct(obj))>1 | ||
fprintf(' %s object: ', class(obj)); | ||
sz = size(obj); | ||
if length(sz)>4, | ||
if length(sz)>4 | ||
fprintf('%d-D\n',length(sz)); | ||
else | ||
for i=1:(length(sz)-1), | ||
for i=1:(length(sz)-1) | ||
fprintf('%d-by-',sz(i)); | ||
end; | ||
end | ||
fprintf('%d\n',sz(end)); | ||
end; | ||
end | ||
else | ||
disp(mystruct(obj)) | ||
end; | ||
return; | ||
%======================================================================= | ||
end | ||
|
||
%======================================================================= | ||
|
||
%========================================================================== | ||
% function t = mystruct(obj) | ||
%========================================================================== | ||
function t = mystruct(obj) | ||
fn = fieldnames(obj); | ||
for i=1:length(fn) | ||
t.(fn{i}) = subsref(obj,struct('type','.','subs',fn{i})); | ||
end; | ||
return; | ||
%======================================================================= | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
function en = end(a,k,n) | ||
% Overloaded end function for file_array objects. | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
|
||
% Copyright (C) 2005-2022 Wellcome Centre for Human Neuroimaging | ||
|
||
% | ||
% $Id: end.m 1143 2008-02-07 19:33:33Z spm $ | ||
|
||
dim = size(a); | ||
if k>length(dim) | ||
en = 1; | ||
else | ||
if n<length(dim), | ||
if n<length(dim) | ||
dim = [dim(1:(n-1)) prod(dim(n:end))]; | ||
end; | ||
end | ||
en = dim(k); | ||
end; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
function o = horzcat(varargin) | ||
% Horizontal concatenation of file_array objects | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
|
||
% | ||
% $Id: horzcat.m 1143 2008-02-07 19:33:33Z spm $ | ||
% Copyright (C) 2005-2022 Wellcome Centre for Human Neuroimaging | ||
|
||
o = cat(2,varargin{:}); | ||
return; | ||
|
||
o = cat(2,varargin{:}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
function out = isnan(fa) | ||
% Convert to numeric form | ||
% Logical array containing true where the elements of file_array are NaN's | ||
% FORMAT isnan(fa) | ||
% fa - a file_array | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
|
||
% Copyright (C) 2005-2022 Wellcome Centre for Human Neuroimaging | ||
|
||
% | ||
% $Id: isnan.m 1301 2008-04-03 13:21:44Z john $ | ||
|
||
bs = 10240; | ||
m = size(fa); | ||
fa = reshape(fa,prod(m),1); | ||
n = prod(m); | ||
out = false(m); | ||
for i=1:ceil(n/bs), | ||
for i=1:ceil(n/bs) | ||
ii = ((((i-1)*bs)+1):min((i*bs),n))'; | ||
tmp = subsref(fa,struct('type','()','subs',{{ii}})); | ||
out(ii) = isnan(tmp); | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
function l = length(x) | ||
% Overloaded length function for file_array objects | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
|
||
% | ||
% $Id: length.m 1143 2008-02-07 19:33:33Z spm $ | ||
% Copyright (C) 2005-2022 Wellcome Centre for Human Neuroimaging | ||
|
||
|
||
l = max(size(x)); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,13 @@ | ||
function b = loadobj(a) | ||
% loadobj for file_array class | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
|
||
% Copyright (C) 2005-2022 Wellcome Centre for Human Neuroimaging | ||
|
||
% | ||
% $Id: loadobj.m 1544 2008-05-06 10:34:36Z guillaume $ | ||
|
||
if isa(a,'file_array') | ||
b = a; | ||
else | ||
a = permission(a, 'rw'); | ||
b = file_array(a); | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,9 @@ | ||
function out = ndims(fa) | ||
% Number of dimensions | ||
%_______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
|
||
% | ||
% $Id: ndims.m 1143 2008-02-07 19:33:33Z spm $ | ||
% Copyright (C) 2005-2022 Wellcome Centre for Human Neuroimaging | ||
|
||
|
||
out = size(fa); | ||
out = length(out); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,8 @@ | ||
function varargout = permute(varargin) | ||
% Can not be permuted. | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
% file_array objects can not be permuted | ||
%__________________________________________________________________________ | ||
|
||
% | ||
% $Id: permute.m 1143 2008-02-07 19:33:33Z spm $ | ||
% Copyright (C) 2005-2022 Wellcome Centre for Human Neuroimaging | ||
|
||
|
||
error('file_array objects can not be permuted.'); |
Oops, something went wrong.