ChunkingImport

class controllers.ChunkingImport

Bases: handle

CHUNKINGIMPORT - Reassembles a set of chopped image tiles back into a single dataset.

Two modes:
  • New Stack - auto-detects the tile grid from filenames (_Z##-X##-Y## pattern) and assembles a new dataset.

  • Fuse to Existing - positions each tile in the currently open dataset using its bounding-box metadata (optional pixel offsets).

Constructor Summary
ChunkingImport(mibModel, varargin)

CHUNKINGIMPORT - constructor.

Syntax:
obj = ChunkingImport(mibModel)
obj = ChunkingImport(mibModel, modeName)
obj = ChunkingImport(mibModel, [], BatchOpt)
obj = ChunkingImport(mibModel, [], NaN)
Input Arguments:
  • mibModel - handle to MibModel

  • varargin{1} - (optional) char, mode the dialog opens in: 'New Stack' or 'Fuse to Existing'; empty keeps the default ('Fuse to Existing'). Used only by the GUI path; batch mode takes the mode from BatchOpt.Mode

  • varargin{2} - (optional) BatchOpt struct or NaN (batch mode)

For batch mode, supply BatchOpt.InputDirectory and BatchOpt.FilePattern to auto-discover tile files instead of selecting them interactively.

Usage:

Example 1 - open the dialog in the default mode:

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

Example 2 - open the dialog in the New Stack mode:

obj.mibController.startController('controllers.ChunkingImport', 'New Stack');
Property Summary
BatchOpt

cell array of full-path filenames selected for import

filenames

cell array of listener handles

listener

handle to ChunkingImportGUI

mibModel
view

handle to MibModel

Method Summary
static ViewListner_Callback2(~, evnt)

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

addCallbacks()

ADDCALLBACKS - Wire GUI widget callbacks.

closeWindow()

CLOSEWINDOW - Close the dialog and clean up listeners.

combineBtn_Callback(batchModeSwitch)

COMBINEBTN_CALLBACK - Reassemble the selected tile files.

Syntax:
obj.combineBtn_Callback()
obj.combineBtn_Callback(batchModeSwitch)
Input Arguments:
  • batchModeSwitch - (optional) logical; true when called from batch mode

combineModeChanged_Callback(hObject)

COMBINEMODECHANGED_CALLBACK - Toggle offset fields with mode.

helpBtn_Callback()

HELPBTN_CALLBACK - show documentation

loadModels(filename)

LOADMODELS - Load model/label data from a file.

Syntax:
R = obj.loadModels(filename)
Input Arguments:
  • filename - (char) full path to the label file

Output Arguments:
  • R - struct with fields:

    • .imOut - label volume as uint8 [H, W, D]

    • .materialNames - (optional) cell array of material names

    • .materialColors - (optional) [N×3] RGB colors 0-1

    • .BoundingBox - (optional) [xmin xmax ymin ymax zmin zmax]

    • .labelText, .labelValue, .labelPosition - point annotations (optional)

returnBatchOpt(BatchOptOut)

RETURNBATCHOPT - Broadcast current BatchOpt for macro recording.

selectFilesBtn_Callback()

SELECTFILESBTN_CALLBACK - Open a file picker to select tile files.

updateBatchOptFromGUI(hObject)

UPDATEBATCHOPTFROMGUI - Sync a single widget change back to BatchOpt.

updateWidgets(eventName)

UPDATEWIDGETS - Sync widgets; clear file list only on NewDataset.