forked from nepacheco/Continuum-Image-Analyzer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRotateImage.m
More file actions
38 lines (27 loc) · 781 Bytes
/
RotateImage.m
File metadata and controls
38 lines (27 loc) · 781 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
function [newImage] = RotateImage(origImage, varargin)
%ROTATEIMAGE Takes in an image and allows prompts user to rotate in 90deg
%increments
% 'Axis' - Optional Argument which is the axis to display the image one
%****** INPUT PARSING *********************
previousRegions = [];
p = inputParser();
addOptional(p,'axis',0);
parse(p,origImage,varargin{:});
ax = p.Results.axis;
if ax == 0
ax = gca;
end
%****************************************
I = imshow(origImage,'Parent',ax);
newImage = origImage;
while(1)
choice = listdlg('PromptString',{'Rotate Image by 90deg?'},...
'ListString',{'Yes','No'});
if choice==1
newImage = imrotate(newImage, 90);
I = imshow(newImage,'Parent',ax);
else
break;
end
end
end