Skip to content

Commit 1dc7122

Browse files
committed
update code comments
1 parent 60c6583 commit 1dc7122

File tree

2 files changed

+17
-18
lines changed

2 files changed

+17
-18
lines changed

GenericDialog.m

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,19 +26,18 @@
2626
% type = getNextString(gd);
2727
% display = getNextBoolean(gd);
2828
%
29-
% % Creates new image, and displays if requested
30-
% img = Image.create([width height], type);
31-
% img.name = name;
29+
% img = zeros([height width], type);
3230
% if display
33-
% show(img); title(name);
31+
% imshow(img);
32+
% title(name);
3433
% end
3534
%
3635
% See also
37-
%
36+
% inputdlg, figure, uix.VBox
3837

3938
% ------
4039
% Author: David Legland
41-
% e-mail: david.legland@inra.fr
40+
% e-mail: david.legland@inrae.fr
4241
% Created: 2014-04-18, using Matlab 7.9.0.529 (R2009b)
4342
% Copyright 2014 INRA - Cepia Software Platform.
4443

demo_GenericDialog.m

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
%GO run script for GenericDialog class
1+
%DEMO_GENERICDIALOG Demo script for the GenericDialog class.
22
%
33
% output = go(input)
44
%
@@ -10,44 +10,44 @@
1010
%
1111
% ------
1212
% Author: David Legland
13-
% e-mail: david.legland@grignon.inra.fr
13+
% e-mail: david.legland@inrae.fr
1414
% Created: 2011-10-18, using Matlab 7.9.0.529 (R2009b)
1515
% Copyright 2011 INRA - Cepia Software Platform.
1616

1717
% clean up
1818
close all
1919
clear classes %#ok<CLCLS>
2020

21-
% creates a new dialog, and populate it with some fields
21+
% Creates a new dialog, and populate it with some fields.
22+
% Each option is defined by a name, a default value, and optionnally some
23+
% settings.
2224
gd = GenericDialog('Create Image');
2325
addTextField(gd, 'Name: ', 'New Image');
2426
addNumericField(gd, 'Width: ', 320, 0);
2527
addNumericField(gd, 'Height: ', 200, 0);
2628
addChoice(gd, 'Type: ', {'uint8', 'uint16', 'double'}, 'uint8');
2729
addCheckBox(gd, 'Display', true);
28-
% pack(gd);
2930

30-
% display the dialog, and wait for user
31+
% display the dialog, and wait for user input
3132
showDialog(gd);
3233

33-
% check if ok or cancel was clicked
34+
% check if ok or canceled was clicked
3435
if wasCanceled(gd)
3536
return;
3637
end
3738

38-
39+
% retrieve options given by user
3940
name = gd.getNextString();
4041
disp(name);
41-
4242
width = getNextNumber(gd);
4343
height = getNextNumber(gd);
4444
disp([width height]);
4545
type = getNextString(gd);
46-
display = getNextBoolean(gd);
46+
displayFlag = getNextBoolean(gd);
4747

48-
% Create new image, and display if requested
49-
img = zeros([height width ], type);
50-
if display
48+
% Create a new image, and display if requested
49+
img = zeros([height width], type);
50+
if displayFlag
5151
imshow(img);
5252
title(name);
5353
end

0 commit comments

Comments
 (0)