Microscopy Image Browser 2.91
MIB
Loading...
Searching...
No Matches
mibModel Class Reference

the main model class of MIB More...

Inheritance diagram for mibModel:
Collaboration diagram for mibModel:

Public Member Functions

function BatchOptOut = addFrame (BatchOpt)
 Add a frame around the dataset see also mibModel.addFrameToImage function.
 
function  clearMask (BatchOptIn)
 clear the Mask layer
 
function  clearSelection (sel_switch, BatchOptIn)
 clear the Selection layer
 
function  colorChannelActions (mode, channel1, channel2, BatchOptIn)
 handling various color channel operations
 
function  contentAwareFill (BatchOptIn)
 Fill the selected area using content aware algorithms.
 
function  contrastCLAHE (mode, colCh)
 Do CLAHE Contrast-limited adaptive histogram equalization for the XY plane of the dataset for the currently shown or all slices.
 
function  contrastNormalization (mode, BatchOptIn)
 Normalize contrast between the layers of the dataset.
 
function [ xOut , yOut ] = convertDataToMouseCoordinates (x, y, mode, magFactor)
 Convert coordinates of a pixel in the dataset to the coordinates of the mibView.handles.mibImageView axes.
 
function [ xOut , yOut , zOut , tOut ] = convertMouseToDataCoordinates (x, y, mode, permuteSw)
 Convert coordinates under the mouse cursor to the coordinates of the dataset.
 
function  convertModel (ModelType, BatchOptIn)
 convert model to the specified type
 
function  copySwapSlice (SourceSlice, TargetSlice, mode, BatchOptIn)
 Copy/swap slice(s) within the dataset.
 
function  createModel (ModelType, ModelMaterialNames, BatchOptIn)
 Create a new model.
 
function  deleteSlice (orientation, sliceNumber, BatchOptIn)
 Delete a slice from the volume.
 
function  dilateImage (BatchOptIn)
 dilate image
 
function  erodeImage (BatchOptIn)
 erode image
 
function  fillSelectionOrMask (sel_switch, type, BatchOptIn)
 fill holes for selection or mask layers
 
function [ axesX , axesY ] = getAxesLimits (id)
 get axes limits for the currently shown or id dataset
 
function slice = getData2D (type, slice_no, orient, col_channel, options, custom_img)
 Get the a 2D slice with colors: height:width:colors.
 
function dataset = getData3D (type, time, orient, col_channel, options, custom_img)
 Get the a 3D dataset with colors: height:width:colors:depth.
 
function dataset = getData4D (type, orient, col_channel, options, custom_img)
 Get the a 4D dataset with colors: height:width:colors:depth:time.
 
function varargoutgetImageMethod (methodName, id, varargin)
 run desired method of the mibImage class
 
function propertyValue = getImageProperty (propertyName, id)
 get desired property for the currently shown or id dataset
 
function magFactor = getMagFactor (id)
 get magnification for the currently shown or id dataset
 
function pixSize = getPixSize (id)
 get pixSize structure for the currently shown or id dataset
 
function [ imgRGB , imgRAW ] = getRGBimage (options, sImgIn)
 Generate RGB image from all layers that have to be shown on the screen.
 
function imgRGB = getRGBvolume (img, options)
 Generate RGB volume rendering image of the stack.
 
function  flipDataset (mode, showWaitbar)
 Flip dataset horizontally, vertically or in the Z direction.
 
function  insertEmptySlice (BatchOptIn)
 Insert an empty slice into the existing volume.
 
function  interpolateImage (imgType, intType, BatchOptIn)
 interpolate mask, selection or model layer
 
function result = invertImage (mode, colChannel, Options)
 invert image
 
function  loadMask (mask, BatchOptIn)
 load mask from a file or import when mask variable is provided
 
function  loadModel (model, BatchOptIn)
 load model from a file or import when model variable is provided
 
function status = materialsActions (action, BatchOptIn)
 collection of actions related to materials of the model
 
function status = materialsSwapColors (BatchOptIn)
 
function  mibDoBackup (type, switch3d, storeOptions)
 Store the dataset for Undo.
 
function mibImg = mibImageDeepCopy (fromId, toId, options)
 copy mibImage class from one container to another; used in mibBufferToggleContext_Callback, duplicate
 
function status = modelExport (BatchOptIn)
 export model or material of the model from MIB to exportTo
 
function  moveLayers (SourceLayer, DestinationLayer, DatasetType, ActionType, BatchOptIn)
 to move datasets between the layers (image, model, mask, selection)
 
function  renameMaterial (BatchOptIn)
 rename selected or any specified material of the model
 
function  resliceDataset (sliceNumbers, orientation, BatchOptIn)
 stride reslicing the dataset so that the selected slices are kept and all others are removed
 
function  rotateDataset (mode, showWaitbar)
 Rotate dataset in 90 or -90 degrees.
 
function fnOut = saveImageAsDialog (filename, BatchOptIn)
 save image to a file
 
function fnOut = saveMask (filename, BatchOptIn)
 save mask to a file
 
function fnOut = saveModel (filename, BatchOptIn)
 save model to a file
 
function  setAxesLimits (axesX, axesY, id)
 set axes limits for the currently shown or id dataset
 
function result = setData2D (type, slice, slice_no, orient, col_channel, options)
 set the 2D slice with colors: height:width:colors to the dataset
 
function result = setData3D (type, dataset, time, orient, col_channel, options)
 set the 3D dataset with colors: height:width:colors:depth to the dataset
 
function result = setData4D (type, dataset, orient, col_channel, options)
 result = setData4D(obj, type, dataset, orient, col_channel, options) Set complete 4D dataset with colors [height:width:colors:depth:time]
 
function  setDefaultSegmentationColorPalette (paletteName, noColors)
 set default color palette for materials of the model
 
function  setImageProperty (propertyName, propertyValue, id)
 set desired property for the currently shown or id dataset
 
function  setMagFactor (magFactor, id)
 set magnification for the currently shown or id dataset
 
function  setPixSize (pixSize, id)
 set pixSize structure for the currently shown or id dataset
 
function  smoothImage (type, BatchOptIn)
 smooth Mask, Selection or Model layer
 
function  transposeDataset (mode, showWaitbar, noColorChannels)
 Transpose dataset physically between dimensions.
 
function  transposeZ2T ()
 transpose Z to T dimension
 
 mibModel (cpuParallelLimit)
 
function  reset ()
 

Public Attributes

 I
 variable for keeping instances of mibImage
 
 maxId
 maximal number of mibImage instances
 
 myPath
 current working directory
 
 U
 variable for Undo history
 
 connImaris
 a handle to Imaris connection
 
 cpuParallelLimit
 max number of parallel workers available
 
 disableSegmentation
 a switch 0/1 to disable segmentation tools while for example modifying ROIs
 
 displayedLutColors
 a matrix with the currently shown colors for the color channels (updated in mibController.redrawMibChannelMixerTable function)
 
 matlabVersion
 version of Matlab
 
 mibAnnMarkerEdit
 a string with the mode to show the annotation: marker, label, value, label + value (default)
 
 mibAnnValueEccentricCheck
 enable value-eccentric annotations, 0 - annotation text first, value second; 1 - annotation value first, text - second
 
 mibAnnValuePrecision
 precision of annotation values, an integer from 0 and above
 
 mibHideImageCheck
 define whether or not dispay the image layer (used in obj.getRGBimage) a status of mibCpontroller.mibView.handles.mibHideImageCheck.Value
 
 mibLiveStretchCheck
 define whether or not stretch the image intensities (used in obj.getRGBimage) a status of mibCpontroller.mibView.handles.mibLiveStretchCheck.Value
 
 mibMaskShowCheck
 define whether or not dispay the mask layer (used in obj.getRGBimage) a status of mibCpontroller.mibView.handles.mibMaskShowCheck.Value
 
 mibModelShowCheck
 define whether or not dispay the model layer (used in obj.getRGBimage) a status of mibCpontroller.mibView.handles.mibModelShowCheck.Value
 
 mibPrevId
 id of the previously selected mibModel container
 
 mibPython
 link to python environment started from MIB
 
 mibShowAnnotationsCheck
 show or not the annotations
 
 mibShowLines3DCheck
 show or not 3D lines
 
 mibSegmShowTypePopup
 type of model visualization: 1 - filled; 2 - contour
 
 sessionSettings
 a structure with settings for some tools used during the current session of MIB .automaticAlignmentOptions -> a structure used in mibAlignmentController .guiImages - CData for images to be shown on some buttons
 
 storedSelection
 a buffer to store selection with press of Ctrl+C button, and restore with Ctrl+V
 
 preferences
 a structure with program preferences
 
 showAllMaterials
 a switch to show all materials of the model, or only a single one; defined in mibView.handles.mibSegmentationTable
 
 Id
 id of the currently shown dataset
 
 newDatasetSwitch
 a switch 0/1 which is changed when a new dataset is opened (updated in mibController.Listner2_Callback)
 
EVENT modelNotify
 generic notification event to make the list of listners smaller, call it as notify(obj, modelNotify, eventdata); see in mibModel.renameMaterial, mibModel.materialActions eventdata; motifyEvent.Name = has description of the event
 
EVENT changeSlice
 change of a slice number using the slider
 
EVENT changeTime
 change of a time point using the slider
 
EVENT keyPressEvent
 event triggered by a child widget to call for key press callback of MIB
 
EVENT newDataset
 loaded or imported a new dataset
 
EVENT newDatasetLite
 loaded or imported a new dataset but without clearing the undo history
 
EVENT plotImage
 ask to redraw the image from mibController
 
EVENT setData
 when the set data method was used
 
EVENT showMask
 an event that enables the obj.mibController.mibView.handles.mibMaskShowCheck.Value
 
EVENT showModel
 an event that enables the obj.mibController.mibView.handles.mibModelShowCheck.Value;
 
EVENT stopProtocol
 stop batch protocol from execution
 
EVENT syncBatch
 synchromize structure for batch actions
 
EVENT undoneBackup
 when the undo is triggered
 
EVENT updateId
 updating Id
 
EVENT updateImgInfo
 meta data was has been updated, works via obj.getImageMethod
 
EVENT updatedAnnotations
 event that the annotation list has been updated for use with mibAnnotationsController
 
EVENT updatedLines3D
 event that the lines3D class was updated for use with mibLines3DController
 
EVENT updateROI
 event after change number of ROIs
 
EVENT updateSegmentationTable
 update the segmentation table
 
EVENT updateGuiWidgets
 event after update of GuiWidgets of mibController
 
EVENT updateLayerSlider
 event to trigger update of mibView.handles.mibChangeLayerSlider based on provided value, see mibAnnotationController.tableContextMenu_cb
 
EVENT updateTimeSlider
 event to trigger update of mibView.handles.mibTimeSlider based on provided value, see mibAnnotationController.tableContextMenu_cb
 
EVENT updateUserScore
 event to trigger counting user scores
 
- Public Attributes inherited from handle
 addlistener
 Creates a listener for the specified event and assigns a callback function to execute when the event occurs.
 
 notify
 Broadcast a notice that a specific event is occurring on a specified handle object or array of handle objects.
 
 delete
 Handle object destructor method that is called when the object's lifecycle ends.
 
 disp
 Handle object disp method which is called by the display method. See the MATLAB disp function.
 
 display
 Handle object display method called when MATLAB software interprets an expression returning a handle object that is not terminated by a semicolon. See the MATLAB display function.
 
 findobj
 Finds objects matching the specified conditions from the input array of handle objects.
 
 findprop
 Returns a meta.property objects associated with the specified property name.
 
 fields
 Returns a cell array of string containing the names of public properties.
 
 fieldnames
 Returns a cell array of string containing the names of public properties. See the MATLAB fieldnames function.
 
 isvalid
 Returns a logical array in which elements are true if the corresponding elements in the input array are valid handles. This method is Sealed so you cannot override it in a handle subclass.
 
 eq
 Relational functions example. See details for more information.
 
 transpose
 Transposes the elements of the handle object array.
 
 permute
 Rearranges the dimensions of the handle object array. See the MATLAB permute function.
 
 reshape
 hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape function.
 
 sort
 ort the handle objects in any array in ascending or descending order.
 

Detailed Description

the main model class of MIB

Constructor & Destructor Documentation

◆ mibModel()

mibModel.mibModel ( cpuParallelLimit)

References cpuParallelLimit.

Member Function Documentation

◆ addFrame()

function BatchOptOut = mibModel.addFrame ( BatchOpt)

Add a frame around the dataset see also mibModel.addFrameToImage function.

Parameters
BatchOptan optional structure with parameters .FrameWidth - a string with a width of the frame .FrameHeight - a string with a height of the frame .IntensityPadValue - a string with intensity of the frame .Method - a cell string with one of these options {use the pad value, replicate, circular, symmetric} .Direction - a cell string with one of these options {both, pre, post} .showWaitbar - logical, show or not the waitbar
Return values
BatchOptOutstructure with parameters used in the function
Generated fields of BatchOptOut:

References handle.fieldnames, mibInputMultiDlg(), and handle.notify.

Here is the call graph for this function:

◆ clearMask()

function mibModel.clearMask ( BatchOptIn)

clear the Mask layer

Parameters
BatchOptIn[optional], a structure with extra parameters or settings for the batch processing mode, when NaN return a structure with default options via "syncBatch" event optional parameters
  • .y -> [optional], [ymin, ymax] coordinates of the dataset to take after transpose for level=1, height
  • .x -> [optional], [xmin, xmax] coordinates of the dataset to take after transpose for level=1, width
  • .z -> [optional], [zmin, zmax] coordinates of the dataset to take after transpose, depth
  • .t -> [optional], [tmin, tmax] coordinates of the dataset to take after transpose, time
  • .id -> [optional], index of the dataset to clear the mask

References handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ clearSelection()

function mibModel.clearSelection ( sel_switch,
BatchOptIn )

clear the Selection layer

Parameters
sel_switcha string to define where selection should be cleared:
  • when 2D, Slice fill holes for the currently shown slice
  • when 3D, Stack fill holes for the currently shown z-stack
  • when 4D, Dataset fill holes for the whole dataset
BatchOptIn[optional], a structure with extra parameters or settings for the batch processing mode, when NaN return a structure with default options via "syncBatch" event optional parameters
  • .DatasetType -> cell with one of possible parameters: 2D, Slice, 3D, Stack, 4D, Dataset
  • .showWaitbar - logical, show or not the waitbar

References handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ colorChannelActions()

function mibModel.colorChannelActions ( mode,
channel1,
channel2,
BatchOptIn )

handling various color channel operations

Parameters
modea string with the operation to perform 'Insert empty channel' - insert color channel 'Copy channel' - copy one color channel to another 'Shift channel' - shift color channel by dx/dy pixels 'Invert channel' - invert color channel 'Rotate channel' - rotate color channel 'Swap channels' - swap two color channels 'Delete channel' - delete color channel
channel1index of the first color channel
channel2index of the second color channel (for copy and swap modes) or rotation angle for the 'Rotate channel' mode
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .Action - cell string, {Insert empty channel, Copy channel, Invert channel, Rotate channel, Shift channel, Swap channels, Delete channel} - action to perform
  • .Channel1 - string, index of the first (source) color channel
  • .Channel2 - string, index of the second (target) color channel
  • .RotationAngle - string, rotation angle
  • .dx - string, channel shift in X, in pixels
  • .dy - string, channel shift in Y, in pixels
  • .FillValue - string, value of intensity to fill the frame during channel shift
  • .showWaitbar - logical, show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset

Examples:

obj.mibModel.colorChannelActions('Delete channel'); // start delete color channel operation
BatchOptIn.Action = {'Delete channel'}; // define add a dataset as a new time point
BatchOptIn.Channel1 = '2'; // define to insert the empty image to the second frame
obj.mibModel.colorChannelActions([],[],[],BatchOptIn); // call from mibController class; in the batch mode - delete 2nd color channel

References max, mibInputMultiDlg(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ contentAwareFill()

function mibModel.contentAwareFill ( BatchOptIn)

Fill the selected area using content aware algorithms.

Parameters
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event Possible fields,
  • .Method - cell string, method for content aware fill, {inpaintCoherent} or {inpaintExemplar};
  • .Mask - cell string, specification of the layer that should be used for content aware filling {selection} or {mask};
  • .Mode - cell string, apply for current slice or full dataset {Shown slice (2D), Current stack (3D), Complete volume (4D)};
  • .Radius - string, with radius
  • .FillOrder - cell string, filling order {gradient, tensor}, only for inpaintExemplar
  • .SmoothingFactor - string, smoothing factor, only for inpaintCoherent
  • .showWaitbar - logical, show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset

References mibInputMultiDlg(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ contrastCLAHE()

function mibModel.contrastCLAHE ( mode,
BatchOptIn )

Do CLAHE Contrast-limited adaptive histogram equalization for the XY plane of the dataset for the currently shown or all slices.

Parameters
mode[optional], mode for use with CLAHE
  • 'Shown slice (2D)', contrast adjustment with CLAHE method for the current slice
  • 'Current stack (3D)', contrast adjustment with CLAHE method for the shown stack
  • 'Complete volume (4D)', contrast adjustment with CLAHE method for the whole dataset
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .Mode - cell string {Shown slice (2D),Current stack (3D),Complete volume (4D)} - dataset type
  • .ColChannel = {All channels, Shown channels, ColCh 1} - color channels for CLAHE
  • .NumTiles - string, number of tiles
  • .ClipLimit - string, contrast enhancement limit
  • .NBins - string, number of histogram bins used to build a contrast enhancing transformation
  • .Distribution - cell string, {uniform, rayleigh, exponential} - desired histogram shape
  • .Alpha - string, distribution parameter, for rayleigh and exponential
  • .showWaitbar - logical, show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset

References mibInputMultiDlg(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ contrastNormalization()

function mibModel.contrastNormalization ( target,
BatchOptIn )

Normalize contrast between the layers of the dataset.

| For 'Z stack' and 'Time series'
  • calculate mean intensity and its std for the whole dataset (or a current slice for Time series, when BatchOpt.TimeSeriesNormalization = {Based on current 2D slice})
  • calculate mean intensities and std for each layer
  • shift each layer based on difference between mean values of each layer and the whole dataset, plus stretch based on ratio between std of the whole dataset and current layer
For 'Masked area'
  • calculate mean intensity for the masked or selected area for the whole dataset
  • calculate mean intensities for the masked or selected area for each layer
  • shift each layer based on difference between mean values of each layer and the whole dataset
For 'Background'
  • calculate mean intensity for the masked or selected area for the whole dataset
  • shift each slice by the mean intensity of the masked or selected areas
Parameters
targettarget for the normalization:
  • 'Z stack' - normalize in the Z-dimension contrast using intensities of each complete slice
  • 'Time series' - normalize in the Time-dimension contrast using intensities of each complete slice
  • 'Masked area' - normalize contrast using intensities of only masked area at each slice
  • 'Background' - shift intensities of each image based on background intensity that is marked as the mask
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .Target - cell string, target for the normalization {Z stack,Time series,Masked area,Background}
  • .Mode - cell string, {Automatic} or {Manual}; use Automatic to calculate Mean/Std or Manual to use predefined values BatchOpt.Mean and BatchOpt.Std
  • .Mean - string, destination Mean value for the Manual mode
  • .Std - string, destination Std value for the Manual mode
  • .ColChannel - cell string, {All channels, Shown channels, ColCh 1}, define color channels for normalization
  • .Exculude - cell string, {Whole range, Excude blacks, 'Excude whites'} define intensities to exclude from estimation of normalization coefficients
  • .MaskLayer - cell string, {selection, mask} - mask layer for 'Masked area' and Background modes
  • .TimeSeriesNormalization - cell string, {Based on current 2D slice, Based on complete 3D stack} - for 'Time series' automatic mode obtain Mean/Std from the current 2D section
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset

References max, mibInputMultiDlg(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ convertDataToMouseCoordinates()

function [ xOut , yOut ] = mibModel.convertDataToMouseCoordinates ( x,
y,
mode,
magFactor )

Convert coordinates of a pixel in the dataset to the coordinates of the mibView.handles.mibImageView axes.

Parameters
xx - coordinate
yy - coordinate
modea string that defines a mode of the shown image: shown (in most cases), or full (for panning)
magFactor[optional], used to force magFactor, default obj.I.{obj.Id}.magFactor
Return values
xOutx - coordinate with the dataset
yOuty - coordinate with the dataset

Examples:

[xOut,yOut] = obj.convertDataToMouseCoordinates(x, y); // Call from mibModel: do conversion'

References max.

Referenced by mibMeasure.addMeasurementsToPlot().

Here is the caller graph for this function:

◆ convertModel()

function mibModel.convertModel ( ModelType,
BatchOptIn )

convert model to the specified type

Parameters
ModelTypea double that specifies new type of the model, can be empty, default = 63
  • 63 - model with 63 materials, the fastest to use, utilize less memory
  • 255 - model with 255 materials, the slower to use, utilize x2 more memory than 63-material type
  • 65535 - model with 65535 materials, utilize x2 more memory than 255-material type
  • 4294967295 - model with 4294967295 materials, utilize x2 more memory than 65535-material type
  • 2.4 - detect all 2D objects (connectivity 4) in all materials of the current model and generate a new model, where each object has an unique index
  • 2.8 - detect all 2D objects (connectivity 8) in all materials of the current model and generate a new model, where each object has an unique index
  • 3.6 - detect all 3D objects (connectivity 6) in all materials of the current model and generate a new model, where each object has an unique index
  • 3.26 - detect all 3D objects (connectivity 26) in all materials of the current model and generate a new model, where each object has an unique index
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .ModelType - cell string, {63, 255, 65535, 4294967295, indexed objects 2D/4, indexed objects 2D/6, indexed objects 3D/8, indexed objects 3D/26} - type of the model to convert to
  • .ContainerId - cell string, {Container d} - container, where to do conversion
  • .showWaitbar - logical, show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset

References handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ convertMouseToDataCoordinates()

function [ xOut , yOut , zOut , tOut ] = mibModel.convertMouseToDataCoordinates ( x,
y,
mode,
permuteSw )

Convert coordinates under the mouse cursor to the coordinates of the dataset.

Parameters
xx - coordinate
yy - coordinate
mode[optional] a string that defines a mode of the shown image, default is shown
  • shown - the most common one, convert coordinates of the mouse above the image to the coordinates of the dataset
  • full - suppose to do the conversion for the situation when the full image is rendered in the handles.imageAxes, never used...?
  • blockmode - when the blockface mode is switched on the function returns coordinates under the mouse for the Block
permuteSw[optional], can be empty
  • when 0 returns the coordinates for the dataset in the original xy-orientation;
  • when 1 (default) returns coordinates for the dataset so that the currently selected orientation becomes xy
Return values
xOutx - coordinate with the dataset
yOuty - coordinate with the dataset
zOutz - coordinate with the dataset
tOutt - time coordinate

Examples:

[xOut, yOut] = obj.convertMouseToDataCoordinates(x, y); // Call from mibModel: do conversion'

References max.

◆ copySwapSlice()

function mibModel.copySwapSlice ( SourceSlice,
TargetSlice,
mode,
BatchOptIn )

Copy/swap slice(s) within the dataset.

Parameters
SourceSlicenumber of the source slice, can be empty: []
TargetSlicenumber of the destination slice
modea string with desired mode: 'replace' - replace the target slice with the source slice [default] 'insert' - insert the target slice before the source slice 'swap' - swap source and target slices
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .Mode - cell string, "swap": swap two slices; "replace": replace target slice with source slice; "insert" - insert source slice before target slice
  • .SourceSlice - string, index(es) of the source slice(es)
  • .TargetSlice - string, index(es) of the destinations slice(es)
  • .showWaitbar - logical, show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset

Examples:

// for the normal mode
obj.mibModel.copySlice(4, 10); // call from mibController class; copy slice 4 to slice 10
obj.mibModel.copySlice(4, 10, 'swap'); // call from mibController class; swap slice 4 and slice 10
obj.mibModel.copySlice(4, 10, 'insert'); // call from mibController class; insert slice 4 and before slice 10
// for the batch mode
BatchOptIn.Dimension = {'time'}; // delete slice from the time domain, otherwise use {'depth'}
BatchOptIn.DeletePosition = '2:10'; // define positions, where delete the slices
obj.mibModel.deleteSlice([], [], BatchOptIn); // call from mibController class; in the batch mode

References mibInputMultiDlg(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ createModel()

function mibModel.createModel ( ModelType,
ModelMaterialNames,
BatchOptIn )

Create a new model.

Parameters
ModelType[optional], can be empty: []; a number with the model type:
  • 63 - 63 material model
  • 255 - 255 material model
  • 65535 - 65535 material model
  • 4294967295 - 4294967295 material model
ModelMaterialNames[optional] can be empty: []; a cell array with names of materials, this parameter is not used for ModelType > 255
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .ModelType - cell string, {63, 255, 65535, 4294967295} - type of the model to create
  • .ModelMaterialNames - string, with comma-separated names of materials
  • .showWaitbar - logical, show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset

Examples:

obj.mibModel.createModel(); // create a new model, when used from mibController

References mibSelectModelTypeDlg(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ deleteSlice()

function mibModel.deleteSlice ( orientation,
sliceNumber,
BatchOptIn )

Delete a slice from the volume.

Parameters
orientation[optional], can be NaN (current orientation)
  • when 0 (default) remove slice from the current orientation (obj.orientation)
  • when 1 remove slice from the zx configuration: [x,z,c,y,t] -> [y,x,c,z,t]
  • when 2 remove slice from the zy configuration: [y,z,c,y,t] -> [y,x,c,z,t]
  • when 3 not used
  • when 4 remove slice from the yx configuration: [y,x,c,z,t]
  • when 5 remove slice from the t configuration
sliceNumberthe number of the slice to delete, can be empty: []
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, the function variables are preferred over the BatchOptIn variables
  • .Dimension - cell string, {height, width, depth, time} - dimension from where delete slices
  • .DeletePosition - string, indices of slices to delete, for example: "1,79:85"
  • .showWaitbar - logical, show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset

Examples:

// for the normal mode
obj.mibModel.deleteSlice(4, 10); // call from mibController class; delete slice number 10
// for the batch mode
BatchOptIn.Dimension = {'time'}; // delete slice from the time domain, otherwise use {'depth'}
BatchOptIn.DeletePosition = '2:10'; // define positions, where delete the slices
obj.mibModel.deleteSlice([], [], BatchOptIn); // call from mibController class; in the batch mode

References mibInputMultiDlg(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ dilateImage()

function mibModel.dilateImage ( BatchOptIn)

dilate image

Parameters
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event Possible fields,
  • .TargetLayer -> cell, layer to be dilated, selection, mask, model
  • .DatasetType -> cell, specify whether to dilate the current slice (2D, Slice), the stack (3D, Stack) or complete dataset (4D, Dataset)
  • .DilateMode -> cell, type of the strel element for dilation, 2D, 3D
  • .StrelSize -> string, size of the strel element in pixels; one or two numbers, when two numbers entered, the second one defines Y or Z dimension for 2D and 3D strel elements respectively
  • .Difference -> logical, obtain the difference between dilated and original image'
  • .Adaptive -> logical, adaptive dilation
  • .AdaptiveCoef -> [Adaptive mode] expansion coefficient for the adaptive dilation
  • .AdaptiveColorChannel -> [Adaptive mode] color channel for adaptive dilation
  • .AdaptiveSmoothing -> [Adaptive mode] logical, additional smoothing during adaplive dilation
  • .MaterialIndex -> string, index of material of the model to be eroded; only for TargetLayer="model"
  • .Use2DParallelComputing -> logical, use parallel processing to erode images in 2D'
  • .showWaitbar -> logical, show or not the progress bar during execution

References max, min, handle.notify, uint32, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ erodeImage()

function mibModel.erodeImage ( BatchOptIn)

erode image

Parameters
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event Possible fields,
  • .TargetLayer -> cell, layer to be eroded, selection, mask, model
  • .DatasetType -> cell, specify whether to erode the current slice (2D, Slice), the stack (3D, Stack) or complete dataset (4D, Dataset)
  • .ErodeMode -> cell, type of the strel element for erosion, 2D, 3D
  • .StrelSize -> string, size of the strel element in pixels; one or two numbers, when two numbers entered, the second one defines Y or Z dimension for 2D and 3D strel elements respectively
  • .Difference -> logical, obtain the difference between eroded and original image'
  • .MaterialIndex -> string, index of material of the model to be eroded; only for TargetLayer="model"
  • .Use2DParallelComputing -> logical, use parallel processing to erode images in 2D'
  • .showWaitbar -> logical, show or not the progress bar during execution

References max, handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ fillSelectionOrMask()

function mibModel.fillSelectionOrMask ( sel_switch,
type,
BatchOptIn )

fill holes for selection or mask layers

Parameters
sel_switcha string that defines where filling of holes should be done:
  • when 2D, Slice fill holes for the currently shown slice
  • when 3D, Stack fill holes for the currently shown z-stack
  • when 4D, Dataset fill holes for the whole dataset
typestring with type of material selection, mask
BatchOptIn[optional], a structure with extra parameters or settings for the batch processing mode, when NaN return a structure with default options via "syncBatch" event optional parameters
  • .DatasetType -> cell with one of possible parameters - 2D, Slice, 3D, Stack, 4D, Dataset
  • .TargetLayer -> cell, layer to fill - selection, mask
  • .SelectedMaterial - string, index of the selected material, -1 for mask, 0-for exterior, 1,2..-indices of materials
  • .fixSelectionToMaterial - logical, when 1- limit selection only for the selected material
  • .showWaitbar - logical, show or not the waitbar

References max, handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ flipDataset()

function mibModel.flipDataset ( mode,
showWaitbar )

Flip dataset horizontally, vertically or in the Z direction.

Flip dataset and other layers in horizontal or vertical direction

Parameters
mode-> a string that defines the flipping mode
  • 'Flip horizontally' -> horizontal flip
  • 'Flip vertically' -> vertical flip
  • 'Flip Z' -> flip Z direction
  • 'Flip T' -> flip T direction
showWaitbarlogical, show or not the waitbar

References handle.notify.

◆ getAxesLimits()

function [ axesX , axesY ] = mibModel.getAxesLimits ( id)

get axes limits for the currently shown or id dataset

Parameters
id[optional], id of the dataset, otherwise the currently shown dataset (obj.mibModel.Id)
Return values
axesXa vector [min, max] for the X
axesYa vector [min, max] for the Y

Examples:

[axesX, axesY] = obj.mibView.getAxesLimits(); // call from mibController: get axes limits for the currently shown dataset
[axesX, axesY] = obj.mibView.getAxesLimits(2); // call from mibController: get axes limits for dataset 2

◆ getData2D()

function slice = mibModel.getData2D ( type,
slice_no,
orient,
col_channel,
options,
custom_img )

Get the a 2D slice with colors: height:width:colors.

Parameters
typetype of the slice to retrieve, image, model,mask, selection, custom (custom indicates to use custom_img as the dataset), everything(model,mask and selection for imageData.model_type=='uint6' only)
slice_no[optional], an index of the slice to show, when NaN will show the current slice
orient[optional], can be NaN
  • when 0 (default) updates the dataset transposed from the current orientation (obj.orientation)
  • when 1 returns transposed dataset from the zx configuration: [x,z,c,y,t] -> [y,x,c,z,t]
  • when 2 returns transposed dataset from the zy configuration: [y,z,c,y,t] -> [y,x,c,z,t]
  • when 3 not used
  • when 4 returns original dataset from the yx configuration: [y,x,c,z,t]
  • when 5 not used
col_channel[optional], can be NaN
  • when type is image, col_channel is a vector with color numbers to take, when NaN [default] take the colors selected in the imageData.slices{3} variable, when 0 - take all colors of the dataset.
  • when type is model col_channel may be NaN - to take all materials of the model or an integer to take specific material. In the later case the selected material in slice will have index = 1.
options[optional], a structure with extra parameters
  • .blockModeSwitch -> override the block mode switch mibImage.blockModeSwitch; use or not the block mode (0 - return full dataset, 1 - return only the shown part)
  • .roiId -> use or not the ROI mode (when missing or less than 0, return full dataset, without ROI; 0 - return all ROIs dataset, Index - return ROI with the index, [] - currently selected) (Attention: see also fillBg parameter!)
  • .fillBg -> when NaN (default) -> crops the dataset as a rectangle; when a number fills the areas out of the ROI area with this intensity number
  • .y -> [optional], [ymin, ymax] of the part of the slice to take (sets .blockModeSwitch to 0)
  • .x -> [optional], [xmin, xmax] of the part of the slice to take (sets .blockModeSwitch to 0)
  • .t -> [optional], [tmin, tmax] indicate the time point to take, when missing return the currently selected time point
  • .level -> [optional], an index of image level from the image pyramid
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset
custom_img[optional], can be NaN; the function return a slice not from the imageData class but from this custom_img, requires to specify the custom type. custom_img should be a 3D dataset.
Return values
slicea cell array with 2D image with colors. For the image type: {roiId}[1:height, 1:width, 1:colors]; for all other types: {roiId}[1:height, 1:width]
Required fields of options:

Examples:

slice = obj.mibModel.getData2D('image', 5); // Call from mibController: get the 5-th slice of the current stack orientation
slice = obj.mibModel.getData2D('image', 5, 4, 2); // Call from mibController: get the 5-th slice of the XY-orientation, color channel=2
Attention
sensitive to the
mibGUI.handles.toolbarBlockModeSwitch; if the blockMode should be disabled use options.blockModeSwitch=0
function varargout = mibGUI(varargin)
MIBGUI MATLAB code for mibGUI.fig MIBGUI, by itself, creates a new MIBGUI or raises the existing sing...
Definition mibGUI.m:17
not sensitive to the shown ROI, if areas under ROIs are required use options.roiId and options.fillBg parameters

◆ getData3D()

function dataset = mibModel.getData3D ( type,
time,
orient,
col_channel,
options,
custom_img )

Get the a 3D dataset with colors: height:width:colors:depth.

Parameters
typetype of the slice to retrieve, image, model,mask, selection, custom (custom indicates to use custom_img as the dataset), everything(model,mask and selection for imageData.model_type=='uint6' only)
time[optional], an index of the time point to show, when NaN gets the dataset for the current time point
orient[optional], can be NaN
  • when 0 (default) returns the dataset transposed to the current orientation (obj.orientation)
  • when 1 returns transposed dataset to the zx configuration: [y,x,c,z] -> [x,z,c,y]
  • when 2 returns transposed dataset to the zy configuration: [y,x,c,z] -> [y,z,c,y]
  • when 3 not used
  • when 4 returns original dataset to the yx configuration: [y,x,c,z]
  • when 5 not used
col_channel[optional], can be NaN
  • when type is image, col_channel is a vector with color numbers to take, when NaN [default] take the colors selected in the imageData.slices{3} variable, when 0 - take all colors of the dataset.
  • when type is model col_channel may be NaN - to take all materials of the model or an integer to take specific material. In the later case the selected material in slice will have index = 1.
options[optional], a structure with extra parameters
  • .blockModeSwitch -> override the block mode switch mibImage.blockModeSwitch; use or not the block mode (0 - return full dataset, 1 - return only the shown part)
  • .roiId -> use or not the ROI mode (when missing or less than 0, return full dataset; 0 - return all shown ROIs dataset, Index or [] - return ROI with this index or currently selected)
  • .fillBg -> when NaN (default) -> crops the dataset as a rectangle; when a number fills the areas out of the ROI area with this intensity number (Attention: see also fillBg parameter!)
  • .y -> [optional], [ymin, ymax] of the part of the dataset to take (sets .blockModeSwitch to 0)
  • .x -> [optional], [xmin, xmax] of the part of the dataset to take (sets .blockModeSwitch to 0)
  • .z -> [optional], [zmin, zmax] of the part of the dataset to take (sets .blockModeSwitch to 0)
  • .level -> [optional], index of image level from the image pyramid
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset
custom_img[optional], can be NaN; the function return a slice not from the imageData class but from this custom_img, requires to specify the custom type. custom_img should be a 3D dataset.
Return values
dataseta cell array with 3D dataset with colors. For the image type: {roiId}[1:height, 1:width, 1:colors, 1:depth]; for all other types: {roiId}[1:height, 1:width, 1:depth]
Required fields of options:

Examples:

dataset = obj.mibModel.getData3D('image'); // Call from mibController: get the 4D dataset for the current time point, in the shown orientation
dataset = obj.mibModel.getData3D('image', 5, 4, 2); // Call from mibController: get the 4D dataset for the 5-th time point in the XY orientation
Attention
sensitive to the
mibGUI.handles.toolbarBlockModeSwitch; if the blockMode should be disabled use options.blockModeSwitch=0
not sensitive to the shown ROI, if areas under ROIs are required use options.roiId and options.fillBg parameters

References max.

◆ getData4D()

function dataset = mibModel.getData4D ( type,
orient,
col_channel,
options,
custom_img )

Get the a 4D dataset with colors: height:width:colors:depth:time.

Parameters
typetype of the slice to retrieve, image, model,mask, selection, custom (custom indicates to use custom_img as the dataset), everything(model,mask and selection for imageData.model_type=='uint6' only)
orient[optional], can be NaN
  • when 0 (default) returns the dataset transposed to the current orientation (obj.orientation)
  • when 1 returns transposed dataset to the zx configuration: [y,x,c,z] -> [x,z,c,y]
  • when 2 returns transposed dataset to the zy configuration: [y,x,c,z] -> [y,z,c,y]
  • when 3 not used
  • when 4 returns original dataset to the yx configuration: [y,x,c,z]
  • when 5 not used
col_channel[optional], can be NaN
  • when type is image, col_channel is a vector with color numbers to take, when NaN [default] take the colors selected in the imageData.slices{3} variable, when 0 - take all colors of the dataset.
  • when type is model col_channel may be NaN - to take all materials of the model or an integer to take specific material. In the later case the selected material in slice will have index = 1.
options[optional], a structure with extra parameters
  • .blockModeSwitch -> override the block mode switch mibImage.blockModeSwitch; use or not the block mode (0 - return full dataset, 1 - return only the shown part)
  • .roiId -> use or not the ROI mode (when missing or less than 0, return full dataset, without ROI; 0 - return all ROIs dataset, Index - return ROI with the index, [] - currently selected) (Attention: see also fillBg parameter!)
  • .fillBg -> when NaN (default) -> crops the dataset as a rectangle; when a number fills the areas out of the ROI area with this intensity number
  • .y -> [optional], [ymin, ymax] of the part of the dataset to take (sets .blockModeSwitch to 0)
  • .x -> [optional], [xmin, xmax] of the part of the dataset to take (sets .blockModeSwitch to 0)
  • .z -> [optional], [zmin, zmax] of the part of the dataset to take (sets .blockModeSwitch to 0)
  • .t -> [optional], [tmin, tmax] of the part of the dataset to take
  • .level -> [optional], index of image level from the image pyramid
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset
custom_img[optional], can be NaN; the function return a slice not from the imageData class but from this custom_img, requires to specify the custom type. custom_img should be a 3D dataset.
Return values
dataseta cell array with 2D image with colors. For the image type: {roiId}[1:height, 1:width, 1:colors, 1:depth, 1:time]; for all other types: {roiId}[1:height, 1:width, 1:depth, 1:time]
Required fields of options:

Examples:

dataset = obj.mibModel.getData4D('image'); // Call from mibController: get the 4D dataset for the current time point, in the shown orientation
dataset = obj.mibModel.getData4D('image', 5, 4, 2); // Call from mibController: get the 4D dataset for the 5-th time point in the XY orientation
Attention
sensitive to the
mibGUI.handles.toolbarBlockModeSwitch; if the blockMode should be disabled use options.blockModeSwitch=0
not sensitive to the shown ROI, if areas under ROIs are required use options.roiId and options.fillBg parameters

References max.

◆ getImageMethod()

function varargout = mibModel.getImageMethod ( methodName,
id,
varargin )

run desired method of the mibImage class

Using this function the syntax result = obj.mibModel.I{obj.mibModel.I}.methodName can be written as obj.mibModel.getImageMethod(methodName)

Parameters
methodNamea string with name of the mibImage method to run
id[optional], id of the dataset, when NaN the currently shown dataset (obj.Id)
vararginlist of parameters for the method to call
Return values
varargoutoutput results

Examples:

data = obj.mibModel.getImageMethod('getData', NaN, 'image', 4, 0);; // call from mibController: get current dataset
obj.mibModel.getImageMethod('updateImgInfo', NaN, 'updated!'); // call from mibController: update image info for the dataset
timePoint = obj.mibModel.getImageMethod('getCurrentTimePoint', NaN); // call from mibController: get current time point
Attention
this method is about 3.1 times slower than use direct access to methods of mibImage as obj.mibModel.I{obj.mibModel.Id}.methodName(); It is still fast ~40 ns/call

References handle.notify.

◆ getImageProperty()

function propertyValue = mibModel.getImageProperty ( propertyName,
id )

get desired property for the currently shown or id dataset

Parameters
propertyNamea string with property name for mibImage class
id[optional], id of the dataset, otherwise the currently shown dataset (obj.Id)
Return values
propertyValuea value for the desired property, or empty

Examples:

orientation = obj.mibModel.getImageProperty('orientation'); // call from mibController: get orientation for the current dataset
orientation = obj.mibModel.getImageProperty('orientation', 2); // call from mibController: get orientation for dataset 2

◆ getMagFactor()

function magFactor = mibModel.getMagFactor ( id)

get magnification for the currently shown or id dataset

Parameters
id[optional], id of the dataset, otherwise the currently shown dataset (obj.Id)
Return values
magFactormagnification factor

Examples:

magFactor = obj.mibModel.getMagFactor(); // call from mibController: get current magFactor
magFactor = obj.mibModel.getMagFactor(2); // call from mibController: get magFactor for dataset 2

◆ getPixSize()

function pixSize = mibModel.getPixSize ( id)

get pixSize structure for the currently shown or id dataset

Parameters
id[optional], id of the dataset, otherwise the currently shown dataset (obj.Id)
Return values
pixSizea structure with diminsions of voxels,
.x .y .z .t .tunits .units
the fields are
  • .x - physical width of a pixel
  • .y - physical height of a pixel
  • .z - physical thickness of a pixel
  • .t - time between the frames for 2D movies
  • .tunits - time units
  • .units - physical units for x, y, z. Possible values: [m, cm, mm, um, nm]

Examples:

pixSize = obj.mibModel.getPixSize(); // call from mibController: get current pixSize
pixSize = obj.mibModel.getPixSize(2); // call from mibController: get pixSize for dataset 2

◆ getRGBimage()

function [ imgRGB , imgRAW ] = mibModel.getRGBimage ( options,
sImgIn )

Generate RGB image from all layers that have to be shown on the screen.

| Examples
options.blockModeSwitch = 1;
imageData.Ishown = imageData.getRGBimage(handles, options); // to get cropped 2D RGB image of the shown area
imageData.Ishown = getRGBimage(obj, handles, options);// Call within the class; to get cropped 2D RGB image of the shown area
function [ imgRGB , imgRAW ] = getRGBimage(options, sImgIn)
Generate RGB image from all layers that have to be shown on the screen.
Definition getRGBimage.m:18
Parameters
optionsa structure with extra parameters:
  • .blockModeSwitch -> 0 -> return RGB image of the whole slice [default]; 1 -> return RGB image of the shown area only
  • .resize -> yes -> resize RGB image to the current magnification value [default]; no -> return the image in the original resolution
  • .sliceNo [optional] -> index of a slice to show
  • .markerType [optional] -> default NaN, type of annotations: when both show a label next to the position marker, when marker - show only the marker without the label, when text - show only text without marker
  • .t -> [optional], [tmin, tmax] the time point of the dataset; default is the currently shown time point
  • .y -> [optional], [ymin, ymax] of the part of the slice to take (sets .blockModeSwitch to 0)
  • .x -> [optional], [xmin, xmax] of the part of the slice to take (sets .blockModeSwitch to 0)
  • .useLut -> [optional], 0 or 1 to use or not LUT table
sImgIna custom 3D stack to grab a single 2D slice from
Return values
imgRGB- RGB image with combined layers, [1:height, 1:width, 1:3]
imgRAW- RAW image, used only when mibImage.Virtual.virtual == 1, i.e. in the virtual stacking mode
Required fields of options:

References B(), M, max, mibAddText2Img(), min, and uint32.

Here is the call graph for this function:

◆ getRGBvolume()

function imgRGB = mibModel.getRGBvolume ( img,
options )

Generate RGB volume rendering image of the stack.

Parameters
img3D/4D stack [y,x,c,z]
optionsa structure with extra parameters:
  • .RenderType -> maximum intensitity projections (default) mip, greyscale volume rendering bw, color volume rendering color and volume rendering with shading shaded
  • .Mview -> this 4x4 matrix is the viewing matrix defaults to [1 0 0 0;0 1 0 0;0 0 1 0;0 0 0 1]
  • .ImageSize -> size of the rendered image, defaults to [400 400]
  • .ShearInterp -> interpolation method used in the Shear steps of the shearwarp algoritm, nearest or (default) bilinear
  • .WarpInterp -> interpolation method used in the warp step of the shearwarp algoritm, nearest or (default) bilinear
  • .AlphaTable -> This Nx1 table is linear interpolated such that every voxel intensity gets a specific alpha (transparency) [0 0.01 0.05 0.1 0.2 1 1 1 1 1]
  • .ColorTable -> this Nx3 table is linear interpolated such that every voxel intensity gets a specific color. defaults to [1 0 0;1 0 0;1 0 0;1 0 0;1 0 0;1 0 0;1 0 0]
  • .LightVector -> Light Direction defaults to [0.67 0.33 -0.67]
  • .ViewerVector -> View vector X,Y,Z defaults to [0 0 1]
  • .ShadingMaterial -> The type of material shading : dull, shiny(default) or metal.
Return values
imgRGB- RGB image with combined layers, [1:height, 1:width, 1:3]
Required fields of options:

References B(), min, and render().

Here is the call graph for this function:

◆ insertEmptySlice()

function mibModel.insertEmptySlice ( BatchOptIn)

Insert an empty slice into the existing volume.

Parameters
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event
  • .Dimension - a cell string with targeted dimension: {depth, time};
  • .InsertPosition - char, position where to insert the new slice/volume starting from 1, when 0 - add img to the end of the dataset
  • .NumberOfSlices - char, number of slices to add
  • .BackgroundColor = char, intensity of the background color
  • .showWaitbar = true; % logical, show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset

Examples:

BatchOptIn.Dimension = {'time'}; // define add a dataset as a new time point
BatchOptIn.InsertPosition = '2'; // define to insert the empty image to the second frame
BatchOptIn.NumberOfSlices = '10'; // insert 10 slices
BatchOptIn.BackgroundColor = '128'; // define background intensity
obj.mibModel.insertEmptySlice(BatchOptIn); // call from mibController class; add img as a new time point

References mibInputMultiDlg(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ interpolateImage()

function mibModel.interpolateImage ( imgType,
intType,
BatchOptIn )

interpolate mask, selection or model layer

Parameters
imgTypea string with type of the layer for the interpolation
  • 'selection' - smooth the Selection layer [default]
  • 'mask' - smooth the Mask layer
  • 'model' - smooth the Model layer
intTypea string with type of the interpolation algorithm to use
  • shape - interpolation suitable for blobs
  • line - interpolation suitable for lines
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .Target - cell string, {mask, selection, model} - layer to smooth
  • .InterpolationType - cell string, {shape, line} - type of the interpolation
  • .MaterialIndex - string [only for models], with index of the material
  • .id -> [optional], index of the dataset to process
  • .showWaitbar - logical, show or not the waitbar

References mibInterpolateLines(), mibInterpolateShapes(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ invertImage()

function result = mibModel.invertImage ( mode,
colChannel,
Options )

invert image

Parameters
modea string that defines part of the dataset to be inverted
  • when 2D dilate for the currently shown slice
  • when 3D dilate for the currently shown z-stack
  • when 4D dilate for the whole dataset
colChannel[optional] a list of color channels to invert; 0 to invert all color channels, NaN to invert shown color channels
Optionsa structure with additional parameters .t - a vector with time points to take [t1 t2] .z - a vector with slice numbers to take [z1 z2] .showWaitbar - logical, show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset
Return values
result[logical], result of the operation 1-success, 0-fail
Required fields of Options:

References max, and handle.notify.

◆ loadMask()

function mibModel.loadMask ( mask,
BatchOptIn )

load mask from a file or import when mask variable is provided

Parameters
mask[optional], a matrix contaning a mask to load [1:obj.height, 1:obj.width, 1:obj.no_stacks, 1:obj.time]
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .DirectoryName - cell with directory name
  • .FilenameFilter - filter for filenames or filename of the mask file to load, also compatible with template Labels_[F].mask, where [F] - is filename of the open dataset
  • .showWaitbar - show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset

Examples:

obj.mibModel.loadMask(); // call from mibController; load a mask
obj.mibModel.loadMask(mask, BatchOptIn); // call from mibController; import a mask

References amiraLabels2bitmap(), handle.fieldnames, mib_uigetfile(), mibLoadImages(), handle.notify, handle.permute, handle.sort, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ loadModel()

function mibModel.loadModel ( model,
BatchOptIn )

load model from a file or import when model variable is provided

Parameters
model[optional], a matrix contaning a model to load [1:obj.height, 1:obj.width, 1:obj.color, 1:obj.no_stacks, 1:obj.time]
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .DirectoryName - cell with directory name
  • .FilenameFilter - filter for filenames or filename of the model file to load, also compatible with template Labels_[F].model, where [F] - is filename of the open dataset
  • .modelMaterialNames - cell array with list of materials
  • .modelMaterialColors - a matrix with colors for materials
  • .labelText - a cell array with labels
  • .labelPosition - a matrix [x, y, z, t] with coordinates of labels
  • .labelValue - an array of numbers for values of labels
  • .modelType - a double with type of the model: 63, 255
  • .modelVariable - an optional string with the name of the model variable
  • .showWaitbar - show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset
Required fields of BatchOptIn:
Required fields of model:

Examples:

obj.mibModel.loadModel(); // call from mibController; load a model
obj.mibModel.loadModel(model, BatchOptIn); // call from mibController; import a model

References amiraLabels2bitmap(), handle.fieldnames, getAmiraMeshHeader(), M, max, maxId, mib_uigetfile(), mibLoadImages(), min, handle.notify, nrrdLoadWithMetadata(), handle.permute, handle.sort, uint32, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ materialsActions()

function status = mibModel.materialsActions ( action,
BatchOptIn )

collection of actions related to materials of the model

Parameters
actionstring with desired action to do, one of those listed below. Provide only this parameter for the interactive behavior
BatchOptIn[optional] a structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details; default values in BatchOpt below are overriden by settings from BatchOptIn
  • .Action - cell string with these options Rename material Add material Insert material Swap materials Reorder materials Export material Save material to file Remove material
  • .MaterialIndex1 - string, primary index(indices) of materials to perform required action
  • .MaterialIndex2 - string, secondary index of materials for swapping of materials
  • .MaterialName - string, new name for the material
  • .showWaitbar - logical, show or not the waitbar
Return values
statuslogical status of the function

Examples:

BatchOptIn.Action = {'Rename material'};
BatchOptIn.MaterialIndex1 = '3';
BatchOptIn.MaterialName = 'material3';
obj.mibModel.materialsActions(BatchOptIn); // call from mibController class; rename material 3 as "material3"
BatchOptIn.Action = {'Remove material'};
BatchOptIn.MaterialIndex1 = '2:4 10';
obj.mibModel.materialsActions(BatchOptIn); // call from mibController class; remove materials 2,3,4,10

References max, mibInputMultiDlg(), mibQuestDlg(), handle.notify, handle.reshape, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ materialsSwapColors()

function status = mibModel.materialsSwapColors ( BatchOptIn)

Examples:

BatchOptIn.MaterialIndex1 = '3';
BatchOptIn.MaterialIndex2 = '5';
obj.mibModel.materialsColorSwap(BatchOptIn); // call from mibController class; swap colors between material with index 3 and material with index 5
obj.mibModel.materialsActions(); // call from mibController class; interactive mode, a dialog will be shown

References mibInputMultiDlg(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ mibDoBackup()

function mibModel.mibDoBackup ( type,
switch3d,
getDataOptions )

Store the dataset for Undo.

The dataset is stored in imageUndo class

Parameters
type'image', 'selection', 'mask', 'model', labels, 'everything' (for mibImage.modelType==63 only), 'lines3d', 'labels', 'mibImage'
switch3d- a switch to define a 2D or 3D mode to store the dataset dataset
  • 0 - 2D slice
  • 1 - 3D dataset
getDataOptions- an optional structure with extra parameters
  • .blockModeSwitch -> [optional], crop the stored dataset to the visible portion of the data, when true, overrides .y and .x fields
  • .y -> [optional], [ymin, ymax] of the part of the dataset to store
  • .x -> [optional], [xmin, xmax] of the part of the dataset to store
  • .z -> [optional], [zmin, zmax] of the part of the dataset to store
  • .t -> [optional], [tmin, tmax] of the part of the dataset to store
  • .roiId -> [optional], use or not the ROI mode (when missing or less than 0, return full dataset; 0 - return all shown ROIs dataset, Index or [] - return ROI with this index or currently selected)
  • .id -> [optional], index of the dataset to backup
  • .LinkedVariable - [optional] an additional structure with parameters that should be stored .LinkedVariable.Fieldname - string that specifies variable name seen from mibController, for example: getDataOptions.LinkedVariable.Points = obj.mibModel.sessionSettings.SAMsegmenter.Points;
  • .LinkedData - [optional] an additional structure with data that should be stored, Fieldname should match Fieldname in .LinkedVariable .LinkedData.Fieldname.Value1 - values1 to be stored .LinkedData.Fieldname.Value2 - values2 to be stored for example: getDataOptions.LinkedData.Points.Position = []; getDataOptions.LinkedData.Points.Value = [];
Required fields of getDataOptions:

Examples:

obj.mibModel.mibDoBackup('labels', 0); // call from mibController: store labels
obj.mibModel.mibDoBackup('selection', 1); // call from mibController: store the selection layer for 3D dataset
backupOptions.LinkedData.Points.Position = [10, 10];
backupOptions.LinkedData.Points.Value = [5];
backupOptions.LinkedVariable.Points = 'obj.mibModel.sessionSettings.SAMsegmenter.Points';
obj.mibModel.mibDoBackup('labels', 0, backupOptions);

References max, and min.

◆ mibImageDeepCopy()

function mibImg = mibModel.mibImageDeepCopy ( fromId,
toId,
options )

copy mibImage class from one container to another; used in mibBufferToggleContext_Callback, duplicate

Parameters
fromId[optional] - index of the original dataset, default obj.Id; fromId can also be an instance of mibImage class
toIdindex of the dataset to where copy the image, when omitted, the resulting image will be exported to return variable mibImg
options[optional] - structure with additional parameters
  • .showWaitbar - logical show or not the waitbar (default=true)
Return values
mibImga deep copy of the image in fromId; exported only when toId is missing
Required fields of options:
Required fields of fromId:
Generated fields of mibImg:

◆ modelExport()

function status = mibModel.modelExport ( BatchOptIn)

export model or material of the model from MIB to exportTo

Parameters
BatchOptIn[optional] a structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details; default values in BatchOpt below are overriden by settings from BatchOptIn, when BatchOptIn.batchModeFlag==true, no question asked
  • .ExportTo - cell string with these options matlab - export to MATLAB imaris - export to Imaris
  • .MaterialOutputVariable - string with output variable for MATLAB export
  • .MaterialIndex - string, index of materials to export
  • .MaterialOutputIndex - string, index that material gets after export (typically, 1 or 255)
  • .showWaitbar - logical, show or not the waitbar
  • .batchModeFlag - logical, when 1 do not ask any questions
Return values
statuslogical status of the function

Examples:

BatchOptIn.ExportTo = 'matlab';
BatchOptIn.MaterialIndex = '3';
BatchOptIn.MaterialOutputIndex = '255'
obj.mibModel.modelExport(BatchOptIn); // call from mibController class; export material 3 from the model and assign it to value 255, ask question to confirm values
BatchOptIn.ExportTo = 'matlab';
BatchOptIn.batchModeFlag = true;
obj.mibModel.materialsActions(BatchOptIn); // call from mibController class; export the whole model to MATLAB, no questions asked

References mibInputMultiDlg(), mibSetImarisDataset(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ moveLayers()

function mibModel.moveLayers ( SourceLayer,
DestinationLayer,
DatasetType,
ActionType,
BatchOptIn )

to move datasets between the layers (image, model, mask, selection)

for example, to move selection to mask, or selection to a specified material of the model

Parameters
SourceLayername of a layer to get data, 'selection', 'mask', or 'model', can be empty []
DestinationLayername of a layer to set data, 'selection', 'mask', or 'model', can be empty []
DatasetTypea string, can be empty []
  • '2D, Slice' - 2D mode, move only the shown slice [y,x]
  • '3D, Stack' - 3D mode, move 3D dataset [y,x,z]
  • '4D, Dataset' - 4D mode, move 4D dataset [y,x,z,t]
ActionTypea type of the desired action, can be empty []
  • 'add' - add mask to selection
  • 'remove' - remove mask from selection
  • 'replace' - replace selection with mask
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .id -> [optional], an index dataset from 1 to 9, default = currently shown dataset
  • .blockModeSwitch -> logical, use or not the block mode (0 - return full dataset, 1 - return only the shown part)
  • .roiId -> string, use or not the get ROI mode (when missing or less than 0, return full dataset, without ROI; 0 - return all ROIs dataset, Index - return ROI with the index, [] - currently selected) (Attention: see also fillBg parameter!)
  • .fillBg -> string, when NaN (default) -> crops the dataset as a rectangle; when a number fills the areas out of the ROI area with this intensity number
  • .y -> [optional], [ymin, ymax] of the part of the dataset to take
  • .x -> [optional], [xmin, xmax] of the part of the dataset to take
  • .z -> [optional], [zmin, zmax] of the part of the dataset to take
  • .t -> [optional], [tmin, tmax] of the part of the dataset to take
  • .level -> [optional], index of image level from the image pyramid [not yet used]
  • .id - number, id of the dataset
  • .SelectedMaterial - string, index of the selected material, -1 for mask, 0-for exterior, 1,2..-indices of materials
  • .selectedAddToMaterial - string, index of the selected add to material, -1 for mask, 0-for exterior, 1,2..-indices of materials
  • .fixSelectionToMaterial - logical, when 1- limit selection only for the selected material
  • .fixSelectionToMask - logical, when checked will do add, replace, remove actions only in the masked areas
  • .showWaitbar - logical, show or not the waitbar

Examples:

obj.mibModel.moveLayers('selection', 'mask', '3D, Stack', 'add'); // add selection to mask for
obj.mibModel.moveLayers('selection', 'mask', '3D, Stack', 'add'); // remove selection from mask

References handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ renameMaterial()

function mibModel.renameMaterial ( BatchOptIn)

rename selected or any specified material of the model

Parameters
BatchOptIn[optional], a structure with extra parameters or settings for the batch processing mode, when NaN return a structure with default options via "syncBatch" event optional parameters
  • .materialIndex -> index of material to rename, when 0 rename all materials, in this case the "newMaterialName" field needs to be populated with material names separated with commas
  • .newMaterialName - string, a new name for the material or the list of new names separated with commas

References max, mibInputDlg(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ reset()

function mibModel.reset ( )

◆ resliceDataset()

function mibModel.resliceDataset ( sliceNumbers,
orientation,
BatchOptIn )

stride reslicing the dataset so that the selected slices are kept and all others are removed

Parameters
sliceNumbers[string] the number of the slices to keep, can be a range in MATLAB format as 1:10:end to keep each 10th slice, can be empty: []
orientation[optional], can be NaN (current orientation)
  • when 0 (default) remove slice from the current orientation (obj.orientation)
  • when 1 remove slice from the zx configuration: [x,z,c,y,t] -> [y,x,c,z,t]
  • when 2 remove slice from the zy configuration: [y,z,c,y,t] -> [y,x,c,z,t]
  • when 3 not used
  • when 4 remove slice from the yx configuration: [y,x,c,z,t]
  • when 5 not implemented
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, the function variables are preferred over the BatchOptIn variables
  • .Dimension - cell string, {height, width, depth} - dimension for reslicing
  • .sliceNumbers - string, indices of slices to keep, for example: "1, 79:85"
  • .showWaitbar - logical, show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset

Examples:

// for the normal mode
obj.mibModel.resliceDataset('1:10:end'); // call from mibController class; keep each 10th slice
// for the batch mode
BatchOptIn.Dimension = {'depth'}; // reslice depth dimension
BatchOptIn.sliceNumbers = '1:10:end'; // define positions, where delete the slices
obj.mibModel.deleteSlice([], [], BatchOptIn); // call from mibController class; in the batch mode

References mibInputMultiDlg(), handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ rotateDataset()

function mibModel.rotateDataset ( mode,
showWaitbar )

Rotate dataset in 90 or -90 degrees.

Rotate dataset in 90 or -90 degrees

Parameters
mode-> a string that defines the rotation
  • 'Rotate 90 degrees' -> rotate dataset to 90 degrees clock-wise
  • 'Rotate -90 degrees' -> rotate dataset to 90 degrees anti clock-wise
showWaitbarlogical, show or not the waitbar

References handle.notify.

◆ saveImageAsDialog()

function fnOut = mibModel.saveImageAsDialog ( filename,
BatchOptIn )

save image to a file

Parameters
filename[optional] a string with filename, when empty asks for a dialog when provided the extension will define the output format, unless the format is provided in the BatchOptIn structure
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .Format - a string with the output format, as in the Formats variable below, for example Amira Mesh binary file sequence (*.am)
  • .filenameGenerator - a string, when sequential the filenames will be generated as a sequence, when original the original filenames will be used
  • .DestinationDirectory - a string with destination directory, if filename has no full path
  • .showWaitbar - logical show or not the waitbar
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset
Return values
fnOuta string with the output filename
Required fields of BatchOptIn:

References handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ saveMask()

function fnOut = mibModel.saveMask ( filename,
BatchOptIn )

save mask to a file

Parameters
filenamestring with output filename, when empty a save as dialog is prompted a string, otherwise save the mask in the detected format. Additional settings may be provided via BatchOptIn structure
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
Return values
fnOuta string with the output mask filename
Required fields of BatchOptIn:

References handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ saveModel()

function fnOut = mibModel.saveModel ( filename,
BatchOptIn )

save model to a file

Parameters
filenamestring with output filename, when empty a save as dialog is prompted a string, otherwise save the model in the detected format. Additional settings may be provided via BatchOptIn structure
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
Return values
fnOuta string with the output model filename
Required fields of BatchOptIn:

References handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ setAxesLimits()

function mibModel.setAxesLimits ( axesX,
axesY,
id )

set axes limits for the currently shown or id dataset

Parameters
id[optional], id of the dataset, otherwise the currently shown dataset (obj.Id)
Return values
axesXa vector [min, max] for the X
axesYa vector [min, max] for the Y

Examples:

[axesX, axesY] = obj.mibModel.getAxesLimits(); // call from mibController: get axes limits for the currently shown dataset
[axesX, axesY] = obj.mibModel.getAxesLimits(2); // call from mibController: get axes limits for dataset 2

◆ setData2D()

function result = mibModel.setData2D ( type,
slice,
slice_no,
orient,
col_channel,
options )

set the 2D slice with colors: height:width:colors to the dataset

Parameters
typetype of the slice to set, image, model,mask, selection, custom (custom indicates to use custom_img as the dataset), everything(model,mask and selection for imageData.model_type=='uint6' only)
slice2D image with colors
  • if options.roiId is not used, slice can be either a cell ({1}[1:height, 1:width, 1:colors]; for all other types: {1}[1:height, 1:width]) or a matrix ([1:height, 1:width, 1:colors]; for all other types: [1:height, 1:width])
  • if options.roiId is used, slice should be a cell array ({roiId}[1:height, 1:width, 1:colors]; for all other types: {roiId}[1:height, 1:width])
slice_no[optional], an index of the slice to update, when NaN updates the current slice
orient[optional], can be NaN
  • when 0 (default) updates the dataset transposed from the current orientation (obj.orientation)
  • when 1 returns transposed dataset from the zx configuration: [x,z,c,y,t] -> [y,x,c,z,t]
  • when 2 returns transposed dataset from the zy configuration: [y,z,c,y,t] -> [y,x,c,z,t]
  • when 3 not used
  • when 4 returns original dataset from the yx configuration: [y,x,c,z,t]
  • when 5 not used
col_channel[optional], can be NaN
  • when type is image, col_channel is a vector with color numbers to take, when NaN [default] take the colors selected in the imageData.slices{3} variable, when 0 - take all colors of the dataset.
  • when type is model col_channel may be NaN - to take all materials of the model or an integer to take specific material. In the later case the selected material in slice will have index = 1.
options[optional], a structure with extra parameters
  • .blockModeSwitch -> override the block mode switch mibImage.blockModeSwitch; use or not the block mode (0 - update full dataset, 1 - update only the shown part)
  • .roiId -> use or not the ROI mode (when missing or less than 0, update full dataset, without ROI; 0 - update all ROIs of dataset, Index - update ROI with the index, [] - currently selected) (Attention: see also fillBg parameter!)
  • .fillBg -> when 1 -> keep the background from slice; when NaN or [] [default] -> crop slice with respect to the ROI shape
  • .y -> [optional], [ymin, ymax] of the part of the slice to set (sets .blockModeSwitch to 0)
  • .x -> [optional], [xmin, xmax] of the part of the slice to set (sets .blockModeSwitch to 0)
  • .t -> [optional], [tmin, tmax] indicate the time point to set, when missing return the currently selected time point
  • .level -> [optional], index of image level from the image pyramid
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset
Return values
result1-success, 1-fail, result of function execution
Required fields of options:

Examples:

slice = obj.mibModel.setData2D('image', slice, 5); // Call from mibController: set the 5-th slice of the current stack orientation
slice = obj.mibModel.setData2D('image', slice, 5, 4, 2); // Call from mibController: set the 5-th slice of the XY-orientation, color channel=2
Attention
sensitive to the
mibGUI.handles.toolbarBlockModeSwitch; if the blockMode should be disabled use options.blockModeSwitch=0
not sensitive to the shown ROI, if areas under ROIs are required use options.roiId and options.fillBg parameters

References handle.notify.

◆ setData3D()

function result = mibModel.setData3D ( type,
dataset,
time,
orient,
col_channel,
options )

set the 3D dataset with colors: height:width:colors:depth to the dataset

Parameters
typetype of the dataset to set, image, model,mask, selection, custom (custom indicates to use custom_img as the dataset), everything(model,mask and selection for imageData.model_type=='uint6' only)
dataseta 3D image with colors
  • if options.roiId is not used, dataset can be either a cell ({1}[1:height, 1:width, 1:colors, 1:depth]; for all other types: {1}[1:height, 1:width, 1:depth]) or a matrix ([1:height, 1:width, 1:colors, 1:depth]; for all other types: [1:height, 1:width, 1:depth])
  • if options.roiId is used, dataset should be a cell array ({roiId}[1:height, 1:width, 1:colors, 1:depth]; for all other types: {roiId}[1:height, 1:width, 1:depth])
time[optional], an index of the time point to show, when NaN gets the dataset for the current time point
orient[optional], can be NaN
  • when 0 (default) updates the dataset transposed from the current orientation (obj.orientation)
  • when 1 returns transposed dataset from the zx configuration: [x,z,c,y,t] -> [y,x,c,z,t]
  • when 2 returns transposed dataset from the zy configuration: [y,z,c,y,t] -> [y,x,c,z,t]
  • when 3 not used
  • when 4 returns original dataset from the yx configuration: [y,x,c,z,t]
  • when 5 not used
col_channel[optional], can be NaN
  • when type is image, col_channel is a vector with color numbers to take, when NaN [default] take the colors selected in the imageData.slices{3} variable, when 0 - take all colors of the dataset.
  • when type is model col_channel may be NaN - to take all materials of the model or an integer to take specific material. In the later case the selected material in slice will have index = 1.
options[optional], a structure with extra parameters
  • .blockModeSwitch -> override the block mode switch mibImage.blockModeSwitch; use or not the block mode (0 - update full dataset, 1 - update only the shown part)
  • .roiId -> use or not the ROI mode (when missing or less than 0, update full dataset, without ROI; 0 - update all ROIs of dataset, Index - update ROI with the index, [] - currently selected) (Attention: see also fillBg parameter!)
  • .fillBg -> when 1 -> keep the background from slice; when NaN or [] [default] -> crop slice with respect to the ROI shape
  • .y -> [optional], [ymin, ymax] of the part of the dataset to take (sets .blockModeSwitch to 0)
  • .x -> [optional], [xmin, xmax] of the part of the dataset to take (sets .blockModeSwitch to 0)
  • .z -> [optional], [zmin, zmax] of the part of the dataset to take (sets .blockModeSwitch to 0)
  • .level -> [optional], index of image level from the image pyramid
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset
  • .PixelIdxList -> [optional], indices of pixels that have to be updated (calculated for the current 3D stack of the dataset in the XY orientation), when used all other parameters are not considered also in this case dataset should be a vector. [not implemented for images
Return values
result-> 1 - success, 0 - error
Required fields of options:

Examples:

dataset = obj.mibModel.setData3D('image', dataset); // Call from mibController: set the 4D dataset for the current time point, in the shown orientation
dataset = obj.mibModel.setData3D('image', dataset, 5, 4); // Call from mibController: set the 4D dataset for the 5-th time point in the XY orientation
dataset = obj.mibModel.setData3D('selection', dataset, 5, 1, 2); // Call from mibController: set the 5-th timepoint in the the XZ-orientation, color channel=2
dataset = obj.mibModel.setData3D('image', dataset, [], 4); // Call from mibController: set the 4D dataset for the current time point in the XY orientation
Attention
sensitive to the
mibGUI.handles.toolbarBlockModeSwitch; if the blockMode should be disabled use options.blockModeSwitch=0
not sensitive to the shown ROI, if areas under ROIs are required use options.roiId and options.fillBg parameters

References max.

◆ setData4D()

function result = mibModel.setData4D ( type,
dataset,
orient,
col_channel,
options )

result = setData4D(obj, type, dataset, orient, col_channel, options) Set complete 4D dataset with colors [height:width:colors:depth:time]

Parameters
typetype of the dataset to update, image, model,mask, selection, or everything (model,mask and selection for imageData.model_type=='uint6' only)
dataset4D or 5D stack.
  • if options.roiId is not used, dataset can be either a cell ({1}[1:height, 1:width, 1:colors, 1:depth, 1:time]; for all other types: {1}[1:height, 1:width, 1:depth, 1:time]) or a matrix ([1:height, 1:width, 1:colors, 1:depth, 1:time]; for all other types: [1:height, 1:width, 1:depth, 1:time])
  • if options.roiId is used, dataset should be a cell array ({roiId}[1:height, 1:width, 1:colors, 1:depth, 1:time]; for all other types: {roiId}[1:height, 1:width, 1:depth, 1:time])
orient[optional], can be NaN
  • when 0 (default) updates the dataset transposed from the current orientation (obj.orientation)
  • when 1 updates transposed dataset from the zx configuration: [x,z,c,y,t] -> [y,x,c,z,t]
  • when 2 updates transposed dataset from the zy configuration: [y,z,c,y,t] -> [y,x,c,z,t]
  • when 3 not used
  • when 4 updates original dataset from the yx configuration: [y,x,c,z,t]
  • when 5 not used
col_channel[optional],
  • when type is image, col_channel is a vector with color numbers to take, when NaN [default] take the colors selected in the imageData.slices{3} variable, when 0 - take all colors of the dataset.
  • when type is model col_channel may be NaN - to take all materials of the model or an integer to take specific material. In the later case the selected material will have index = 1.
options[optional], a structure with extra parameters
  • .blockModeSwitch -> override the block mode switch mibImage.blockModeSwitch; use or not the block mode (0 - return full dataset, 1 - return only the shown part)
  • .roiId -> use or not the ROI mode (when missing or less than 0, update full dataset, without ROI; 0 - update all ROIs of dataset, Index - update ROI with the index, [] - currently selected) (Attention: see also fillBg parameter!)
  • .fillBg -> when 1 -> keep the background from slice; when NaN or [] [default] -> crop slice with respect to the ROI shape
  • .y -> [optional], [ymin, ymax] coordinates of the dataset to take after transpose, height (sets .blockModeSwitch to 0)
  • .x -> [optional], [xmin, xmax] coordinates of the dataset to take after transpose, width (sets .blockModeSwitch to 0)
  • .z -> [optional], [zmin, zmax] coordinates of the dataset to take after transpose, depth (sets .blockModeSwitch to 0)
  • .t -> [optional], [tmin, tmax] coordinates of the dataset to take after transpose, time
  • .level -> [optional], index of image level from the image pyramid
  • .id -> [optional], an index dataset from 1 to 9, defalt = currently shown dataset
  • .replaceDatasetSwitch -> [optional], force to replace dataset completely with a new dataset
  • .keepModel -> [optional], do not resize the model/selection layers when type=image and submitting complete dataset; as result the selection/model layers have to be modified manually layer. Used in mibResampleController. Default = 1;
Return values
result-> 1 - success, 0 - error
Required fields of options:

Examples:

obj.mibModel.setData4D('image', dataset); // Call from mibController: update the complete dataset in the shown orientation
obj.mibModel.setData4D('image', dataset, NaN, NaN, options.blockModeSwitch=1); // Call from mibController: update the croped to the viewing window dataset, with shown colors
obj.mibModel.setData4D('image', dataset, 4, 2); // Call from mibController: update complete dataset in the XY orientation with only second color channel
Attention
sensitive to the
mibGUI.handles.toolbarBlockModeSwitch; if the blockMode should be disabled use options.blockModeSwitch=0
not sensitive to the shown ROI, if areas under ROIs are required use options.roiId and options.fillBg parameters

References max, and min.

◆ setDefaultSegmentationColorPalette()

function mibModel.setDefaultSegmentationColorPalette ( paletteName,
colorsNo )

set default color palette for materials of the model

Parameters
paletteNamestring with the name of the palette to use, see below for the options
colorsNo[optional], numeric, number of required color channels

Examples:

obj.mibModel.setDefaultSegmentationColorPalette('Default, 6 colors'); // call from mibController: selects the default color scheme with 6 colors
obj.mibModel.setDefaultSegmentationColorPalette('Qualitative (Monte Carlo->Half Baked), 3-12 colors', 6); // call from mibController: set "Qualitative (Monte Carlo->Half Baked)" palette with 6 colors

References mibGenerateDefaultSegmentationPalette(), mibInputDlg(), and handle.notify.

Here is the call graph for this function:

◆ setImageProperty()

function mibModel.setImageProperty ( propertyName,
propertyValue,
id )

set desired property for the currently shown or id dataset

Parameters
propertyNamea string with property name for mibImage class
propertyValuea value for the desired property
id[optional], id of the dataset, otherwise the currently shown dataset (obj.Id)

Examples:

obj.mibModel.setImageProperty('orientation', 4); // call from mibController: set current orientation to 4
obj.mibModel.setImageProperty(2, 4); // call from mibController: set orientation to 4 to dataset 4

◆ setMagFactor()

function mibModel.setMagFactor ( magFactor,
id )

set magnification for the currently shown or id dataset

Parameters
magFactormagnification factor
id[optional], id of the dataset, otherwise the currently shown dataset (obj.Id)

Examples:

obj.mibModel.setMagFactor(2); // call from mibController: set current magFactor to 2
obj.mibModel.setMagFactor(2, 4); // call from mibController: set current magFactor to 2 for dataset 4

◆ setPixSize()

function mibModel.setPixSize ( pixSize,
id )

set pixSize structure for the currently shown or id dataset

Parameters
pixSizea structure with diminsions of voxels,
.x .y .z .t .tunits .units
the fields are
  • .x - physical width of a pixel
  • .y - physical height of a pixel
  • .z - physical thickness of a pixel
  • .t - time between the frames for 2D movies
  • .tunits - time units
  • .units - physical units for x, y, z. Possible values: [m, cm, mm, um, nm]
id[optional], id of the dataset, otherwise the currently shown dataset (obj.Id)

Examples:

obj.mibModel.setPixSize(pixSize); // call from mibController: set pixSize for the currently shown dataset
obj.mibModel.setPixSize(pixSize, 4); // call from mibController: set pixSize for dataset 4

◆ smoothImage()

function mibModel.smoothImage ( type,
BatchOptIn )

smooth Mask, Selection or Model layer

Parameters
typea string with type of the layer for the smoothing
  • 'selection' - smooth the Selection layer
  • 'model' - smooth the Model layer
  • 'mask' - smooth the Mask layer
BatchOptIna structure for batch processing mode, when NaN return a structure with default options via "syncBatch" event, see Declaration of the BatchOpt structure below for details, the function variables are preferred over the BatchOptIn variables
  • .Target - cell string, {mask, selection, model} - layer to smooth
  • .showWaitbar - logical, show or not the waitbar
  • .id -> [optional], index of the dataset for the smoothing

References mibDoImageFiltering(), mibInputMultiDlg(), min, handle.notify, and updateBatchOptCombineFields_Shared().

Here is the call graph for this function:

◆ transposeDataset()

function mibModel.transposeDataset ( mode,
showWaitbar,
noColorChannels )

Transpose dataset physically between dimensions.

Parameters
mode-> a string that defines the transpose dimension
  • Transpose YX -> YZ, transpose the dataset so that YX->YZ
  • Transpose YX -> XZ, transpose the dataset so that YX->XZ
  • Transpose YX -> XY, transpose the dataset so that YX->XY
  • Transpose YX -> ZX, transpose the dataset so that YX->ZX
  • 'Transpose Z<->T' -> transpose so that Z-dimension becomes T-dimension
  • 'Transpose Z->C' -> transpose Z to C, if noColorChannels
showWaitbarlogical, show or not the waitbar
noColorChannelsnumeric, a number of color channels for the 'Transpose Z->C' mode; provide NaN to generate as many color channels as Z-sections Return values:

References handle.notify, and handle.permute.

◆ transposeZ2T()

function mibModel.transposeZ2T ( )

transpose Z to T dimension

References handle.permute.

Member Data Documentation

◆ changeSlice

EVENT mibModel.changeSlice

change of a slice number using the slider

Events
changeSlice

◆ changeTime

EVENT mibModel.changeTime

change of a time point using the slider

Events
changeTime

◆ connImaris

mibModel.connImaris

a handle to Imaris connection

◆ cpuParallelLimit

mibModel.cpuParallelLimit

max number of parallel workers available

Referenced by mibModel().

◆ disableSegmentation

mibModel.disableSegmentation

a switch 0/1 to disable segmentation tools while for example modifying ROIs

◆ displayedLutColors

mibModel.displayedLutColors

a matrix with the currently shown colors for the color channels (updated in mibController.redrawMibChannelMixerTable function)

◆ I

mibModel.I

variable for keeping instances of mibImage

◆ Id

mibModel.Id

id of the currently shown dataset

Note
This property has the MATLAB attribute SetObservable set to true.
Matlab documentation of property attributes.

◆ keyPressEvent

EVENT mibModel.keyPressEvent

event triggered by a child widget to call for key press callback of MIB

Events
keyPressEvent

◆ matlabVersion

mibModel.matlabVersion

version of Matlab

◆ maxId

mibModel.maxId

maximal number of mibImage instances

Referenced by loadModel().

◆ mibAnnMarkerEdit

mibModel.mibAnnMarkerEdit

a string with the mode to show the annotation: marker, label, value, label + value (default)

◆ mibAnnValueEccentricCheck

mibModel.mibAnnValueEccentricCheck

enable value-eccentric annotations, 0 - annotation text first, value second; 1 - annotation value first, text - second

◆ mibAnnValuePrecision

mibModel.mibAnnValuePrecision

precision of annotation values, an integer from 0 and above

◆ mibHideImageCheck

mibModel.mibHideImageCheck

define whether or not dispay the image layer (used in obj.getRGBimage) a status of mibCpontroller.mibView.handles.mibHideImageCheck.Value

◆ mibLiveStretchCheck

mibModel.mibLiveStretchCheck

define whether or not stretch the image intensities (used in obj.getRGBimage) a status of mibCpontroller.mibView.handles.mibLiveStretchCheck.Value

◆ mibMaskShowCheck

mibModel.mibMaskShowCheck

define whether or not dispay the mask layer (used in obj.getRGBimage) a status of mibCpontroller.mibView.handles.mibMaskShowCheck.Value

◆ mibModelShowCheck

mibModel.mibModelShowCheck

define whether or not dispay the model layer (used in obj.getRGBimage) a status of mibCpontroller.mibView.handles.mibModelShowCheck.Value

◆ mibPrevId

mibModel.mibPrevId

id of the previously selected mibModel container

◆ mibPython

mibModel.mibPython

link to python environment started from MIB

◆ mibSegmShowTypePopup

mibModel.mibSegmShowTypePopup

type of model visualization: 1 - filled; 2 - contour

◆ mibShowAnnotationsCheck

mibModel.mibShowAnnotationsCheck

show or not the annotations

Referenced by mibMeasure.addMeasurementsToPlot().

◆ mibShowLines3DCheck

mibModel.mibShowLines3DCheck

show or not 3D lines

◆ modelNotify

EVENT mibModel.modelNotify

generic notification event to make the list of listners smaller, call it as notify(obj, modelNotify, eventdata); see in mibModel.renameMaterial, mibModel.materialActions eventdata; motifyEvent.Name = has description of the event

Events
modelNotify

◆ myPath

mibModel.myPath

current working directory

◆ newDataset

EVENT mibModel.newDataset

loaded or imported a new dataset

Events
newDataset

◆ newDatasetLite

EVENT mibModel.newDatasetLite

loaded or imported a new dataset but without clearing the undo history

Events
newDatasetLite

◆ newDatasetSwitch

mibModel.newDatasetSwitch

a switch 0/1 which is changed when a new dataset is opened (updated in mibController.Listner2_Callback)

Note
This property has the MATLAB attribute SetObservable set to true.
Matlab documentation of property attributes.

◆ plotImage

EVENT mibModel.plotImage

ask to redraw the image from mibController

Events
plotImage

◆ preferences

mibModel.preferences

a structure with program preferences

◆ sessionSettings

mibModel.sessionSettings

a structure with settings for some tools used during the current session of MIB .automaticAlignmentOptions -> a structure used in mibAlignmentController .guiImages - CData for images to be shown on some buttons

◆ setData

EVENT mibModel.setData

when the set data method was used

Events
setData

◆ showAllMaterials

mibModel.showAllMaterials

a switch to show all materials of the model, or only a single one; defined in mibView.handles.mibSegmentationTable

◆ showMask

EVENT mibModel.showMask

an event that enables the obj.mibController.mibView.handles.mibMaskShowCheck.Value

Events
showMask

◆ showModel

EVENT mibModel.showModel

an event that enables the obj.mibController.mibView.handles.mibModelShowCheck.Value;

eventdata = ToggleEventData(1); // show the model
notify(obj.mibModel, 'showModel', eventdata);
notify
Broadcast a notice that a specific event is occurring on a specified handle object or array of handle...
Definition class_substitutes.c:112
Events
showModel

◆ stopProtocol

EVENT mibModel.stopProtocol

stop batch protocol from execution

Events
stopProtocol

◆ storedSelection

mibModel.storedSelection

a buffer to store selection with press of Ctrl+C button, and restore with Ctrl+V

Note
dimensions are
{1}[1:height, 1:width] or []

◆ syncBatch

EVENT mibModel.syncBatch

synchromize structure for batch actions

Events
syncBatch

◆ U

mibModel.U

variable for Undo history

◆ undoneBackup

EVENT mibModel.undoneBackup

when the undo is triggered

Events
undoneBackup

◆ updatedAnnotations

EVENT mibModel.updatedAnnotations

event that the annotation list has been updated for use with mibAnnotationsController

Events
updatedAnnotations

◆ updatedLines3D

EVENT mibModel.updatedLines3D

event that the lines3D class was updated for use with mibLines3DController

Events
updatedLines3D

◆ updateGuiWidgets

EVENT mibModel.updateGuiWidgets

event after update of GuiWidgets of mibController

Events
updateGuiWidgets

◆ updateId

EVENT mibModel.updateId

updating Id

Events
updateId

◆ updateImgInfo

EVENT mibModel.updateImgInfo

meta data was has been updated, works via obj.getImageMethod

Events
updateImgInfo

◆ updateLayerSlider

EVENT mibModel.updateLayerSlider

event to trigger update of mibView.handles.mibChangeLayerSlider based on provided value, see mibAnnotationController.tableContextMenu_cb

Events
updateLayerSlider

◆ updateROI

EVENT mibModel.updateROI

event after change number of ROIs

Events
updateROI

◆ updateSegmentationTable

EVENT mibModel.updateSegmentationTable

update the segmentation table

Events
updateSegmentationTable

◆ updateTimeSlider

EVENT mibModel.updateTimeSlider

event to trigger update of mibView.handles.mibTimeSlider based on provided value, see mibAnnotationController.tableContextMenu_cb

Events
updateTimeSlider

◆ updateUserScore

EVENT mibModel.updateUserScore

event to trigger counting user scores

eventdata = ToggleEventData(5); // increase the user score by x5 times of Prefs.Users.singleToolScores value
notify(obj.mibModel, 'updateUserScore', eventdata);
Events
updateUserScore

The documentation for this class was generated from the following files: