BoundingBox

class controllers.BoundingBox

Bases: handle

BOUNDINGBOX - Controller for the Bounding Box editor dialog.

Available from Ribbon → Dataset → Bounding Box. Allows viewing and editing the spatial bounding box and voxel size of the current dataset.

Syntax:
obj.startController('controllers.BoundingBox');
Constructor Summary
BoundingBox(mibModel, varargin)
Property Summary
BatchOpt

a structure with the pixel size information

bb

a cell array with handles to listeners

listener

handle to the view / views.BoundingBoxGUI

mibModel
oldBB

matrix [xmin xmax ymin ymax zmin zmax] with current bounding box

pixSize

original bounding box before edits

view

handles to the model

Method Summary
static ViewListner_Callback2(src, evnt)

VIEWLISTNER_CALLBACK2 - Guard: clean up listeners and return silently if the view was closed.

Syntax:
BoundingBox.ViewListner_Callback2(obj, src, evnt)

If the view window was closed (e.g. via the X button before CloseRequestFcn was registered, or by external deletion), deletes all listeners and returns silently.

Input Arguments:
  • obj - handle to the BoundingBox controller instance

  • src - event source (handle to MibModel)

  • evnt - event data; evnt.EventName identifies the event

Output Arguments:

(none)

addCallbacks()

ADDCALLBACKS - Assign ValueChanged/ButtonPushed callbacks to all interactive widgets.

Syntax:
obj.addCallbacks()

Called once from the constructor after the view is created.

Output Arguments:

(none)

applyButton_Callback(batchModeSw)

APPLYBUTTON_CALLBACK - Apply the edited bounding box to the current dataset.

Syntax:
obj.applyButton_Callback()
obj.applyButton_Callback(batchModeSw)

When only Xmin/Ymin/Zmin are filled in, the bounding box is shifted without changing voxel size. When Xcenter/Ycenter are filled in, the dataset is positioned so that the given point becomes the centre of the XY extent. When Xmax/Ymax/Zmax are also supplied, the voxel size is recalculated from the total extent. StageRotationBias corrects for a known stage rotation (e.g. for 3View systems at 45 deg).

Input Arguments:
  • batchModeSw - (optional) logical, default: 0; set to 1 when called from batch mode to suppress GUI widget updates

Output Arguments:

(none)

closeButton_Callback()

CLOSEBUTTON_CALLBACK - Close the dialog without applying changes.

Syntax:
obj.closeButton_Callback()
Output Arguments:

(none)

closeWindow()

CLOSEWINDOW - Close the BoundingBox window and release all listeners.

Syntax:
obj.closeWindow()
Output Arguments:

(none)

helpButton_Callback()

HELPBUTTON_CALLBACK - Open the help page for the Bounding Box dialog in a browser.

Syntax:
obj.helpButton_Callback()
Output Arguments:

(none)

importBtn_Callback(batchModeSw)

IMPORTBTN_CALLBACK - Import bounding box information from the system clipboard.

Syntax:
obj.importBtn_Callback()
obj.importBtn_Callback(batchModeSw)

The clipboard is expected to contain key = value pairs, one per line, as exported by Amira / FEI microscope software. Recognised keys: ScaleX, ScaleY, ScaleZ, xPos, yPos, Z Position, Rotation.

Input Arguments:
  • batchModeSw - (optional) logical, default: 0; set to 1 when called from batch mode to suppress GUI widget updates

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 structure with Batch Options generated during the Apply callback; may contain more fields than obj.BatchOpt. When omitted, obj.BatchOpt is used.

Output Arguments:

(none)

updateBatchOptFromGUI(hObject, valueChangedData)

UPDATEBATCHOPTFROMGUI - Update obj.BatchOpt from a GUI widget value-change event.

Syntax:
obj.updateBatchOptFromGUI(hObject, valueChangedData)

Delegates to utils.updateBatchOptFromGUI_Shared, which is common to all tools compatible with batch mode.

Input Arguments:
  • hObject - handle to the widget that changed; in AppDesigner callbacks this is event.Source

  • valueChangedData - EventData object passed by AppDesigner ValueChangedFcn callbacks (not used directly here)

Output Arguments:

(none)

updateWidgets()

UPDATEWIDGETS - Refresh all widgets of the BoundingBox dialog from the current model state.

Syntax:
obj.updateWidgets()
Output Arguments:

(none)