CropDataset

class controllers.CropDataset

Bases: handle

CROPDATASET - @type CropDataset class is responsible for showing the dataset.

crop window, available from MIB Ribbon Dataset Crop

obj.startController('controllers.CropDataset'); // as GUI tool
Constructor Summary
CropDataset(mibModel, varargin)

CROPDATASET - obj = CropDataset(mibModel, varargin).

Syntax:
obj = CropDataset(mibModel)
obj = CropDataset(mibModel, mibController)
obj = CropDataset(mibModel, mibController, BatchOpt)

Constructor of the CropDataset controller

Input Arguments:
  • mibModel - handle to MibModel

  • varargin{1} - (optional) handle to controllers.MibController (canonical, split-panel safe) OR an axes handle (legacy) OR a BatchOpt struct / NaN (batch mode with no controller)

  • varargin{2} - (optional) BatchOpt struct / NaN when varargin{1} is a controller or axes handle

Usage:

Example 1:

obj.startController('controllers.CropDataset');

Example 2:

obj.startController('controllers.CropDataset', obj);

Example 3:

obj.startController('controllers.CropDataset', obj, BatchOpt);
Property Summary
BatchOpt

‘Interactive’,’Manual’,’ROI’

Type:

a string with the selected crop mode

batchProcessingSwitch

a structure compatible with batch operation, see details in the constructor

currentMode

handle to the main image axes of MIB (needed for Interactive mode). Optional fallback; prefer mibController-based resolution when available

listener

handle to the view / views.CropDatasetGUI

mibController

a cell array with position of the ROI for crop obj.roiPos{1} = [1, width, 1, height, 1, depth, 1, time];

mibImageAxes

handle to controllers.MibController - used to resolve the active image axes dynamically (split-panel safe); see cropBtn_Callback

mibModel
roiPos

a cell array with handles to listeners

view

handles to the model

Method Summary
OutputType_Callback(hObject)

OUTPUTTYPE_CALLBACK - callback for the OutputType dropdown.

Syntax:
obj.OutputType_Callback(hObject)

Toggles ZarrPyramidLevel enable based on the selected output type. ZarrPyramidLevel is only applicable for BigData → Standard export.

SelectROI_Callback()

SELECTROI_CALLBACK - callback for change of the SelectROI dropdown.

Syntax:
obj.SelectROI_Callback()
static ViewListner_Callback2(src, evnt)

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

Syntax:
obj.ViewListner_Callback2(src, evnt)
ZarrPyramidLevel_Callback(hObject)

ZARRPYRAMIDLEVEL_CALLBACK - callback for the Zarr pyramid level dropdown.

Syntax:
obj.ZarrPyramidLevel_Callback(hObject)
addCallbacks()

ADDCALLBACKS - assign callbacks to all interactive widgets; called once from.

Syntax:
obj.addCallbacks()

the constructor after the view is created

closeWindow()

CLOSEWINDOW - closing CropDataset window.

Syntax:
obj.closeWindow()
cropBtn_Callback(hObject)

CROPBTN_CALLBACK - perform the crop operation.

Syntax:
obj.cropBtn_Callback()
obj.cropBtn_Callback(hObject)
Input Arguments:
  • hObject - (optional) handle to the pressed button (cropBtn or croptoBtn)

cropToBtn_Callback()

CROPTOBTN_CALLBACK - select a destination buffer and perform crop there.

Syntax:
obj.cropToBtn_Callback()
editboxes_Callback()

EDITBOXES_CALLBACK - update obj.BatchOpt and obj.roiPos from the Width/Height/Depth/Time fields.

Syntax:
obj.editboxes_Callback()
helpButton_Callback()

HELPBUTTON_CALLBACK - open the help page for the Crop Dataset dialog.

Syntax:
obj.helpButton_Callback()
radio_Callback(hObject)

RADIO_CALLBACK - callback for selection of crop mode.

Syntax:
obj.radio_Callback(hObject)
Input Arguments:
  • hObject - handle to the selected radio button (Interactive, Manual, or ROI)

resetBtn_Callback()

RESETBTN_CALLBACK - reset crop fields to full image dimensions.

Syntax:
obj.resetBtn_Callback()
returnBatchOpt(BatchOptOut)

RETURNBATCHOPT - return structure with Batch Options via the ‘SyncBatch’ event.

Syntax:
obj.returnBatchOpt()
obj.returnBatchOpt(BatchOptOut)
Input Arguments:
  • BatchOptOut - (optional) local BatchOpt to send; defaults to obj.BatchOpt

selectAreaBtn_Callback()

SELECTAREABTN_CALLBACK - pick the crop area on the image and put it into the edit boxes.

Syntax:
obj.selectAreaBtn_Callback()

Uses the same rectangle drawing tool as the Interactive crop mode (obj.drawCropArea), but instead of cropping fills the Width, Height and Depth edit boxes with the coordinates of the drawn rectangle. Only the two dimensions defined by the shown orientation are updated, the third one is left untouched. After a successful selection the dialog is switched to the Manual mode, so that the Crop and Crop to… buttons use the new coordinates.

selectZarrLevel()

SELECTZARRLEVEL - update Zarr downsampling info label based on the selected pyramid level.

Syntax:
obj.selectZarrLevel()
updateBatchOptFromGUI(hObject)

UPDATEBATCHOPTFROMGUI - update obj.BatchOpt from a GUI widget.

Syntax:
obj.updateBatchOptFromGUI(hObject)
Input Arguments:
  • hObject - handle to the widget that changed

updateWidgets()

UPDATEWIDGETS - update all widgets of the current window.

Syntax:
obj.updateWidgets()