0001 function [outVol] = GE_reorientImage(inVol, orient)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 [nX nY nZ] = size(inVol);
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 switch orient
0030 case 0
0031 fprintf('Warning: Orientation is undefined. Check your images!\n');
0032 outVol = inVol;
0033 outVol(:,1:nY,:) = outVol(:,nY:-1:1,:);
0034
0035 case 1
0036 outVol = permute(inVol,[3 1 2]);
0037 outVol(1:nZ,:,:) = outVol(nZ:-1:1,:,:);
0038 outVol(:,1:nX,:) = outVol(:,nX:-1:1,:);
0039 outVol(:,:,1:nY) = outVol(:,:,nY:-1:1);
0040
0041 case -1
0042 outVol = permute(inVol,[3 1 2]);
0043 outVol(:,1:nX,:) = outVol(:,nX:-1:1,:);
0044 outVol(:,:,1:nY) = outVol(:,:,nY:-1:1);
0045
0046 case 2
0047 outVol = inVol;
0048 outVol(:,1:nY,:) = outVol(:,nY:-1:1,:);
0049
0050 case -2
0051 outVol = inVol;
0052 outVol(:,1:nY,:) = outVol(:,nY:-1:1,:);
0053 outVol(:,:,1:nZ) = outVol(:,:,nZ:-1:1);
0054
0055 case 3
0056 outVol = permute(inVol,[1 3 2]);
0057 outVol(:,:,1:nY) = outVol(:,:,nY:-1:1);
0058 outVol(:,1:nZ,:) = outVol(:,nZ:-1:1,:);
0059
0060 case -3
0061 outVol = permute(inVol,[1 3 2]);
0062 outVol(:,:,1:nY) = outVol(:,:,nY:-1:1);
0063
0064 end
0065
0066 return