On Mon, 14 Feb 2005 11:42:50 -0800, Paul Macey <[log in to unmask]> wrote:
My apologies - I found an error in my previous post; below is a correction
to the "combinerepeatssimilar" function in my previous posting:
function combinerepeatssimilar( P )
% COMBINEREPEATSSIMILAR
% Combine same-subject repeats of high-resolution images collected at same
in-plane resolution and
% slice slice thickness.
if nargin == 0
P = spm_get(Inf,'IMAGE',{'Select repeated images'});
elseif ~iscell(P)
msgbox('Input to combinerepeatssimilar must be cell array of file names.')
disp('Combine repeats cannot continue.')
return
end
% Set realign / affine transform parameters
flags.estimate.quality = 1; % Highest quality
flags.estimate.weight = 0; % No weighting
flags.estimate.wrap = [0 0 0];
flags.estimate.interp = 4;
% These next two parameters are the critical ones
flags.estimate.fwhm = 0.1; % Reduce smoothing to almost none (cannot be
0); default 5
flags.estimate.sep = 2; % Reduce separation in whch to same images;
(default 4). If you run out of memory or processing takes too long, increase
this.
% Co-register the files
spm_realign(char(P),flags.estimate);
% Set reslice parameters
flags.write.mask = 1;
flags.write.interp = 7;
flags.write.wrap = [0 0 0];
flags.write.mean = 1; % create mean image
flags.write.which = 0; % Do not reslice individual images
% Reslice and create mean image in first study folder
spm_reslice(char(P),flags.write);
|