MibDirContents

class controllers.MibDirContents

MIBDIRCONTENTS - controller for methods of the DirContents panel in MIB.

Constructor Summary
MibDirContents(mainCtrl, view, guiHandles, model)

MIBDIRCONTENTS - Constructor for the Directory Contents panel controller.

Syntax:
obj = MibDirContents(mainCtrl, view, guiHandles, model)

Initializes the controller for the Directory Contents panel, which manages file listing, filtering, and loading operations. Sets up all GUI callbacks for file operations, filter selection, and context menus.

Input Arguments:
  • mainCtrl - [controllers.MibController] handle to main MIB controller

  • view - [MibView] handle to main application view

  • guiHandles - [views.components.DirContents] handle to Directory Contents panel GUI component

  • model - [models.MibModel] handle to main MIB data model

Output Arguments:
  • obj - [MibDirContents] initialized controller instance

Initialization sequence:
  1. Stores references to main controller, view, model, and GUI handles

  2. Caches panel-specific handles for efficient access

  3. Initializes file filters dropdown with all registered file extensions

  4. Updates file list from current directory

  5. Wires callbacks for file list operations (combine, load, insert, color operations)

  6. Wires callbacks for file filters context menu (register/unregister extensions)

  7. Wires callbacks for file list context menu operations

  8. Wires callbacks for bioFormats reader selection

  9. Wires callback for file list update button

  10. Adds listeners for UpdateFileList events and panel region changes

See also

fileList_Callback, fileFilters_Callback, reader_Callback, fileList_ContextMenu, listenerUpdateFileList

Property Summary
UIFigure

handle to underlying UIFigure

gui

handle to the GUI of the ROI panel (views.components.Roi)

handles

struct of ROI panel handles (panel, listbox, buttons, …)

listeners

cell array of listeners

mibController

controllers.MibController

mibModel

models.MibModel

view

MibView (full app view)

Method Summary
fileFilters_Callback(hWidget, hData)

FILEFILTERS_CALLBACK - callback for selection of a file filter in the Directory contents panel,.

Syntax:
obj.fileFilters_Callback(hWidget, hData)

the parent widget is obj.handles.panels.dirContents.handles.fileFilters

Input Arguments:
  • hWidget - handle to the pressed widget

  • hData - handle to supporting ButtonPushedData class

fileFilters_ContextMenu(menuEntry, selectedData)

FILEFILTERS_CONTEXTMENU - callbacks for the context menu of the file filters widget.

Syntax:
obj.fileFilters_ContextMenu(menuEntry, selectedData)

(obj.handles.panels.activeDataset.handles.fileFilters)

Input Arguments:
  • menuEntry - handle to the pressed context menu entry, ‘matlab.ui.container.Menu’ class

  • selectedData - handle to the pressed ‘matlab.ui.eventdata.MenuSelectedData’ class, it can be used to find the button that has the context menu (selectedData.ContextObject)

Available menu options available from ‘menuEntry.Tag’: fileFiltersContextRegister - register a new extension and add it to the list of available filename extensions fileFiltersContextUnregister - remove extension from the list of available filename extensions

fileList_Callback(hWidget, hData)

FILELIST_CALLBACK - callback for double click on a filename in obj.handles.panels.dirContents.handles.fileList.

Syntax:
obj.fileList_Callback(hWidget, hData)
Input Arguments:
  • hWidget - handle to the pressed widget

  • hData - handle to supporting ButtonPushedData class

fileList_ContextMenu(menuEntry, selectedData)

FILELIST_CONTEXTMENU - Callback for context menu operations on the file list.

Syntax:
obj.fileList_ContextMenu(menuEntry, selectedData)

Handles context menu operations on files in the file list (obj.handles.fileList). Supports file loading, insertion, color channel operations, and file management (rename, delete, properties).

Input Arguments:
  • menuEntry - [matlab.ui.container.Menu] handle to the pressed context menu entry; menu operations are identified via menuEntry.Tag

  • selectedData - [matlab.ui.eventdata.MenuSelectedData] event data containing the source file list object (selectedData.ContextObject)

Output Arguments:

None

Supported menu operations (menuEntry.Tag):
  • 'fileListContextCombine' - combine selected files and open as a single dataset

  • 'fileListContextLoadPart' - load a portion (slice range) of a file

  • 'fileListContextLoadNth' - load every N-th file and combine into one dataset

  • 'fileListContextInsert' - insert selected files into the current dataset

  • 'fileListContextColorCombine' - combine selected files as separate color channels

  • 'fileListContextColorAdd' - add selected file(s) as a new color channel to current dataset

  • 'fileListContextColorAddNth' - add every N-th file as a new color channel

  • 'fileListContextRename' - rename the selected file

  • 'fileListContextDelete' - delete the selected file

  • 'fileListContextProps' - display file properties dialog

listenerUpdateFileList(src, evtData)

LISTENERUPDATEFILELIST - Listener callback to refresh the file list in the Directory Contents panel.

Syntax:
obj.listenerUpdateFileList(src, evtData)

Updates the file list widget (obj.handles.fileList) when the MibModel UpdateFileList event is triggered. Optionally highlights a specific filename in the list.

Input Arguments:
  • src - [models.MibModel] model object that triggered the event

  • evtData - [core.ToggleEventData] event data with optional parameters:

    • .Parameters.filename - (optional) [char] filename to highlight in the file list; when omitted, highlights the current dataset filename

Output Arguments:

None

Example 1 - update file list and highlight specific file:

Options.filename = 'sample_001.tif';
eventdata = core.ToggleEventData(Options);
notify(obj.mibModel, 'UpdateFileList', eventdata)

Example 2 - update file list with current dataset filename:

notify(obj.mibModel, 'UpdateFileList')
listener_updatePanelPosition(src, evtData)

LISTENER_UPDATEPANELPOSITION - Listener callback to adapt Directory Contents panel layout when docked position changes.

Syntax:
obj.listener_updatePanelPosition(src, evtData)

Dynamically reconfigures the grid layout and widget positions when the Directory Contents panel is docked to different regions (left, right, or bottom) of the AppContainer. Maintains optimized widget arrangement for each docking orientation.

Input Arguments:
  • src - [matlab.ui.container.Panel] the panel object whose Region property changed

  • evtData - [matlab.ui.eventdata.PropertyChangedData] property change event data

Output Arguments:

None

Layout configurations:

Left / Right docking - vertical arrangement (3 rows × 6 columns):
  • RowHeight = {'1x', 22, 2}

  • ColumnWidth = {34, 84, 40, '1x', 50, 18}

  • ColumnSpacing = 5, RowSpacing = 6, Padding = [8 8 8 8]

  • Row 1 - fileList spanning columns [1-6]

  • Row 2 - toolbar (5 widgets at columns 1, 2, 3, 5, 6; column 4 = spacer)

  • Row 3 - dividerPanel spanning columns [1-6]

Bottom docking - horizontal arrangement (6 rows × 3 columns):
  • ColumnWidth = {'1x', 130, 2}

  • RowHeight = {22, 22, 22, '1x', 22, 22}

  • ColumnSpacing = 5, RowSpacing = 6, Padding = [8 8 8 8]

  • Column 1 - fileList spanning rows [1-6]

  • Column 2 - toolbar (5 widgets at rows 1, 2, 3, 5, 6; row 4 = spacer)

  • Column 3 - dividerPanel spanning rows [1-6]

reader_Callback()

READER_CALLBACK - callback for the file-reader dropdown in the Directory Contents panel.

Syntax:
obj.reader_Callback()

Reads obj.view.handles.panels.dirContents.handles.reader (a dropdown with 'Default' | 'BioFormats' | 'OpenSlide'), updates the file-filter dropdown (fileFilters) with the extensions allowed for the active dataset type + selected reader, and refreshes the file list. Replaces the former binary bioFormats checkbox / bioFormats_Callback.

The BioFormats engine (MIB-Java vs MATLAB bioformatsread) is the separate global preference IO.BioFormats.Library - not selected here.

Input Arguments:

(none)

updateFileList_Callback(selectedFilename)

UPDATEFILELIST_CALLBACK - callback for click on the “obj.view.handles.panels.dirContents.handles.updateFileList” button to update.

Syntax:
obj.updateFileList_Callback(selectedFilename)

the list of files shown in “obj.view.handles.panels.dirContents.handles.fileList” using filters specified in “obj.view.handles.panels.dirContents.handles.fileFilters”

Input Arguments:
  • selectedFilename - (optional) char with the selected filename to highlight