custom input dialog
- Parameters
-
varargin | Required Parameters for varargin:
- mibPath [optional] a cell string with a path to MIB installation, use to get it, or just an empty cell: {[]}
- prompts a cell array {n x 1} with the prompts for each edit field of the dialog
- defaultAns a cell array {n x 1} with the default answers for each edit. The following options for each element is available:
- ' or
some text - initialized as a text box with the provided default text
- another cell array - initialized as a combo box with entries taken from this cell array; Note! the last entry should be the default value to be selected!
- true/false - initialized as a checkbox
- dlg_title - a string with the name of the dialog
- options an optional structure with additional options .WindowStyle - a string, can be either
normal or modal (default). .PromptLines - a number or an array of numbers (equal to number of prompts) that define how many lines of text should be in the prompt field. Default is 1. .Title - a string with a text that will be displayed before the widgets, at the top of the window .TitleLines - a number that defines number of text lines reserved for the title .WindowWidth - a number scales the standard width of the dialog x times .Columns - an integer that defines number of columns .LastItemColumns - [optional] force the last entry to be on a single column, 1 or 0 .Focus - define index of the widget to get focused .okBtnText - text for the OK button .helpBtnText - text for the Help button .HelpUrl - URL to the help page, when provided a Help button is displayed, press of the button opens the url in a browser (requires http in the beginning of the url link). Alternatively, it can be a command to execute. .msgBoxOnly - logical, to mimic message box without input fields .Icon - string (question -default, celebrate , call4help , warning ), an icon to use
|
- Return values
-
answer | a cell array with the entered values, or empty, when cancelled |
selectedIndices | a vector with indices of selected options, mostly used for comboboxes |
Examples:
global mibPath;
prompts = {'Enter a text'; 'Select the option'; 'Are you sure?'; 'placeholder, remove text to make empty'; 'This is very very very very very very very very very very long prompt'};
defAns = {'my test string'; {'Option 1', 'Option 2', 'Option 3', 2}; true; NaN; []};
dlgTitle = 'multi line input diglog';
options.WindowStyle = 'normal';
options.PromptLines = [1, 1, 1, 1, 2];
options.Title = 'My test Input dialog';
options.TitleLines = 2;
options.WindowWidth = 1.2;
options.Columns = 2;
options.Focus = 1;
options.HelpUrl = 'http:\\mib.helsinki.fi';
options.LastItemColumns = 1;
options.msgBoxOnly = false;
options.Icon = 'question';
[answer, selIndex] =
mibInputMultiDlg({mibPath}, prompts, defAns, dlgTitle, options);
if isempty(answer); return; end
Referenced by mibModel.addFrame(), mibImage.addFrameToImage(), mibAlignmentController.AutomaticFeatureBasedAlignment(), mibDeepController.balanceClasses(), mibModel.colorChannelActions(), mibModel.contentAwareFill(), mibAlignmentController.continueBtn_Callback(), mibModel.contrastCLAHE(), mibModel.contrastNormalization(), mibImage.copyColorChannel(), mibModel.copySwapSlice(), mibDeepController.countLabels(), mibCropController.cropToBtn_Callback(), mibModel.deleteSlice(), mibMeasure.DistanceFreeFun(), mibDeepController.evaluateSegmentation(), mibDeepController.exportNetwork(), mibGraphcutController.exportSuperpixelsBtn_Callback(), mibDeepController.generate3DDeepLabV3Network(), mibDeepController.generateDeepLabV3Network(), mibCropObjectsController.generatePatches(), mibVolRenAppController.grabVolume(), mibVolRenController.grabVolume(), mibPreferencesController.guiScalingBtn_Callback(), mibDeepController.importNetwork(), mibGraphcutController.importSuperpixelsBtn_Callback(), mibModel.insertEmptySlice(), mibImage.invertColorChannel(), mibAnnotationsController.loadBtn_Callback(), mibLines3DController.loadBtn_Callback(), mibMeasureToolController.loadBtn_Callback(), mibDeepActivationsController.makeCollage(), mibModel.materialsActions(), mibModel.materialsSwapColors(), mibMeasureToolController.measureTable_cm(), mibController.menuDatasetScalebar_Callback(), mibController.menuFileExportImage_Callback(), mibController.menuFileImportImage_Callback(), mibController.menuFileRender_Callback(), mibController.menuImageToolsProjection_Callback(), mibController.menuMaskExport_Callback(), mibController.menuMaskImageReplace_Callback(), mibController.menuMaskImport_Callback(), mibController.menuModelAnn_Callback(), mibController.menuModelsImport_Callback(), mibVolRenController.menuSettingsSelectColormap_Callback(), mibController.mibAutoBrightnessBtn_Callback(), mibController.mibBrushPanelInterpolationSettingsBtn_Callback(), mibController.mibBufferToggleContext_Callback(), mibDeepTrainingProgressStructUpdateAxesLimits(), mibController.mibFileFilterPopup_cm(), mibController.mibFilesListbox_cm_Callback(), mibGenerateDefaultSegmentationPalette(), mibGetImageMetadata(), mibGetImages(), mibController.mibPixelInfo_Callback(), mibController.mibRemoveMaterialBtn_Callback(), mibRenderVolumeWithFiji(), mibController.mibSegmentationAnnotation(), mibController.mibSegmentationTable_cm_Callback(), mibController.mibSegmSAMPanel_Callbacks(), mibController.mibShowMilestoneDialog(), mibSubtractRunningAverage(), mibModel.modelExport(), mibPreferencesController.modelsColorsTable_cb(), mibPreferencesAppController.ModelsColorsTableContextMenuCallbacks(), mibGUI>menuHelp_Callbacks(), mibGUI>mibChangeLayerSliderContext_cb(), mibGUI>mibChangeTimeSliderContext_cb(), mibDeepAugmentSettingsController.previewAugmentations(), mibModel.resliceDataset(), mibImage.rotateColorChannel(), mibAnnotationsController.saveAnnotationsToFile(), mibLines3DController.saveBtn_Callback(), mibDeepController.saveCheckpointNetworkCheck(), mibImage.saveImageAsDialog(), mibImage.saveModel(), Lines3D.saveToFile(), mibBatchController.selectedActionTable_ContextCallback(), mibDeepController.sendReportsCallback(), mibDeepController.setActivationLayerOptions(), mibDeepController.setInputLayerSettings(), mibMeasure.setOptions(), mibDeepAugmentSettingsController.setPreviewAugmentationSettings(), mibDeepController.setSegmentationLayerOptions(), mibAnnotationsController.settingsBtn_Callback(), mibLines3DController.settingsBtn_Callback(), mibDeepController.setTrainingSettings(), mibModel.smoothImage(), mibDeepController.start(), mibWoundHealingAssayController.Stitch(), mibImage.swapColorChannels(), mibAnnotationsController.tableContextMenu_cb(), mibStatisticsController.tableContextMenu_cb(), mibDeepController.transferLearning(), mibAlignmentController.updateAutomaticOptions(), mibDeepController.updateDynamicMaskSettings(), mibRoiRegion.updateOptions(), mibImage.updatePixSizeResolution(), and mibLines3DController.visualizeBtn_Callback().