-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
015b151
commit 0f9eada
Showing
1,775 changed files
with
57,726 additions
and
28,932 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,40 @@ | ||
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 | ||
%__________________________________________________________________________ | ||
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging | ||
|
||
% | ||
% $Id: cat.m 4136 2010-12-09 22:22:28Z guillaume $ | ||
% $Id: cat.m 7147 2017-08-03 14:07:01Z spm $ | ||
|
||
|
||
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,9 @@ | ||
function varargout = ctranspose(varargin) | ||
% Transposing not allowed | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging | ||
|
||
% | ||
% $Id: ctranspose.m 1143 2008-02-07 19:33:33Z spm $ | ||
% $Id: ctranspose.m 7147 2017-08-03 14:07:01Z 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,33 @@ | ||
function disp(obj) | ||
% Display a file_array object | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging | ||
|
||
% | ||
% $Id: disp.m 4136 2010-12-09 22:22:28Z guillaume $ | ||
% $Id: disp.m 7147 2017-08-03 14:07:01Z spm $ | ||
|
||
|
||
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,18 @@ | ||
function en = end(a,k,n) | ||
% Overloaded end function for file_array objects. | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging | ||
|
||
% | ||
% $Id: end.m 1143 2008-02-07 19:33:33Z spm $ | ||
% $Id: end.m 7147 2017-08-03 14:07:01Z 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,10 @@ | ||
function o = horzcat(varargin) | ||
% Horizontal concatenation of file_array objects | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging | ||
|
||
% | ||
% $Id: horzcat.m 1143 2008-02-07 19:33:33Z spm $ | ||
% $Id: horzcat.m 7147 2017-08-03 14:07:01Z spm $ | ||
|
||
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
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,10 @@ | ||
function l = length(x) | ||
% Overloaded length function for file_array objects | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging | ||
|
||
% | ||
% $Id: length.m 1143 2008-02-07 19:33:33Z spm $ | ||
% $Id: length.m 7147 2017-08-03 14:07:01Z spm $ | ||
|
||
|
||
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,15 @@ | ||
function b = loadobj(a) | ||
% loadobj for file_array class | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging | ||
|
||
% | ||
% $Id: loadobj.m 1544 2008-05-06 10:34:36Z guillaume $ | ||
% $Id: loadobj.m 7147 2017-08-03 14:07:01Z spm $ | ||
|
||
|
||
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,11 @@ | ||
function out = ndims(fa) | ||
% Number of dimensions | ||
%_______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
%__________________________________________________________________________ | ||
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging | ||
|
||
% | ||
% $Id: ndims.m 1143 2008-02-07 19:33:33Z spm $ | ||
% $Id: ndims.m 7147 2017-08-03 14:07:01Z spm $ | ||
|
||
|
||
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,10 @@ | ||
function varargout = permute(varargin) | ||
% Can not be permuted. | ||
% _______________________________________________________________________ | ||
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging | ||
% file_array objects can not be permuted | ||
%__________________________________________________________________________ | ||
% Copyright (C) 2005-2017 Wellcome Trust Centre for Neuroimaging | ||
|
||
% | ||
% $Id: permute.m 1143 2008-02-07 19:33:33Z spm $ | ||
% $Id: permute.m 7147 2017-08-03 14:07:01Z spm $ | ||
|
||
|
||
error('file_array objects can not be permuted.'); |
Oops, something went wrong.