% program ROTATIM allows displayed colored IMage to be ROTATed % rotation parameters stored, D. Bakewell Tu/4/5/1999 floop = 2 while floop == 2; switch fauto case 1 fcolor=menu('Polychrome :','yes - all colors','no - monochrome') case 2 fcolor=invar(2) end % end switch fauto switch fcolor % case 1 % switch fcolor=1 switch fauto case 1 imshow(mapA) hold on message=['Please place cursor X on electrd edges & decide if image needs rotating'] [xi,yi]=ginput(1) frotate=menu('Rotate image?','yes','no') case 2 frotate=invar(3) end % end switch fauto switch frotate case 1 switch fauto case 1 rotang=input('enter est. rotation angle degrees + for CCW; - for CW): ') hold off close message=['Image is now being rotated'] rotimag=imrotate(mapA,rotang,'nearest','crop'); imshow(rotimag) [xi,yi]=ginput(1) floop=menu('finished rotation?','yes','no') case 2 rotang=invar(4) floop=1 end % end switch auto case 2 % no rotation rotimag=mapA floop=1 end % end frotate (Flag ROTATE) % case 2 % switch fcolor=2 switch fauto case 1 imshow(input2) hold on message=['Please place cursor X on electrd edgs, decide if image needs rotating & CLICK'] [xi,yi]=ginput(1) frotate=menu('Rotate image?','yes','no') case 2 frotate=invar(3) end % end switch fauto switch frotate case 1 switch fauto case 1 rotang=input('enter est. rotation angle degrees + for CCW; - for CW): ') message=['Image is now being rotated .... '] hold off close rotimag=imrotate(input2,rotang,'nearest','crop'); imshow(rotimag) [xi,yi]=ginput(1) floop=menu('finished rotation?','yes','no') case 2 rotang=invar(4) rotimag=imrotate(input2,rotang,'nearest','crop'); imshow(rotimag) floop=1 end % end switch fauto case 2 % no rotation floop=1 end % frotate (Flag ROTATE) end % end switch fcolor end % end while floop close close