Dear all
this is a bit lazy of me I know but can someone look at this code
below (I can't remember who wrote it originally, one of the mailbase
users?) and tell me which bit I change to make it flip the image top
to bottom instead of left to right
Cheers
Anna
% FORMAT spm_flip
% flips images from right to left
%
________________________________________________________________________
___
% get images
%-----------------------------------------------------------------------
----
P = spm_get(Inf,'*.img',{'select images for flipping'});
% flip
%-----------------------------------------------------------------------
----
spm_progress_bar('Init',length(P),'flipping','');
for i = 1:length(P)
[p,f,e,v] = fileparts(P{i});
Vi = spm_vol(P{i});
Vo = Vi;
Vo.fname = fullfile(p,['f' f e]);
Vo.descrip = [Vo.descrip ' - flipped'];
Vo = spm_imcalc(Vi,Vo,'flipud(i1)');
% progress
%-------------------------------------------------------------------
spm_progress_bar('Set',i);
end
spm_progress_bar('Clear')
|