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