-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a36e230
commit 96677bf
Showing
5 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
function measureDistance_events(src,evt) | ||
evname = evt.EventName; | ||
handles=gui.gethand; | ||
switch(evname) | ||
case{'MovingROI'} | ||
roirect = round(src.Position); %Position of the ROI, specified as a 2-by-2 numeric matrix of the form [x1 y1; x2 y2]. Each row specifies the respective end-point of the line segment. | ||
calxy=gui.retr('calxy'); | ||
xposition=[roirect(1,1) roirect(2,1)]; | ||
yposition=[roirect(1,2) roirect(2,2)]; | ||
deltax=abs(xposition(1,1)-xposition(1,2)); | ||
deltay=abs(yposition(1,1)-yposition(1,2)); | ||
length=sqrt(deltax^2+deltay^2); | ||
alpha=(180/pi) *(acos(deltax/length)); | ||
beta=(180/pi) *(asin(deltax/length)); | ||
%src.Label = ['x: ' num2str(roirect(1)*calxy) ' y: ' num2str(roirect(2)*calxy) ' w: ' num2str(roirect(3)) ' h: ' num2str(roirect(4))]; | ||
if (gui.retr('calu')==1 || gui.retr('calu')==-1) && gui.retr('calxy')==1 | ||
set (handles.deltax, 'String', [num2str(deltax*calxy) ' [px]']); | ||
set (handles.deltay, 'String', [num2str(deltay*calxy) ' [px]']); | ||
set (handles.length, 'String', [num2str(length*calxy) ' [px]']); | ||
else | ||
set (handles.deltax, 'String', [num2str(deltax*calxy) ' [m]']); | ||
set (handles.deltay, 'String', [num2str(deltay*calxy) ' [m]']); | ||
set (handles.length, 'String', [num2str(length*calxy) ' [m]']); | ||
end | ||
set (handles.alpha, 'String', num2str(round(alpha,1))); | ||
set (handles.beta, 'String', num2str(round(beta,1))); | ||
end | ||
|
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info/> |
2 changes: 2 additions & 0 deletions
2
resources/project/Root.type.Files/+plot.type.File/1.type.DIR_SIGNIFIER.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info/> |
6 changes: 6 additions & 0 deletions
6
resources/project/Root.type.Files/+plot.type.File/measureDistance_events.m.type.File.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version='1.0' encoding='UTF-8'?> | ||
<Info> | ||
<Category UUID="FileClassCategory"> | ||
<Label UUID="design"/> | ||
</Category> | ||
</Info> |