Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
2 changes: 1 addition & 1 deletion ExtractionScripts/BuildROI/BuildSphere_mc_template.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

addpath(fullfile(mcRoot,'matlabScripts'))
addpath(fullfile(mcRoot,'ExtractionScripts','BuildROI'))
addpath(fullfile(mcRoot,'spm8'))
addpath(fullfile(mcRoot,'SPM','SPM8','spm8Legacy'))



Expand Down
2 changes: 1 addition & 1 deletion ExtractionScripts/BuildROI/Img2Mat_mc_template.m
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@

addpath(fullfile(mcRoot,'matlabScripts'))
addpath(fullfile(mcRoot,'ExtractionScripts','BuildROI'))
addpath(fullfile(mcRoot,'spm8'))
addpath(fullfile(mcRoot,'SPM','SPM8','spm8Legacy'))


Img2Mat_central
Expand Down
2 changes: 1 addition & 1 deletion ExtractionScripts/ExtractROI/ExtractROI_mc_template.m
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@

addpath(fullfile(mcRoot,'matlabScripts'))
addpath(fullfile(mcRoot,'ExtractionScripts','ExtractROI'))
addpath(fullfile(mcRoot,'spm8'))
addpath(fullfile(mcRoot,'SPM','SPM8','spm8Legacy'))


ExtractROI_central
2 changes: 1 addition & 1 deletion FirstLevel/FirstLevel_mc_template.m
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@

addpath(fullfile(mcRoot,'matlabScripts'))
addpath(fullfile(mcRoot,'FirstLevel'))
addpath(fullfile(mcRoot,'spm8'))
addpath(fullfile(mcRoot,'SPM','SPM8','spm8Legacy'))


Processing = [0 1];
Expand Down
2 changes: 1 addition & 1 deletion FirstLevel/Preprocess_mc_template.m
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@

addpath(fullfile(mcRoot,'matlabScripts'))
addpath(fullfile(mcRoot,'FirstLevel'))
addpath(fullfile(mcRoot,'spm8'))
addpath(fullfile(mcRoot,'SPM','SPM8','spm8Legacy'))



Expand Down
2 changes: 1 addition & 1 deletion MotionRegressors/MVMT_collapse_mc_template.m
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@

addpath(fullfile(mcRoot,'matlabScripts'))
addpath(fullfile(mcRoot,'MotionRegressors'))
addpath(fullfile(mcRoot,'spm8'))
addpath(fullfile(mcRoot,'SPM','SPM8','spm8Legacy'))



Expand Down
2 changes: 1 addition & 1 deletion MotionSummary/MotionSummary_mc_template.m
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@

addpath(fullfile(mcRoot,'matlabScripts'))
addpath(fullfile(mcRoot,'MotionSummary'))
addpath(fullfile(mcRoot,'spm8'))
addpath(fullfile(mcRoot,'SPM','SPM8','spm8Legacy'))



Expand Down
2 changes: 1 addition & 1 deletion PhysioSummary/PhysioSummary_mc_template.m
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@

addpath(fullfile(mcRoot,'matlabScripts'))
addpath(fullfile(mcRoot,'PhysioSummary'))
addpath(fullfile(mcRoot,'spm8'))
addpath(fullfile(mcRoot,'SPM','SPM8','spm8Legacy'))



Expand Down
2 changes: 1 addition & 1 deletion QualityChecks/CheckReg/CheckReg_mc_template.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
addpath(fullfile(mcRoot,'matlabScripts'))
addpath(fullfile(mcRoot,'QualityChecks','CheckReg'))
addpath(fullfile(mcRoot,'QualityChecks','CheckWarp'))
addpath(fullfile(mcRoot,'spm8'))
addpath(fullfile(mcRoot,'SPM','SPM8','spm8Legacy'))



Expand Down
2 changes: 1 addition & 1 deletion QualityChecks/CheckWarp/CheckWarp_mc_template.m
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
addpath(fullfile(mcRoot,'matlabScripts'))
addpath(fullfile(mcRoot,'QualityChecks','CheckReg'))
addpath(fullfile(mcRoot,'QualityChecks','CheckWarp'))
addpath(fullfile(mcRoot,'spm8'))
addpath(fullfile(mcRoot,'SPM','SPM8','spm8Legacy'))


CheckWarp_central
51 changes: 51 additions & 0 deletions SPM/SPM5/@file_array/Contents.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
%
% File Array Object
%
% file_array - create a file_array
% horzcat - horizontal concatenation
% vertcat - vertical concatenation
% size - size of array
% length - length of longest dimension
% subsref - subscripted reference
% end - last index in an indexing expression
% resize - resize (but only of simple file_array structures)
%
% other operations are unlikely to work.
%
% Example usage.
%
% % Create a file array object by mapping test_le.img
% % to a 256x256x100 array, of datatype float32, stored
% % in a little-endian way starting at byte 0.
% fa0 = file_array('test_le.img',[256 256 100], 'FLOAT32-LE',0)
%
% % Creating an object from test_be.img, but skipping
% % the first plane of data. Data stored as big-endian
% fa1 = file_array('test_be.img',[256 256 99], 'FLOAT32-BE',4*256*256)
%
% % Reshape procedure
% fa2 = reshape(fa1,[128 2 256 99])
%
% % Concatenation
% fa3 = [[fa0 fa0]; [fa0 fa0]]
% fa4 = cat(3,fa0,fa1)
%
% % Note that reshape will not work on the above
% % concatenated objects
%
% % Accessing values from the objects
% img = fa1(:,:,40);
% pixval = fa4(50,50,:);
% small = fa1(1:2:end,1:2:end,40);
%
% % Determining dimensions
% size(fa4)
% size(fa2)
% length(fa0)
% _______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: Contents.m 1601 2008-05-12 14:11:02Z guillaume $


40 changes: 40 additions & 0 deletions SPM/SPM5/@file_array/cat.m
Original file line number Diff line number Diff line change
@@ -0,0 +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) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: cat.m 253 2005-10-13 15:31:34Z guillaume $


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,
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(:)),
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;
dpos = dpos + d(i,dr);
tmp{i} = svi;
else
error(['Conversion to file_array from ' class(vi) ' is not possible.']);
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 = class(o,'file_array');
end;
9 changes: 9 additions & 0 deletions SPM/SPM5/@file_array/ctranspose.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
function varargout = ctranspose(varargin)
% Transposing not allowed
% _______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: ctranspose.m 253 2005-10-13 15:31:34Z guillaume $

error('file_array objects can not be transposed.');
34 changes: 34 additions & 0 deletions SPM/SPM5/@file_array/disp.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
function disp(obj)
% Display a file_array object
% _______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: disp.m 253 2005-10-13 15:31:34Z guillaume $


if numel(struct(obj))>1,
fprintf(' %s object: ', class(obj));
sz = size(obj);
if length(sz)>4,
fprintf('%d-D\n',length(sz));
else
for i=1:(length(sz)-1),
fprintf('%d-by-',sz(i));
end;
fprintf('%d\n',sz(end));
end;
else
display(mystruct(obj))
end;
return;
%=======================================================================

%=======================================================================
function t = mystruct(obj)
fn = fieldnames(obj);
for i=1:length(fn)
t.(fn{i}) = subsref(obj,struct('type','.','subs',fn{i}));
end;
return;
%=======================================================================
14 changes: 14 additions & 0 deletions SPM/SPM5/@file_array/display.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function display(obj)
% Display a file_array object
% _______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: display.m 253 2005-10-13 15:31:34Z guillaume $


disp(' ');
disp([inputname(1),' = '])
disp(' ');
disp(obj)
disp(' ')
12 changes: 12 additions & 0 deletions SPM/SPM5/@file_array/double.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function out = double(fa)
% Convert to double precision
% FORMAT double(fa)
% fa - a file_array
% _______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: double.m 253 2005-10-13 15:31:34Z guillaume $

out = double(numeric(fa));

17 changes: 17 additions & 0 deletions SPM/SPM5/@file_array/end.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
function en = end(a,k,n)
% Overloaded end function for file_array objects.
% _______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: end.m 253 2005-10-13 15:31:34Z guillaume $

dim = size(a);
if k>length(dim)
en = 1;
else
if n<length(dim),
dim = [dim(1:(n-1)) prod(dim(n:end))];
end;
en = dim(k);
end;
16 changes: 16 additions & 0 deletions SPM/SPM5/@file_array/fieldnames.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
function t = fieldnames(obj)
% Fieldnames of a file-array object
% _______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: fieldnames.m 253 2005-10-13 15:31:34Z guillaume $

t = {...
'fname'
'dim'
'dtype'
'offset'
'scl_slope'
'scl_inter'
};
39 changes: 39 additions & 0 deletions SPM/SPM5/@file_array/file_array.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
function a = file_array(varargin)
% Function for creating file_array objects.
% FORMAT a = file_array(fname,dim,dtype,offset,scl_slope,scl_inter)
% a - file_array object
% fname - filename
% dim - dimensions (default = [0 0] )
% dtype - datatype (default = 'uint8-le')
% offset - offset into file (default = 0)
% scl_slope - scalefactor (default = 1)
% scl_inter - DC offset, such that dat = raw*scale + inter (default = 0)
% _______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: file_array.m 315 2005-11-28 16:48:59Z john $


if nargin==1
if isstruct(varargin{1}),
a = class(varargin{1},'file_array');
return;
elseif isa(varargin{1},'file_array'),
a = varargin{1};
return;
end;
end;
a = struct('fname','','dim',[0 0],'dtype',2,...
'be',0,'offset',0,'pos',[],'scl_slope',[],'scl_inter',[]);
%a = class(a,'file_array');

if nargin>=1, a = fname(a,varargin{1}); end;
if nargin>=2, a = dim(a,varargin{2}); end;
if nargin>=3, a = dtype(a,varargin{3}); end;
if nargin>=4, a = offset(a,varargin{4}); end;
if nargin>=5, a = scl_slope(a,varargin{5}); end;
if nargin>=6, a = scl_inter(a,varargin{6}); end;

a.pos = ones(size(a.dim));
a = class(a,'file_array');
11 changes: 11 additions & 0 deletions SPM/SPM5/@file_array/horzcat.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function o = horzcat(varargin)
% Horizontal concatenation of file_array objects
% _______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: horzcat.m 253 2005-10-13 15:31:34Z guillaume $

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

11 changes: 11 additions & 0 deletions SPM/SPM5/@file_array/length.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function l = length(x)
% Overloaded length function for file_array objects
% _______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: length.m 253 2005-10-13 15:31:34Z guillaume $


l = max(size(x));

14 changes: 14 additions & 0 deletions SPM/SPM5/@file_array/loadobj.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function b = loadobj(a)
% loadobj for file_array class
% _______________________________________________________________________
% Copyright (C) 2008 Wellcome Trust Centre for Neuroimaging

%
% $Id: loadobj.m 1746 2008-05-28 17:43:42Z guillaume $

if isa(a,'file_array')
b = a;
else
a = rmfield(a, 'permission');
b = file_array(a);
end
12 changes: 12 additions & 0 deletions SPM/SPM5/@file_array/ndims.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
function out = ndims(fa)
% Number of dimensions
%_______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: ndims.m 253 2005-10-13 15:31:34Z guillaume $


out = size(fa);
out = length(out);

14 changes: 14 additions & 0 deletions SPM/SPM5/@file_array/numel.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function t = numel(obj)
% Number of simple file arrays involved.
% _______________________________________________________________________
% Copyright (C) 2005 Wellcome Department of Imaging Neuroscience

%
% $Id: numel.m 253 2005-10-13 15:31:34Z guillaume $


% Should be this, but it causes problems when accessing
% obj as a structure.
%t = prod(size(obj));

t = numel(struct(obj));
Loading