It's in spm_image.m (around line 175).
Best regards,
-John
case 'reorient'
% Reorient images
%----------------------------------------------------------------------
mat = spm_matrix(st.B);
if det(mat)<=0
spm('alert!','This will flip the images',mfilename,0,1);
end
[P, sts] = spm_select([1 Inf], 'image','Images to reorient');
if ~sts, return; else P = cellstr(P); end
Mats = zeros(4,4,numel(P));
spm_progress_bar('Init',numel(P),'Reading current orientations',...
'Images Complete');
for i=1:numel(P)
Mats(:,:,i) = spm_get_space(P{i});
spm_progress_bar('Set',i);
end
spm_progress_bar('Init',numel(P),'Reorienting images',...
'Images Complete');
for i=1:numel(P)
spm_get_space(P{i},mat*Mats(:,:,i));
spm_progress_bar('Set',i);
end
spm_progress_bar('Clear');
tmp = spm_get_space([st.vols{1}.fname ',' num2str(st.vols{1}.n)]);
if sum((tmp(:)-st.vols{1}.mat(:)).^2) > 1e-8
spm_image('Init',st.vols{1}.fname);
end
On 2 March 2012 09:43, [log in to unmask] <[log in to unmask]> wrote:
> Good morning spm experts,
>> Can you tell me the name of m-file that rotate the images by hitting
> '"Reorient
> images..." button.?
>> Looking forward to hearing from you.
>>
>> Kind Regards
>> Valentina
|