ObjectSeparator

class controllers.ObjectSeparator

Bases: handle

OBJECTSEPARATOR - Controller for watershed-based object separation.

Performs seeded or standard watershed segmentation on the selection, mask, or model/labels layer. Supports 2D (current slice or full stack) and 3D modes with optional XY/Z binning.

Launch as GUI tool:

.. code-block:: matlab

    obj.mibController.startController('controllers.ObjectSeparator');

Launch in batch mode:

.. code-block:: matlab

    BatchOpt.Mode        = {'mode3dRadio', {'mode2dCurrentRadio','mode2dRadio','mode3dRadio','mode3dGridRadio'}};
    BatchOpt.ObjectSource = {'Selection', {'Selection','Mask','Model'}};
    obj.mibController.startController('controllers.ObjectSeparator', [], BatchOpt);

Trigger return of default options:

.. code-block:: matlab

    obj.mibController.startController('controllers.ObjectSeparator', [], NaN);
Constructor Summary
ObjectSeparator(mibModel, varargin)

OBJECTSEPARATOR - Constructor.

Syntax:

.. code-block:: matlab

    obj = ObjectSeparator(mibModel)
    obj = ObjectSeparator(mibModel, [], BatchOpt)
    obj = ObjectSeparator(mibModel, [], NaN)
Property Summary
BatchOpt

cell array of listener handles

listener

handle to the main MIB figure (used as parent for dialogs)

mibGUI

handle to the view (views.ObjectSeparatorGUI)

mibModel
view

handle to MibModel

Method Summary
static ViewListner_Callback2(~, evnt)

VIEWLISTNER_CALLBACK2 - Static listener guard; safe even after close.

addCallbacks()

ADDCALLBACKS - Wire all widget callbacks after view creation.

aspectRatio_Callback()

ASPECTRATIO_CALLBACK - Validate the aspect ratio text field.

checkDimensions(hObject)

CHECKDIMENSIONS - Validate a subarea text field (XSubarea, YSubarea, ZSubarea).

closeWindow()

CLOSEWINDOW - Destroy view, delete listeners, fire CloseEvent.

currentViewBtn_Callback()

CURRENTVIEWBTN_CALLBACK - Set X/Y subarea from the currently visible viewport.

doObjectSeparation()

DOOBJECTSEPARATION - Perform watershed-based object separation.

Reads configuration from obj.BatchOpt and runs a seeded or standard distance-transform watershed on the chosen layer (selection / mask / labels), storing the result back into the selection layer.

Four processing branches:

  • Seeded + 3D - full-volume seeded watershed

  • Seeded + 2D - per-slice seeded watershed

  • Standard + 3D - full-volume distance-transform watershed

  • Standard + 2D - per-slice distance-transform watershed

The function is a split method and is called from ObjectSeparator.m.

figureKeyPress(event)

FIGUREKEYPRESS - Forward key presses to the MIB main window shortcuts.

helpButton_Callback()

HELPBUTTON_CALLBACK - Open the object separation documentation page.

modeButtonGroup_Callback(event)

MODEBUTTONGROUP_CALLBACK - Sync mode button group selection into BatchOpt.

objectSourcePanel_Callback(event)

OBJECTSOURCEPANEL_CALLBACK - Sync object-source button group into BatchOpt.

resetDimsBtn_Callback()

RESETDIMSBTN_CALLBACK - Reset subarea fields to the full dataset extent.

returnBatchOpt(BatchOptOut)

RETURNBATCHOPT - Send BatchOpt defaults to mibBatchController.

seedSourcePanel_Callback(event)

SEEDSOURCEPANEL_CALLBACK - Sync seed-source button group into BatchOpt.

subAreaFromSelectionBtn_Callback()

SUBAREAFROMESELECTIONBTN_CALLBACK - Derive subarea bounds from the selection bounding box.

updateBatchOptFromGUI(hObject)

UPDATEBATCHOPTFROMGUI - Sync a single widget change into BatchOpt.

updateMaterialsBtn_Callback()

UPDATEMATERIALSBTN_CALLBACK - Repopulate material dropdowns from the current model.

updateWidgets()

UPDATEWIDGETS - Refresh all widgets from the current model state.

useSeedsCheck_Callback()

USESEEDSCHECK_CALLBACK - Toggle seeds panel vs reduce-oversegmentation checkbox.

validateBinning()

VALIDATEBINNING - Validate and normalise the Binning text field.

watershedSourceChanged_Callback(event)

WATERSHEDSOURCECHANGED_CALLBACK - Toggle intensity-widget visibility.