GenericDialog for Matlab
버전 1.0 (23.5 KB) 작성자:
David Legland
A simple generic dialog for Matlab, to quickly prompt a set of parameters.
GenericDialog
A simple generic dialog for Matlab, to quickly prompt a set of parameters. The design is based on the "GenericDialog" class from the ImageJ software, and mimics its functionalities.
The implementation is based on the GUILayout Toolbox, making the dialog easily resizable.
Example
% create a new dialog, and populate it with some fields
% each option is defined by a name, a default value, and optionnal settings
gd = GenericDialog('Create Image');
addTextField(gd, 'Name: ', 'New Image');
addNumericField(gd, 'Width: ', 320, 0);
addNumericField(gd, 'Height: ', 200, 0);
addChoice(gd, 'Type: ', {'uint8', 'uint16', 'double'}, 'uint8');
addCheckBox(gd, 'Display', true);
% display the dialog, and wait for user input
showDialog(gd);
% check if ok or canceled was clicked
if wasCanceled(gd)
return;
end
% retrieve the user inputs
name = getNextString(gd);
width = getNextNumber(gd);
height = getNextNumber(gd);
type = getNextString(gd);
display = getNextBoolean(gd);
% Create a new image based on user inputs, and display it if requested
img = zeros([height width], type);
if display
imshow(img);
title(name);
end
인용 양식
David Legland (2024). GenericDialog for Matlab (https://github.com/mattools/GenericDialog/releases/tag/v1.0), GitHub. 검색 날짜: .
MATLAB 릴리스 호환 정보
개발 환경:
R2023a
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux태그
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!버전 | 게시됨 | 릴리스 정보 | |
---|---|---|---|
1.0 |
|
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.
이 GitHub 애드온의 문제를 보거나 보고하려면 GitHub 리포지토리로 가십시오.