DisplayAdjust¶
- class controllers.DisplayAdjust¶
Bases:
handleDISPLAYADJUST - Controller for the Display Adjustment dialog.
Available from Ribbon → Image → Adjust display. Provides per-channel min/max/gamma controls and a histogram view for the current dataset.
- Syntax:
obj.startController('controllers.DisplayAdjust');
- Constructor Summary
- DisplayAdjust(mibModel, varargin)¶
DISPLAYADJUST - Constructor for the DisplayAdjust controller.
- Syntax:
obj = DisplayAdjust(mibModel) obj = DisplayAdjust(mibModel, controllerHandle, BatchOptIn)- Input Arguments:
mibModel - handle to MibModel
varargin{1} - (optional) controller handle (reserved)
varargin{2} - (optional) BatchOpt struct; pass
NaNto return the default BatchOpt without opening the GUI
- Output Arguments:
obj - new DisplayAdjust controller instance
- Property Summary
- BatchOpt¶
cell array with handles to event listeners
- listener¶
handle to the view (core.ChildView wrapping views.DisplayAdjustGUI)
- mibModel¶
- updateTimer¶
a structure compatible with batch operation, see constructor
- view¶
handle to MibModel
- Method Summary
- static ViewListner_Callback2(~, evnt)¶
VIEWLISTNER_CALLBACK2 - Static listener dispatched by mibModel events.
- Syntax:
DisplayAdjust.ViewListner_Callback2(obj, src, evnt)
If the view window is no longer valid, deletes all listeners and returns silently.
- Input Arguments:
obj - handle to the DisplayAdjust controller instance
src - event source handle (unused)
evnt - event data;
evnt.EventNameidentifies the event
- Output Arguments:
(none)
- addCallbacks()¶
ADDCALLBACKS - Wire all widget callbacks; called once from the constructor.
- Syntax:
obj.addCallbacks()- Output Arguments:
(none)
- addFindBtnContextMenus()¶
ADDFINDBTNCONTEXTMENUS - Add right-click context menus to findMinBtn and findMaxBtn.
- Syntax:
obj.addFindBtnContextMenus()- Output Arguments:
(none)
- adjHelpBtn_Callback()¶
ADJHELPBTN_CALLBACK - Open the help page for the Display Adjustment dialog in a browser.
- Syntax:
obj.adjHelpBtn_Callback()- Output Arguments:
(none)
- applyBtn_Callback()¶
APPLYBTN_CALLBACK - Bake the current display range into all slices of the dataset.
- Syntax:
obj.applyBtn_Callback()- Output Arguments:
(none)
- autoHistCheck_Callback()¶
AUTOHISTCHECK_CALLBACK - Enable/disable automatic histogram refresh on slice/frame change.
- Syntax:
obj.autoHistCheck_Callback()- Output Arguments:
(none)
- closeWindow()¶
CLOSEWINDOW - Close the DisplayAdjust window and release all listeners.
- Syntax:
obj.closeWindow()- Output Arguments:
(none)
- colorChannelCombo_Callback()¶
COLORCHANNELCOMBO_CALLBACK - Update sliders when the user selects a different channel.
- Syntax:
obj.colorChannelCombo_Callback()- Output Arguments:
(none)
- figureWindowButtonDown_Callback()¶
FIGUREWINDOWBUTTONDOWN_CALLBACK - Dispatch mouse presses in the window.
- Syntax:
obj.figureWindowButtonDown_Callback()
Fires on every mouse press in the figure: a double-click (
SelectionType == 'open') over one of the three sliders resets it, any other press is forwarded toimHistClick_Callback(), which picks up the ones landing on the histogram row.- Output Arguments:
(none)
- findMaxBtn_Callback(colorCh, threshold)¶
FINDMAXBTN_CALLBACK - Detect maximum intensity; threshold (%) excluded from high end.
- Syntax:
obj.findMaxBtn_Callback(colorCh, threshold) maxval = obj.findMaxBtn_Callback(colorCh, threshold)- Input Arguments:
colorCh - (optional) channel index; default = selected channel
threshold - (optional) percentage of pixels to exclude from the high end (0-2.5);
NaNprompts the user for a custom value
- Output Arguments:
maxval - detected maximum intensity value(s)
- findMinBtn_Callback(colorCh, threshold)¶
FINDMINBTN_CALLBACK - Detect minimum intensity; threshold (%) excluded from low end.
- Syntax:
obj.findMinBtn_Callback(colorCh, threshold) minval = obj.findMinBtn_Callback(colorCh, threshold)- Input Arguments:
colorCh - (optional) channel index; default = selected channel
threshold - (optional) percentage of pixels to exclude from the low end (0-2.5);
NaNprompts the user for a custom value
- Output Arguments:
minval - detected minimum intensity value(s)
- gammaEdit_Callback()¶
GAMMAEDIT_CALLBACK - Clamp gamma to [0.1, 5], sync slider, update image.
- Syntax:
obj.gammaEdit_Callback()- Output Arguments:
(none)
- gammaSlider_Callback()¶
GAMMASLIDER_CALLBACK - Update gamma in viewPort, refresh image and histogram.
- Syntax:
obj.gammaSlider_Callback()- Output Arguments:
(none)
- gammaSlider_Changing(event)¶
GAMMASLIDER_CHANGING - Live update while the gamma slider is being dragged.
- Syntax:
obj.gammaSlider_Changing(event)- Input Arguments:
event -
ValueChangingDatafrom the AppDesignerValueChangingFcncallback;event.Valueholds the current slider value
- Output Arguments:
(none)
- getChannelIndex()¶
GETCHANNELINDEX - Return the 1-based channel index from colorChannelCombo.
- Syntax:
idx = obj.getChannelIndex()- Output Arguments:
idx - integer channel index; falls back to
1on mismatch
- imHistClick_Callback()¶
IMHISTCLICK_CALLBACK - Left-click sets the black point, right-click the white point.
- Syntax:
obj.imHistClick_Callback()
Dispatched from
figureWindowButtonDown_Callback()for every mouse press over the histogram row of the window. Clicks inside the plotted area pick the intensity under the pointer, while clicks on the empty areas to the left and to the right of the histogram move the point beyond the displayed range, which is the way to extend the range. Such a click shifts the point by at least 10% of the displayed range, so that the narrow margins beside the plot remain usable.- Output Arguments:
(none)
- maxEdit_Callback()¶
MAXEDIT_CALLBACK - Validate user entry in maxEdit spinner, then behave like slider.
- Syntax:
obj.maxEdit_Callback()- Output Arguments:
(none)
- maxSlider_Callback()¶
MAXSLIDER_CALLBACK - Enforce max > min, sync edit field, update image.
- Syntax:
obj.maxSlider_Callback()- Output Arguments:
(none)
- maxSlider_Changing(event)¶
MAXSLIDER_CHANGING - Live update while the max slider is being dragged.
- Syntax:
obj.maxSlider_Changing(event)- Input Arguments:
event -
ValueChangingDatafrom the AppDesignerValueChangingFcncallback;event.Valueholds the current slider value
- Output Arguments:
(none)
- minEdit_Callback()¶
MINEDIT_CALLBACK - Validate user entry in minEdit spinner, then behave like slider.
- Syntax:
obj.minEdit_Callback()- Output Arguments:
(none)
- minSlider_Callback()¶
MINSLIDER_CALLBACK - Enforce min < max, sync edit field, update image.
- Syntax:
obj.minSlider_Callback()- Output Arguments:
(none)
- minSlider_Changing(event)¶
MINSLIDER_CHANGING - Live update while the min slider is being dragged.
- Syntax:
obj.minSlider_Changing(event)- Input Arguments:
event -
ValueChangingDatafrom the AppDesignerValueChangingFcncallback;event.Valueholds the current slider value
- Output Arguments:
(none)
- resetSlider(whichSlider)¶
RESETSLIDER - Reset a slider to its natural limit or default.
- Syntax:
obj.resetSlider(whichSlider)- Input Arguments:
whichSlider -
'min','max', or'gamma''min'- sets minSlider toLimits(1)(0, or lower if viewport was negative)'max'- sets maxSlider toLimits(2)(maxInt, or higher if viewport exceeded it)'gamma'- resets gammaSlider to1
- Output Arguments:
(none)
- returnBatchOpt(BatchOptOut)¶
RETURNBATCHOPT - Return the BatchOpt structure to the Batch controller via the SyncBatch event.
- Syntax:
obj.returnBatchOpt() obj.returnBatchOpt(BatchOptOut)- Input Arguments:
BatchOptOut - (optional) local BatchOpt structure; when omitted,
obj.BatchOptis used
- Output Arguments:
(none)
- stretchCurrent_Callback()¶
STRETCHCURRENT_CALLBACK - Bake the current display range into the current slice only.
- Syntax:
obj.stretchCurrent_Callback()- Output Arguments:
(none)
- throttledShowImage()¶
THROTTLEDSHOWIMAGE - Restart the deferred-render timer on every slider event.
- Syntax:
obj.throttledShowImage()
ShowImage fires after a short delay following the last slider event, keeping the slider responsive during rapid dragging.
- Output Arguments:
(none)
- updateHist()¶
UPDATEHIST - Recompute histogram for the current slice and selected channel.
- Syntax:
obj.updateHist()- Output Arguments:
(none)
- updateSettings()¶
UPDATESETTINGS - Write slider values into viewPort for the active channel(s).
- Syntax:
obj.updateSettings()- Output Arguments:
(none)
- updateSliders()¶
UPDATESLIDERS - Synchronise slider ranges and edit-spinner values from viewPort.
- Syntax:
obj.updateSliders()- Output Arguments:
(none)
- updateWidgets()¶
UPDATEWIDGETS - Refresh all GUI widgets from the model.
- Syntax:
obj.updateWidgets()- Output Arguments:
(none)