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

a basic class to contain individual datasets loaded in MIB. This class is ruled by the mibModel class More...

Inheritance diagram for mibImage:
Collaboration diagram for mibImage:

Public Member Functions

properties(SetAccess=private, GetAccess=private) *listener *% a cell array with handles to listeners *end */events *closeVirtualDatasets *end */public function output = addFrameToImage (BatchOpt)
 Add a frame around the dataset see also addFrame function.
 
function bbShiftXY = addStack (I2, shiftX, shiftY, options)
 bbShiftXY = addStack(obj, I2, shiftX, shiftY, options) Add I2 to mibImage and shift stacks according to shiftX, shiftY translation coefficients
 
function  clearContents (img, metaIn, enableSelection)
 Set all elements of the class to default values.
 
function  clearMask (options)
 Clear the Mask layer. It is also possible to specify the area where the Mask layer should be cleared using the options structure.
 
function  clearSelection (height, width, z, t, blockModeSwitch)
 Clear the Selection layer. It is also possible to specify the area where the Selection layer should be cleared.
 
function  closeVirtualDataset ()
 Close opened virtual dataset readers.
 
function status = convertImage (format, options)
 Convert image to specified format: grayscale, truecolor, indexed and uint8, uint16, uint32 class.
 
function  convertModel (type)
 Convert model from obj.modelType==63 to obj.modelType==255 and other way around.
 
function PixelIdxList = convertPixelIdxListCrop2Full (PixelIdxListCrop, options)
 convert PixelIdxList of the cropped dataset to PixelIdxList of the full dataset, only for 4D datasets (h, w, depth, time)
 
function [ x , y , z ] = convertPixelsToUnits (x, y, z)
 convert pixel with x, y, z coordinate to the physical imaging units
 
function [ x , y , z ] = convertUnitsToPixels (x, y, z)
 convert coordinate with x, y, z in physical units to pixels
 
function  copyColorChannel (channel1, channel2, options)
 Copy intensity from the first color channel (channel1) to the position of the second color channel (channel2)
 
function result = copySlice (sliceNumberFrom, sliceNumberTo, orient, options)
 Copy specified slice from one part of the dataset to another.
 
function  createModel (model_type, modelMaterialNames)
 Create an empty model: allocate memory for a new model.
 
function result = cropDataset (cropF, options)
 Crop image and all corresponding layers of the opened dataset.
 
function  deleteColorChannel (channel1, options)
 Delete specified color channel from the dataset.
 
function result = deleteSlice (sliceNumber, orient, options)
 Delete specified slice from the dataset.
 
function  generateModelColors ()
 Generate list of colors for materials of a model.
 
function bb = getBoundingBox ()
 Get Bounding box info as a vector [xmin, xmax, ymin, ymax, zmin, zmax].
 
function [ yMin , yMax , xMin , xMax , zMin , zMax ] = getCoordinatesOfShownImage (transposeTo4)
 Return minimal and maximal coordinates (XY) of the image that is currently shown.
 
function slice_no = getCurrentSliceNumber ()
 Get slice number of the currently shown image.
 
function timePnt = getCurrentTimePoint ()
 Get time point of the currently shown image.
 
function dataset = getData (type, orient, col_channel, options, custom_img)
 Get dataset from mibImage class.
 
function dataset = getDataVirt (type, orient, col_channel, options, custom_img)
 Get virtual dataset from mibImage class.
 
function [ height , width , color , depth , time ] = getDatasetDimensions (type, orient, color, options)
 Get dimensions of the dataset.
 
function [ totalSize , imSize ] = getDatasetSizeInBytes ()
 Get size of the loaded dataset in bytes.
 
function [ lowIn , highIn , lowOut , highOut ] = getImAdjustStretchCoef (channel)
 Return image stretching coefficients to be used for imadjust function to stretch contrast of the image.
 
function dataset = getPixelIdxList (type, PixelIdxList, options)
 dataset = getPixelIdxList(obj, type, PixelIdxList, options) Get dataset from the list of pixel indices
 
function bb = getROIBoundingBox (roiIndex)
 return the bounding box info for the ROI at the current orientation
 
function index = getSelectedMaterialIndex (target)
 return the index of the currently selected material in the mibView.handles.mibSegmentationTable
 
function [ labelsList , labelValues , labelPositions , indices ] = getSliceLabels (sliceNumber, timePoint, options)
 [labelsList, labelValues, labelPositions, indices] = getSliceLabels(obj, sliceNumber, timePoint, options) Get list of labels (mibImage.hLabels) shown at the specified slice
 
function  insertEmptyColorChannel (channel1, options)
 Insert an empty color channel to the specified position.
 
function  insertSlice (img, insertPosition, meta, options)
 Insert a slice or a dataset into the existing volume.
 
function  invertColorChannel (channel1, options)
 Invert color channel of the dataset.
 
function result = materialsInsert (materialIndex, materialName, options)
 Insert material with materialName into position materialIndex.
 
function status = materialsRemove (materialIndex, options)
 Remove material from the model.
 
function status = materialsRename (materialName, materialIndex, options)
 Rename material with index materialIndex using a new materialName.
 
function status = materialsReorder (newOrder, options)
 Reorder materials in the model.
 
function result = materialsSwap (materialIndex1, materialIndex2, options)
 Swap material1 and material2 in the model.
 
function status = materialsSwapColors (material1, material2)
 Swap colors for material1 and material2 in the model.
 
function status = modelExportToMatlab (materialOutputVariable, materialIndex, materialOutputIndex, options)
 Export model or material of the model to MATLAB main workspace. The exported variable has following fields: .model 3D or 4D matrix [1:height, 1:width, 1:depth, 1:time] with the model .modelMaterialNames - cell array with names of the exported materials .modelMaterialColors - matrix with colors of materials [colorID; R,G,B] in the range from 0 to 1 .modelType - integer with the model type, 64, 255, 65535.
 
function  moveMaskToModelDataset (action_type, options)
 Move the Mask layer to the Model layer.
 
function  moveMaskToSelectionDataset (action_type, options)
 Move the Mask layer to the Selection layer.
 
function  moveModelToMaskDataset (action_type, options)
 Move the selected Material to the Mask layer.
 
function  moveModelToSelectionDataset (action_type, options)
 Move the selected Material to the Selection layer.
 
function  moveSelectionToMaskDataset (action_type, options)
 Move the Selection layer to the Mask layer.
 
function  moveSelectionToModelDataset (action_type, options)
 Move the Selection layer to the Model layer.
 
function  moveView (x, y, orient)
 Center the image view at the provided coordinates: x, y.
 
function  replaceImageColor (type, color_id, channel_id, slice_id, time_pnt, options)
 Replace image intensities in the Masked or Selected areas with new intensity value.
 
function result = resliceDataset (sliceNumber, orient, options)
 stride reslicing the dataset so that the selected slices are kept and all others are removed
 
function  rotateColorChannel (channel1, angle, options)
 Rotate color channel of the dataset.
 
function fnOut = saveImageAsDialog (filename, options)
 save image to a file
 
function fnOut = saveMask (filename, options)
 save mask to a file
 
function fnOut = saveModel (filename, options)
 save model to a file
 
function result = setData (type, dataset, orient, col_channel, options)
 result = setData(obj, type, dataset, orient, col_channel, options) Set dataset
 
function result = setPixelIdxList (type, dataset, PixelIdxList, options)
 result = setPixelIdxList(obj, type, dataset, PixelIdxList, options) Set dataset
 
function  shiftColorChannel (channel1, dx, dy, fillValue, options)
 Shift color channel (channel1) by dx/dy pixels.
 
function  swapColorChannels (channel1, channel2, options)
 Swap two color channels of the dataset.
 
function result = swapSlices (sliceNumberFrom, sliceNumberTo, orient, options)
 Swap specified slices.
 
function newMode = switchVirtualStackingMode (newMode, enableSelection)
 Function to switch between loading datasets to memory or reading them from HDD on demand.
 
function  transpose (new_orient)
 Change orientation of the image to the XY, XZ, or YZ plane.
 
function  updateBoundingBox (newBB, xyzShift, imgDims)
 Update the bounding box info of the dataset.
 
function  updateDisplayParameters ()
 Update display parameters for visualization (mibImage.viewPort structure)
 
function result = updatePixSizeResolution (pixSize)
 Update mibImage.pixelSize, mibImage.meta('XResolution') and mibImage.meta('XResolution') and mibImage.volren.
 
function  updateServiceMetadata (metaIn)
 update service metadata of MIB based on obj.img and metaIn
 
function  updateSlicesStructure (axesX, axesY)
 updates obj.slices structure using the provided axesX, axesY boundaries
 
function  updateImgInfo (addText, action, entryIndex)
 Update action log.
 
 mibImage (img, meta, options)
 obj = mibImage(img, meta, options) mibImage class constructor
 
 methods (Static) *% function Listner_Callback(obj
 
*obj Virtual *end *end **function Listner2_Callback (obj, src, evnt) *switch evnt.EventName *case 'closeVirtualDatasets' *obj.closeVirtualDataset()
 

Public Attributes

 axesX
 properties of the class a vector [min, max] with minimal and maximal coordinates of the axes X of the mibView.handles.mibImageAxes axes; use
 
 axesY
 a vector [min, max] with minimal and maximal coordinates of the axes Y of the mibView.handles.mibImageAxes axes; use
 
 BioFormatsMemoizerMemoDir
 path to directory where BioFormats Memoizer is storing memo files
 
 blockModeSwitch
 a variable to hold a status of the block mode (mibView.handles.toolbarBlockModeSwitch), 1 - enabled, 0 - disabled
 
 colors
 number of color channels
 
 current_yxz
 a vector to remember last selected slice number of each yx, zx, zy planes,
 
 dim_yxczt
 a matrix with dimensions of the dataset [height, width, colors, depth, time] equal to size obj.img{1} for non-virtual datasets
 
 depth
 number of stacks in the dataset
 
 defaultAnnotationText
 default text for the annotations
 
 defaultAnnotationValue
 default value for the annotations
 
 enableSelection
 a switch (0/1) to enable or not the selection, mask, model layers
 
 fixSelectionToMask
 a switch indicating the value of the obj.mibView.handles.mibMaskedAreaCheck
 
 fixSelectionToMaterial
 a switch indicating the value of the obj.mibView.handles.mibSegmSelectedOnlyCheck
 
 height
 image height, px
 
 hLabels
 a handle to class for keeping annotations
 
 hLines3D
 a handle to class for keeping 3D Lines and skeletons
 
 hMeasure
 a handle to class to keep measurements
 
 hROI
 handle to ROI class, mibRoiRegion
 
 img
 a cell array to keep the Image layer. The layer img{1} has image in full resolution, img{2} - bin2, img{3} - bin4
 
 lastSegmSelection
 a vector with 2 elements of two previously selected materials for use with the e key shortcut
 
 lutColors
 a matrix with LUT colors [1:colorChannel, R G B], (0-1)
 
 magFactor
 magnification factor for the datasets, 1=100%, 1.5 = 150%; use
 
 maskExist
 a switch to indicate presense of the Mask layer. Can be 0 (no model) or 1 (model exist)
 
 maskImg
 a property to keep the Mask layer
 
 maskImgFilename
 file name of the Mask layer image
 
 maskStat
 Statistics for the Mask layer with the PixelList info returned by regionprops Matlab function.
 
 meta
 information about the dataset, an instance of the containers.Map class Default keys:
 
 model
 model is a property to keep the Model layer
 
 modelFilename
 modelFilename is a property to keep filename of the Model layer
 
 modelExist
 a switch to indicate presense of the Model layer. Can be 0 (no model) or 1 (model exist)
 
 modelMaterialColors
 a matrix of colors [0-1] for materials of the Model, [materialIndex, R G B]
 
 modelMaterialNames
 an array of strings to define names of materials of the Model
 
 modelType
 type for models
 
 modelVariable
 modelVariable is a variable name in the mat-file to keep the Model layer; default: mibModel'
 
 orientation
 Orientation of the currently shown dataset,.
 
 pixSize
 a structure with diminsions of voxels,
 
 selectedAddToMaterial
 index of selected Add to Material, where the Selection layer should be targeted, assigned in the AddTo column of the mibView.handles.mibSegmentationTable 1 - Mask; 2 - Exterior; 3 - first material of the model, 4 - second material etc
 
 selectedColorChannel
 color channel selected in the Color channel combo box of the Selection panel. 0 - all colors, 1, 2 - 1st, 2nd ...
 
 selectedMaterial
 index of material selected in the mibView.handles.mibSegmentationTable: 1 - Mask; 2 - Exterior; 3 - first material of the model, 4 - second material etc
 
 selectedROI
 a vector of indeces (as stored in mibRoiRegion class) of the selected ROI in the mibView.handles.mibRoiList table; -1 -> roi is not shown; [1, 3] -> first and third...
 
 selection
 a property to keep the Selection layer
 
 slices
 coordinates of the shown part of the dataset
 
 time
 number of time points in the dataset
 
 useLUT
 use or not LUT for visualization of image, a number 0 - do not use; 1 - use a status of mibCpontroller.mibView.handles.mibLutCheckbox.Value
 
 viewPort
 a structure with viewing parameters:
 
 Virtual
 a structure to work with virtual stacks
 
 volren
 a structure with parameters for the volume rendering the fields are
 
 width
 image width, px
 
 src
 
evnt *switch src Name * case
 
virtual close datasets
 

Detailed Description

a basic class to contain individual datasets loaded in MIB. This class is ruled by the mibModel class

Constructor & Destructor Documentation

◆ mibImage()

mibImage.mibImage ( img,
meta,
options )

obj = mibImage(img, meta, options) mibImage class constructor

Constructor for the mibImage class. Create a new instance of the class with default parameters

Parameters
imga new 2D-5D image stack
metaa containers.Map class with parameters of the dataset, can be []
optionsa structure with additional options for the initialization of the instance .modelType - an integer that defines type of the model to use, 63 (default)
  • 0 - an overlay type model with indices from -128 to 128
  • 63 - maximum 63 material for the model
  • 255 - maximum 255 material for the model
  • 65535 - maximum 65535 material for the model
  • 4294967295 - maximum 4294967295 material for the model .virtual - switch indicating that the dataset should be in the virtual mode,
  • 0 (default) - indicates that the dataset is in the memory mode
  • 1 - indicates that the dataset is in the virtual mode (i.e. the images are not loaded to memory)
Required fields of options:

References img, and meta.

Member Function Documentation

◆ addFrameToImage()

function BatchOpt = mibImage.addFrameToImage ( BatchOpt)

Add a frame around the dataset see also addFrame function.

Parameters
BatchOptan optional structure with parameters .Position - a cell string with position of the current image one of these options: {Center, Left-upper corner, Right-upper corner, Left-bottom corner,Right-bottom corner}; .NewImageWidth - a string with new image width in pixels .NewImageHeight - a string with new image height in pixels .FrameColorIntensity - a string with new image frame color intensity .showWaitbar - logical, show or not the waitbar
Return values
BatchOptstructure with parameters
Generated fields of BatchOpt:

Examples

BatchOpt = obj.mibModel.I{obj.mibModel.Id}.addFrameToImage(); // call from mibController; add a frame; parameters of the frame will be prompted

References colors, depth, height, max, mibInputMultiDlg(), min, time, and width.

Here is the call graph for this function:

◆ addStack()

function bbShiftXY = mibImage.addStack ( I2,
shiftX,
shiftY,
options )

bbShiftXY = addStack(obj, I2, shiftX, shiftY, options) Add I2 to mibImage and shift stacks according to shiftX, shiftY translation coefficients

Parameters
I2a stack to add [1:height, 1:width, 1:color, 1:depth]
shiftXa value for the X-shift
shiftYa value for the Y-shift
optionsan optional structure with options
  • .backgroundColor -> background color: black, white, mean, or a number
  • .SliceName -> cell array with slice names for the second dataset
  • .waitbar -> [optional] a handle to existing waitbar
Return values
bbShiftXYa vector [xMin, yMin] with shift of the reference dataset, or empty in case of problems
Required fields of options:

References depth, and max.

◆ clearContents()

function mibImage.clearContents ( img,
metaIn,
enableSelection )

Set all elements of the class to default values.

Parameters
img[optional], image to use to initialize the imageData class
metaIn[optional], containers.Map class with parameters of the dataset, can be []
enableSelectiona switch (0 or 1) to enable/disable selection layer

Examples:

obj.mibModel.I{obj.mibModel.Id}.clearContents(); // call from mibController to clear the class
obj.mibModel.I{obj.mibModel.Id}.clearContents(I, metadata); // call from mibController to reinitialize the class with image I and its metadata
obj.mibModel.getImageMethod('clearContents'); // call from mibController via a wrapper function getImageMethod

References enableSelection, img, max, meta, min, and uint32.

◆ clearMask()

function mibImage.clearMask ( options)

Clear the Mask layer. It is also possible to specify the area where the Mask layer should be cleared using the options structure.

Parameters
options[optional] a structure with optional area to clear
  • .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
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.clearMask(); // call from mibController; clear the mask layer

References max, and min.

◆ clearSelection()

function mibImage.clearSelection ( y,
x,
z,
t,
blockModeSwitch )

Clear the Selection layer. It is also possible to specify the area where the Selection layer should be cleared.

Parameters
y[optional], can be NaN, a vector of Y for example [1:mibImage.height] or [minY, maxY]; or a string with the mode (2D, 3D, 4D)
x[optional], can be NaN, a vector of X, for example [1:mibImage.width] or [minX, maxX]
z[optional] a vector of z-values, for example [1:mibImage.depth] or [minZ, maxZ]
t[optional] a vector of t-values, for example [1:mibImage.time] or [minT, maxT]
blockModeSwitch[optional] a switch use (1) or not (0) the blockMode

Examples:

obj.mibModel.I{obj.mibModel.Id}.clearSelection(); // call from mibController, clear the Selection layer completely
obj.mibModel.I{obj.mibModel.Id}.clearSelection(1:imageData.y, 1:imageData.x, 1:3); // call from mibController, clear the Selection layer only in 3 first slices

References blockModeSwitch, img, max, and min.

◆ closeVirtualDataset()

function mibImage.closeVirtualDataset ( )

Close opened virtual dataset readers.

◆ convertImage()

function status = mibImage.convertImage ( format,
options )

Convert image to specified format: grayscale, truecolor, indexed and uint8, uint16, uint32 class.

Parameters
formatdescription of the new image format
  • 'grayscale' - grayscale image, 1 color channel
  • 'truecolor' - truecolor image, 2 or 3 color channels (red, green, blue)
  • 'hsvcolor' - hsv color image, 3 color channels (hue, saturation, value)
  • 'indexed' - indexed colors, the color map is stored in imageData.img_info. Colormap
  • 'uint8' - 8-bit unsinged integer, [0 - 255] levels
  • 'uint16' - 16-bit unsinged integer, [0 - 65535] levels;
  • 'uint32' - 32-bit unsinged integer, [0 - 4294967295] levels; Note! Not Really tested...
optionsan optional structure with additional parameters .showWaitbar - show or not the waitbar
Return values
status1 -success, 0 -fail
Required fields of options:

Examples:

status = obj.mibModel.I{obj.mibModel.Id}.convertImage(obj, 'grayscale'); // Call from mibController; convert dataset to the grayscale type

References B(), img, max, mibInputDlg(), and uint32.

Here is the call graph for this function:

◆ convertModel()

function mibImage.convertModel ( type)

Convert model from obj.modelType==63 to obj.modelType==255 and other way around.

Note
The current type is defined with obj.modelType
Parameters
type[optional] a double with type of a new model:
  • 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 2objects (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

Examples:

obj.mibModel.I{obj.mibModel.Id}.convertModel(255); // convert model to the obj.modelType==255 type

References img, max, and uint32.

◆ convertPixelIdxListCrop2Full()

function PixelIdxList = mibImage.convertPixelIdxListCrop2Full ( PixelIdxListCrop,
options )

convert PixelIdxList of the cropped dataset to PixelIdxList of the full dataset, only for 4D datasets (h, w, depth, time)

Parameters
PixelIdxListCropvector of indices of the cropped dataset
optionsa structure with parameters
  • .y -> [ymin, ymax] y-dimensions of the cropped dataset
  • .x -> [xmin, xmax] x-dimensions of the cropped dataset
  • .z -> [optional], [zmin, zmax] z-dimensions of the cropped dataset
Required fields of options:

Examples:

[yMin, yMax, xMin, xMax, zMin, zMax] = obj.mibModel.I{obj.mibModel.Id}.getCoordinatesOfShownImage(4);
convertPixelOpt.y = [yMin yMax]; // y-dimensions of the cropped dataset
convertPixelOpt.x = [xMin xMax]; // x-dimensions of the cropped dataset
convertPixelOpt.z = [zMin, zMax]; // z-dimensions of the cropped dataset
PixelIdxListFull = obj.mibModel.I{obj.mibModel.Id}.convertPixelIdxListCrop2Full(PixelIdxListFullCrop, convertPixelOpt);

◆ convertPixelsToUnits()

function [ x , y , z ] = mibImage.convertPixelsToUnits ( x,
y,
z )

convert pixel with x, y, z coordinate to the physical imaging units

Note
See also
similar function in the Tools\convertPixelsToUnits
Parameters
x-> x - coordinate in pixels
y-> y - coordinate in pixels
z-> z - coordinate in pixels
Return values
x-> x - coordinate in physical units, i.e. um
y-> y - coordinate in physical units, i.e. um
z-> z - coordinate in physical units, i.e. um

Examples

[xUnits, xUnits, xUnits] = obj.mibModel.I{obj.mibModel.Id}.convertPixelsToUnits(xPixel, xPixel, xPixel);

◆ convertUnitsToPixels()

function [ x , y , z ] = mibImage.convertUnitsToPixels ( x,
y,
z )

convert coordinate with x, y, z in physical units to pixels

Parameters
x-> x - coordinate in physical units
y-> y - coordinate in physical units
z-> z - coordinate in physical units
Return values
x-> x - coordinate in pixels
y-> y - coordinate in pixels
z-> z - coordinate in pixels Examples:
[xPixel, xPixel, xPixel] = obj.mibModel.I{obj.mibModel.Id}.convertUnitsToPixels(xUnits, xUnits, xUnits);

◆ copyColorChannel()

function mibImage.copyColorChannel ( channel1,
channel2,
options )

Copy intensity from the first color channel (channel1) to the position of the second color channel (channel2)

The first color channel will be copied to the position of the second color channel

Parameters
channel1[optional] index of the source color channel
channel2[optional] index of the target color channel
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show .autoOverwrite - logical, 1 [default] - overwrite one existing color channel without a question prompt, 0 - ask for permission
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.copyColorChannel(1, 3); // call from mibController; copy intensities from channel 1 to channel 3
obj.mibModel.getImageMethod('copyColorChannel', NaN, 1, 3); // call from mibController via a wrapper function getImageMethod

References max, and mibInputMultiDlg().

Here is the call graph for this function:

◆ copySlice()

function result = mibImage.copySlice ( sliceNumberFrom,
sliceNumberTo,
orient,
options )

Copy specified slice from one part of the dataset to another.

Parameters
sliceNumberFromindex of the source slice
sliceNumberToindex of the destination slice
orient[optional], can be NaN (current orientation)
  • when 0 (default) the current orientation (obj.orientation)
  • when 1 the zx configuration: [x,z,c,y,t] -> [y,x,c,z,t]
  • when 2 the zy configuration: [y,z,c,y,t] -> [y,x,c,z,t]
  • when 3 not used
  • when 4 the yx configuration: [y,x,c,z,t]
  • when 5 the t configuration
optionsan optional structure with additional paramters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Return values
resultresult of the function, 0 fail, 1 success
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.copySlice(3, 10); // call from mibController; copy slice 3 to slice 10

◆ createModel()

function mibImage.createModel ( modelType,
modelMaterialNames )

Create an empty model: allocate memory for a new model.

This function reinitialize mibImage.model variable (NaN when no model present) with an empty matrix [mibImage.height, mibImage.width, mibImage.depth, mibImage.time] of the defined type class

Parameters
modelType[optional] a number that defines type of the model (when NaN - use default model type)
  • 63 - a segmentation model with up to 63 materials; the Model, Mask and Selection layers stored in the same matrix, to decrease memory consumption;
  • 255 - a segmentation model with up to 255 materials; the Model, Mask and Selection layers stored in separate matrices;
  • 65535 - a segmentation model with up to 65535 materials; the Model, Mask and Selection layers stored in separate matrices;
  • 4294967295 - a segmentation model with up to 4294967295 materials; the Model, Mask and Selection layers stored in separate matrices;
  • 127 - a model layer that has intensities from -128 to 127.
  • 32767 - a model layer that has intensities from -32768 to 32767.
modelMaterialNames[optional] a cell array with names of materials, this parameter is not used for modelType > 255

Examples:

obj.mibModel.I{obj.mibModel.Id}.createModel(63); // call from mibController; allocate space for a new Model layer, type 63
obj.mibModel.I{obj.mibModel.Id}.createModel(NaN, {'Material1','Material2'}); // call from mibController; allocate space for a new Model of the default type and assign 2 materials
obj.mibModel.getImageMethod('createModel', NaN, 63); // call from mibController via a wrapper function getImageMethod

References modelMaterialNames, and modelType.

◆ cropDataset()

function result = mibImage.cropDataset ( cropF,
options )

Crop image and all corresponding layers of the opened dataset.

Parameters
cropFa vector [x1, y1, dx, dy, z1, dz, t1, dt] with parameters of the crop. Note! The units are pixels!
options[optional] - structure with additional parameters
  • .showWaitbar - logical show or not the waitbar (default=true)
Return values
resultstatus of the operation, 1-success, 0-cancel
Required fields of options:

Examples:

cropF = [100 512 200 512 5 20]; // define parameters of the crop
obj.mibModel.I{obj.mibModel.Id}.cropDataset(cropF); // call from mibController; do the crop

References img, and min.

◆ deleteColorChannel()

function mibImage.deleteColorChannel ( channel1,
options )

Delete specified color channel from the dataset.

Parameters
channel1[optional] the index of color channel to delete.
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Return values
statusresult of the function: 0-fail/1-success
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.deleteColorChannel(3); // call from mibController; delete color channel 3 from the obj.img
obj.mibModel.getImageMethod('deleteColorChannel', NaN, 3); // call from mibController via a wrapper function getImageMethod

References max, mibInputDlg(), and min.

Here is the call graph for this function:

◆ deleteSlice()

function result = mibImage.deleteSlice ( sliceNumber,
orient,
options )

Delete specified slice from the dataset.

Parameters
sliceNumberthe number of the slice to delete
orient[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
optionsan optional structure with additional paramters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show Return values:
resultresult of the function, 0 fail, 1 success
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.deleteSlice(3); // call from mibController; delete the 3rd slice from the dataset
obj.mibModel.I{obj.mibModel.Id}.deleteSlice(10, 5); // call from mibController; delete the 10th time frame from the dataset

References min.

◆ generateModelColors()

function mibImage.generateModelColors ( )

Generate list of colors for materials of a model.

When a new material is added to a model, this function generates a random color for it.

Return values
statusresult of the function: 0-fail/1-success

Examples:

obj.mibModel.I{obj.mibModel.Id}.generateModelColors(); // call from mibController, generate colors
obj.mibModel.getImageMethod('generateModelColors'); // call from mibController via a wrapper function getImageMethod

◆ getBoundingBox()

function bb = mibImage.getBoundingBox ( )

Get Bounding box info as a vector [xmin, xmax, ymin, ymax, zmin, zmax].

The bounding box info is needed to properly put the dataset in the 3D space. It is stored in the header of the Amira mesh file, or in the beginning of the ImageDescription field of the TIF file.

Return values
bb- bounding box info
  • bb(1) = Xmin
  • bb(2) = Xmax
  • bb(3) = Ymin
  • bb(4) = Ymax
  • bb(5) = Zmin
  • bb(6) = Zmax

Examples:

bb = obj.mibModel.I{obj.mibModel.Id}.getBoundingBox(); // call from mibController; get bounding box info

References max, and min.

Referenced by mibSetImarisDataset().

Here is the caller graph for this function:

◆ getCoordinatesOfShownImage()

function [ yMin , yMax , xMin , xMax , zMin , zMax ] = mibImage.getCoordinatesOfShownImage ( transposeTo4)

Return minimal and maximal coordinates (XY) of the image that is currently shown.

Note
it is also possible to get coordinates from .slices field of mibImage class
Parameters
transposeTo4- [optional] when 1, transpose dataset to the orientation 4, when looking on the XY plane of the dataset, used in mibController.menuSelectionInterpolate
Return values
yMin- minimal Y coordinate
yMax- maximal Y coordinate
xMin- minimal Y coordinate
xMax- maximal Y coordinate
zMin- minimal Z coordinate
zMax- maximal Z coordinate

Examples:

[yMin, yMax, xMin, xMax] = obj.mibModel.I{obj.mibModel.Id}.getCoordinatesOfShownImage(); // get coordinates

References max, and min.

◆ getCurrentSliceNumber()

function slice_no = mibImage.getCurrentSliceNumber ( )

Get slice number of the currently shown image.

Return values
slice_noindex of the currently shown slice

Examples:

slice_no = obj.mibModel.I{obj.mibModel.Id}.getCurrentSliceNumber(); // Call from mibController

◆ getCurrentTimePoint()

function timePnt = mibImage.getCurrentTimePoint ( )

Get time point of the currently shown image.

Return values
timePntindex of the currently shown slice

Examples:

timePnt = mibImage.getCurrentTimePoint(); // get the time point
mibImage(img, meta, options)
obj = mibImage(img, meta, options) mibImage class constructor
Definition mibImage.m:552

◆ getData()

function dataset = mibImage.getData ( type,
orient,
col_channel,
options,
custom_img )

Get dataset from mibImage class.

Parameters
typetype of the dataset to retrieve, image, model,mask, selection, or 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,t] -> [x,z,c,y,t]
  • when 2 returns transposed dataset to the zy configuration: [y,x,c,z,t] -> [y,z,c,y,t]
  • when 3 not used
  • when 4 returns original dataset to 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
  • .y -> [optional], [ymin, ymax] coordinates of the dataset to take after transpose for level=1, when 0 takes 1:obj.height; can be a single number
  • .x -> [optional], [xmin, xmax] coordinates of the dataset to take after transpose for level=1, when 0 takes 1:obj.width; can be a single number
  • .z -> [optional], [zmin, zmax] coordinates of the dataset to take after transpose, when 0 takes 1:obj.depth; can be a single number
  • .t -> [optional], [tmin, tmax] coordinates of the dataset to take after transpose, when 0 takes 1:obj.time; can be a single number
  • .level -> [optional], index of image level from the image pyramid
custom_imgget dataset from a provided custom image stack, not implemented
Return values
dataset4D or 5D stack. For the image type: [1:height, 1:width, 1:colors, 1:depth, 1:time]; for all other types: [1:height, 1:width, 1:thickness, 1:time]
Required fields of options:

Examples:

dataset = obj.getData('image'); // get the complete dataset in the shown orientation
dataset = obj.getData('image', 4, 2); // get complete dataset in the XY orientation with only second color channel

References max, and min.

Referenced by mibSetImarisDataset().

Here is the caller graph for this function:

◆ getDatasetDimensions()

function [ height , width , color , depth , time ] = mibImage.getDatasetDimensions ( type,
orient,
color,
options )

Get dimensions of the dataset.

Parameters
typetype of the dataset to retrieve dimensions, image (default), model, mask, selection
orient[optional], can be NaN
  • when 0 (default) returns the dataset transposed to the current orientation (obj.orientation)
  • when 1 returns dimensions of the transposed dataset to the zx configuration: [y,x,c,z,t] -> [x,z,c,y,t]
  • when 2 returns dimensions of the transposed dataset to the zy configuration: [y,x,c,z,t] -> [y,z,c,y,t]
  • when 3 not used
  • when 4 returns dimensions of the original dataset to the yx configuration: [y,x,c,z,t]
  • when 5 not used
color[optional], can be NaN
  • when type is image, color is a vector with color numbers to take, otherwise take the colors selected in the imageData.slices{3} variable
  • when type is model color may be 0 - to take all materials of the model or an integer to take specific material.
options[optional], a structure with extra parameters
  • .blockModeSwitch -> 0 - return dimensions of the full dataset, 1 - return dimensions of the shown part only
  • .orientation -> override the mibImage.orientation parameter [REMOVED]
Return values
heightheight of the dataset
widthwidth of the dataset
colorvector of colors of the dataset
depthnumber of z-layers of the dataset
timenumber of time points
Required fields of options:

Examples:

[height width color depth] = mibImage.getDatasetDimensions('image') // get dimensions of the complete dataset
width
image width, px
Definition mibImage.m:391
height
image height, px
Definition mibImage.m:113
depth
number of stacks in the dataset
Definition mibImage.m:77
[height width color depth] = mibImage.getDatasetDimensions('image', 1); // get dimensions of the transposed dataset
Attention
not sensitive to the shown ROI

References depth, height, time, and width.

Referenced by mibSetImarisDataset().

Here is the caller graph for this function:

◆ getDatasetSizeInBytes()

function [ totalSize , imSize ] = mibImage.getDatasetSizeInBytes ( )

Get size of the loaded dataset in bytes.

For checking memory requirements when working with some functions (only for windows!). The amounts of physical memory used by Matlab and total memory available on the computer can be obtained with the following code
[userview, systemview] = memory;
systemview.PhysicalMemory.Available // total memory
userview.MemUsedMATLAB // memory used by Matlab
Return values
totalSize- total size of all layers in bytes
imSize- size of the image layer in bytes

Examples:

[totalSize, imSize] = obj.mibModel.I{obj.mibModel.Id}.getDatasetSizeInBytes(); // call from mibController; get both total and matlab memory amounts

◆ getDataVirt()

function dataset = mibImage.getDataVirt ( type,
orient,
col_channel,
options,
custom_img )

Get virtual dataset from mibImage class.

Parameters
typetype of the dataset to retrieve, image, model,mask, selection, or 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,t] -> [x,z,c,y,t]
  • when 2 returns transposed dataset to the zy configuration: [y,x,c,z,t] -> [y,z,c,y,t]
  • when 3 not used
  • when 4 returns original dataset to 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
  • .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
  • .level -> [optional], index of image level from the image pyramid
  • .showWaitbar -> [optional], show or not the waitbar, default show the waitbar for Z-stacks and T-series
custom_imgget dataset from a provided custom image stack, not implemented
Return values
dataset4D or 5D stack. For the image type: [1:height, 1:width, 1:colors, 1:depth, 1:time]; for all other types: [1:height, 1:width, 1:thickness, 1:time]
Required fields of options:

Examples:

dataset = obj.getDataVirt('image'); // get the complete dataset in the shown orientation
dataset = obj.getDataVirt('image', 4, 2); // get complete dataset in the XY orientation with only second color channel

References max, and min.

◆ getImAdjustStretchCoef()

function [ lowIn , highIn , lowOut , highOut ] = mibImage.getImAdjustStretchCoef ( channels)

Return image stretching coefficients to be used for imadjust function to stretch contrast of the image.

Parameters
channels[optional] color channel or vector of color channels to get coefficients; when skipped return coefficients for all color channels
Return values
lowInvalues matching low_in parameter of imadjust
highInvalues matching high_in parameter of imadjust
lowOutvalues matching low_out parameter of imadjust
highOutvalues matching high_in parameter of imadjust

Examples:

[lowIn, highIn, lowOut, highOut] = obj.mibModel.I{obj.mibModel.Id}.getImAdjustStretchCoef(channel); // call from mibController; get coefficients

◆ getPixelIdxList()

function dataset = mibImage.getPixelIdxList ( type,
PixelIdxList,
options )

dataset = getPixelIdxList(obj, type, PixelIdxList, options) Get dataset from the list of pixel indices

Parameters
typetype of the dataset to update, image (not implemented), model, mask, selection, or everything (model, mask and selection for imageData.model_type=='uint6' only)
PixelIdxListindices of pixels that have to be updated (calculated for the full dataset in the XY orientation)
options[optional], a structure with extra parameters NOT USED
  • .z -> [optional], z coordinate, when missing use the currently shown
  • .t -> [optional], time point, when missing use the currently shown
Return values
dataseta vector with values

Examples:

I = cell2mat(obj.mibModel.getData3D('mask')); // get current mask 3D
CC = bwconncomp(I, 26); // detect objects
list = obj.mibModel.I{obj.mibModel.Id}.setPixelIdxList('selection', CC.PixelIdxList{1}); // get list of values for the Selection layer inside the mask layer

◆ getROIBoundingBox()

function bb = mibImage.getROIBoundingBox ( roiIndex)

return the bounding box info for the ROI at the current orientation

Parameters
roiIndex[optional] index of ROI to return the bounding box
Return values
bba vector with the bounding box in format: bb = [minX, maxX, minY, maxY, minZ, maxZ]

Examples:

obj.mibModel.I{obj.mibModel.Id}.getROIBoundingBox(); // call from mibController class; return the bounding box of the selected ROI

References height, and width.

◆ getSelectedMaterialIndex()

function index = mibImage.getSelectedMaterialIndex ( target)

return the index of the currently selected material in the mibView.handles.mibSegmentationTable

Parameters
targeta string with optional target column of the table
  • 'Material' - (default) the selected row in the material column
  • 'AddTo' - the selected row in the AddTo column
Return values
indexan index of the currently selected material;
  • '-1' - Mask
  • '0' - Exterior
  • '1' - 1st material of the model
  • '2' - 2nd material of the model

Examples:

selcontour = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex(); // call from mibController class; return the index of the currently selected material
selcontour = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex('AddTo'); // call from mibController class; return the index of the currently selected material in the AddTo column

◆ getSliceLabels()

function [ labelsList , labelValues , labelPositions , indices ] = mibImage.getSliceLabels ( sliceNumber,
timePoint,
options )

[labelsList, labelValues, labelPositions, indices] = getSliceLabels(obj, sliceNumber, timePoint, options) Get list of labels (mibImage.hLabels) shown at the specified slice

Parameters
sliceNumber[optional], a slice number to get labels
timePoint[optional], a time point to get the labels
options[optional], structure with additional parameters -> .blockModeSwitch: [optional], optionally return labels that are seen only in the current view -> .shiftCoordinates: [optional], shift coordinates so that they are corrected relative to the crop introduces by blockModeSwitch
Return values
labelsLista cell array with labels
labelPositionsa matrix with coordinates of the labels [labelIndex, z x y]
indicesindices of the labels
Required fields of options:

Examples:

[labelsList, labelValues, labelPositions, indices] = obj.mibModel.I{obj.mibModel.Id}.getSliceLabels(15); // call from mibController; get all labels from the slice 15
[labelsList, labelValues, labelPositions, indices] = obj.mibModel.I{obj.mibModel.Id}.getSliceLabels(); // call from mibController; get all labels from the currently shown slice

References max.

◆ insertEmptyColorChannel()

function mibImage.insertEmptyColorChannel ( channel1,
options )

Insert an empty color channel to the specified position.

Parameters
channel1[optional] the index of color channel to insert.
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show Return values:
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.insertEmptyColorChannel(1); // call from mibController; insert empty color channel to position 1

References mibInputDlg().

Here is the call graph for this function:

◆ insertSlice()

function mibImage.insertSlice ( img,
insertPosition,
meta,
options )

Insert a slice or a dataset into the existing volume.

Parameters
imgnew 2D-4D image stack to insert
insertPosition[optional] position where to insert the new slice/volume starting from 1. When omitted or NaN or 0 - add img to the end of the dataset
meta[optional] containers Map with parameters of the dataset to insert, can be empty
optionsan optional structure with additional paramters .dim - a string that defines dimension depth (default), time .BackgroundColorIntensity - a number with background color .silentMode - logical, a silent mode, when no questions be asked .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.insertSlice(img, 1); // call from mibController class; insert img to the beginning of the opened dataset
img
a cell array to keep the Image layer. The layer img{1} has image in full resolution,...
Definition mibImage.m:143
obj.mibModel.I{obj.mibModel.Id}.insertSlice(img, insertPosition, img_info); // call from mibController class
options.dim = 'time'; // define add a dataset as a new time point
obj.mibModel.I{obj.mibModel.Id}.insertSlice(img, insertPosition, img_info, options); // call from mibController class; add img as a new time point

References img, max, meta, and mibInputDlg().

Here is the call graph for this function:

◆ invertColorChannel()

function mibImage.invertColorChannel ( channel1,
options )

Invert color channel of the dataset.

The specified channel1 will be inverted

Parameters
channel1[optional] index of the color channel to invert
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Required fields of options:

Examples:

handles = obj.mibModel.I{obj.mibModel.Id}.invertColorChannels(1); // call from mibController; invert color channel 1

References max, and mibInputMultiDlg().

Here is the call graph for this function:

◆ Listner2_Callback()

*obj Virtual *end *end **function mibImage.Listner2_Callback ( obj ,
src ,
evnt  )

References src.

◆ materialsInsert()

function status = mibImage.materialsInsert ( materialIndex,
materialName,
options )

Insert material with materialName into position materialIndex.

Parameters
materialIndex[numeric] index of the new material of the model
materialName[string] name of the new material of the model
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Return values
statusresult of the function: 0-fail/1-success
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.materialsInsert(5, 'material5'); // call from mibController; insert 'material5' into position 5

References M, and max.

◆ materialsRemove()

function status = mibImage.materialsRemove ( materialIndex,
options )

Remove material from the model.

Parameters
materialIndex[numeric] index or indices of materials to be removed from the model, when empty or NaN use the currently selected material
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Return values
statusresult of the function: 0-fail/1-success
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.materialsRemove('3'); // call from mibController; delete material 3 from the model, obj.model

References model.

◆ materialsRename()

function status = mibImage.materialsRename ( materialName,
materialIndex,
options )

Rename material with index materialIndex using a new materialName.

Parameters
materialName[string] new name for materialIndex, when empty generate default name
materialIndex[numeric] index of the selected material of the model, when NaN or empty use the currently selected material
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Return values
statusresult of the function: 0-fail/1-success

Examples:

obj.mibModel.I{obj.mibModel.Id}.materialsRename('material03', 3); // call from mibController; rename material 3 using new name: material03

◆ materialsReorder()

function status = mibImage.materialsReorder ( newOrder,
options )

Reorder materials in the model.

Parameters
newOrder[string] new order of materials in the model
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Return values
statusresult of the function: 0-fail/1-success
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.newOrder('10:-1:1'); // call from mibController; invert the order of materials

References M.

◆ materialsSwap()

function status = mibImage.materialsSwap ( material1,
material2,
options )

Swap material1 and material2 in the model.

Parameters
material1[numeric] index of the first material of the model
material2[numeric] index of the second material of the model
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Return values
statusresult of the function: 0-fail/1-success
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.materialsSwap(1,2); // call from mibController; swap positions of material 1 and material 2

References M.

◆ materialsSwapColors()

function status = mibImage.materialsSwapColors ( material1,
material2 )

Swap colors for material1 and material2 in the model.

Parameters
material1[numeric] index of the first material of the model
material2[numeric] index of the second material of the model
Return values
statusresult of the function: 0-fail/1-success

Examples:

obj.mibModel.I{obj.mibModel.Id}.materialsSwapColors(1,2); // call from mibController; swap colors of material 1 and material 2

◆ methods()

mibImage.methods ( Static )

◆ modelExportToMatlab()

function status = mibImage.modelExportToMatlab ( materialOutputVariable,
materialIndex,
materialOutputIndex,
options )

Export model or material of the model to MATLAB main workspace. The exported variable has following fields: .model 3D or 4D matrix [1:height, 1:width, 1:depth, 1:time] with the model .modelMaterialNames - cell array with names of the exported materials .modelMaterialColors - matrix with colors of materials [colorID; R,G,B] in the range from 0 to 1 .modelType - integer with the model type, 64, 255, 65535.

Parameters
materialOutputVariable[string, default="O"] name of the output variable to create in the main MATLAB workspace
materialIndex[integer or NaN, default=NaN] index of material to export, when NaN export complete model
materialOutputIndex[integer, default=1] value for the exported material, used only when a single material is exported, typical values 1 or 255
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Return values
statusresult of the function: 0-fail/1-success
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.modelExportToMatlab('Model', NaN); // call from mibController; export complete model and assign into Model variable
obj.mibModel.I{obj.mibModel.Id}.modelExportToMatlab('Material3', 3); // call from mibController; export 3rd material of the model Material3 variable

◆ moveMaskToModelDataset()

function mibImage.moveMaskToModelDataset ( action_type,
options )

Move the Mask layer to the Model layer.

This is one of the specific functions to move datasets between the layers. Allows faster move of complete datasets between the layers

Parameters
action_typea type of the desired action
  • 'add' - add mask to the selected material (Add to)
  • 'remove' - remove mask from the model
  • 'replace' - replace the selected (Add to) material with mask
optionsa structure with additional paramters
  • .contSelIndex - index of the Select from material
  • .contAddIndex - index of the Add to material
  • .selected_sw - optional override switch [0 / 1] to limit actions to the selected Select from material only, otherwise obj.fixSelectionToMaterial value is used
  • .level -> [optional], index of image level from the image pyramid, default = 1
Required fields of options:

Examples:

userData = obj.mibView.handles.mibSegmentationTable.UserData; // call from mibController, get user data structure
options.contSelIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex(); // index of the selected material
options.contAddIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex('AddTo'); // index of the target material
options.selected_sw = obj.mibView.handles.mibSegmSelectedOnlyCheck.Value; // when 1- limit selection to the selected material
obj.mibModel.I{obj.mibModel.Id}.moveMaskToModelDataset('add', options); // call from mibController, add mask to model
Attention
NOT sensitive to the blockModeSwitch
NOT sensitive to the shown ROI

References M.

◆ moveMaskToSelectionDataset()

function mibImage.moveMaskToSelectionDataset ( action_type,
options )

Move the Mask layer to the Selection layer.

This is one of the specific functions to move datasets between the layers. Allows faster move of complete datasets between the layers

Parameters
action_typea type of the desired action
  • 'add' - add mask to selection
  • 'remove' - remove mask from selection
  • 'replace' - replace selection with mask
optionsa structure with additional paramters
  • .contSelIndex - index of the Select from material
  • .contAddIndex - index of the Add to material
  • .selected_sw - optional override switch [0 / 1] to limit actions to the selected Select from material only, otherwise obj.fixSelectionToMaterial value is used
  • .level -> [optional], index of image level from the image pyramid, default = 1
Required fields of options:

Examples:

userData = obj.mibView.handles.mibSegmentationTable.UserData; // call from mibController, get user data structure
options.contSelIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex(); // index of the selected material
options.contAddIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex('AddTo'); // index of the target material
options.selected_sw = obj.mibView.handles.mibSegmSelectedOnlyCheck.Value; // when 1- limit selection to the selected material
obj.mibModel.I{obj.mibModel.Id}.moveMaskToSelectionDataset('add', options); // call from mibController, add mask to selection
Attention
NOT sensitive to the blockModeSwitch
NOT sensitive to the shown ROI

◆ moveModelToMaskDataset()

function mibImage.moveModelToMaskDataset ( action_type,
options )

Move the selected Material to the Mask layer.

This is one of the specific functions to move datasets between the layers. Allows faster move of complete datasets between the layers

Parameters
action_typea type of the desired action
  • 'add' - add the selected material (Select from) to mask
  • 'remove' - remove the selected material (Select from) from mask
  • 'replace' - replace mask with the selected (Select from) material
optionsa structure with additional paramters
  • .contSelIndex - index of the Select from material
  • .contAddIndex - index of the Add to material
Required fields of options:

Examples:

userData = obj.mibView.handles.mibSegmentationTable.UserData; // call from mibController, get user data structure
options.contSelIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex(); // index of the selected material
options.contAddIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex('AddTo'); // index of the target material
obj.mibModel.I{obj.mibModel.Id}.moveModelToMaskDataset('add', options); // call from mibController, add material to mask
Attention
NOT sensitive to the blockModeSwitch
NOT sensitive to the shown ROI

◆ moveModelToSelectionDataset()

function mibImage.moveModelToSelectionDataset ( action_type,
options )

Move the selected Material to the Selection layer.

This is one of the specific functions to move datasets between the layers. Allows faster move of complete datasets between the layers than using of ib_getDataset.m / ib_setDataset.m functions.

Parameters
action_typea type of the desired action
  • 'add' - add the selected material (Select from) to selection
  • 'remove' - remove the selected material (Select from) from selection
  • 'replace' - replace selection with the selected (Select from) material
optionsa structure with additional paramters
  • .contSelIndex - index of the Select from material
  • .contAddIndex - index of the Add to material
  • .maskedAreaSw - optional override switch [0 / 1] to limit actions to the masked areas, otherwise obj.fixSelectionToMask value is used
  • .level -> [optional], index of image level from the image pyramid, default = 1
Required fields of options:

Examples:

userData = obj.mibView.handles.mibSegmentationTable.UserData; // call from mibController, get user data structure
options.contSelIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex(); // index of the selected material
options.contAddIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex('AddTo'); // index of the target material
options.maskedAreaSw = obj.mibView.handles.mibMaskedAreaCheck.Value;
obj.mibModel.I{obj.mibModel.Id}.moveModelToSelectionDataset('add', options); // call from mibController; add material to selection
Attention
NOT sensitive to the blockModeSwitch
NOT sensitive to the shown ROI

◆ moveSelectionToMaskDataset()

function mibImage.moveSelectionToMaskDataset ( action_type,
options )

Move the Selection layer to the Mask layer.

This is one of the specific function to move datasets between the layers. Allows faster move of complete datasets between the layers

Parameters
action_typea type of the desired action
  • 'add' - add selection to mask
  • 'remove' - remove selection from mask
  • 'replace' - replace mask with selection
optionsa structure with additional paramters
  • .contSelIndex - index of the Select from material
  • .contAddIndex - index of the Add to material
  • .selected_sw - optional override switch [0 / 1] to limit actions to the selected Select from material only, otherwise obj.fixSelectionToMaterial value is used
  • .maskedAreaSw - optional override switch [0 / 1] to limit actions to the masked areas, otherwise obj.fixSelectionToMask value is used
  • .level -> [optional], index of image level from the image pyramid, default = 1
Required fields of options:

Examples:

userData = obj.mibView.handles.mibSegmentationTable.UserData; // call from mibController, get user data structure
options.contSelIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex(); // index of the selected material
options.contAddIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex('AddTo'); // index of the target material
options.selected_sw = obj.mibView.handles.mibSegmSelectedOnlyCheck.Value; // when 1- limit selection to the selected material
options.maskedAreaSw = obj.mibView.handles.mibMaskedAreaCheck.Value;
obj.mibModel.I{obj.mibModel.Id}.moveSelectionToMaskDataset('add', options); // add selection to mask
Attention
NOT sensitive to the blockModeSwitch
NOT sensitive to the shown ROI

◆ moveSelectionToModelDataset()

function mibImage.moveSelectionToModelDataset ( action_type,
options )

Move the Selection layer to the Model layer.

This is one of the specific functions to move datasets between the layers. Allows faster move of complete datasets between the layers

Parameters
action_typea type of the desired action
  • 'add' - add selection to the selected material (Add to)
  • 'remove' - remove selection from the model
  • 'replace' - replace the selected (Add to) material with selection
optionsa structure with additional paramters
  • .contSelIndex - index of the Select from material
  • .contAddIndex - index of the Add to material
  • .selected_sw - optional override switch [0 / 1] to limit actions to the selected Select from material only, otherwise obj.fixSelectionToMaterial value is used
  • .maskedAreaSw - optional override switch [0 / 1] to limit actions to the masked areas, otherwise obj.fixSelectionToMask value is used
  • .level -> [optional], index of image level from the image pyramid, default = 1
Required fields of options:

Examples:

userData = obj.mibView.handles.mibSegmentationTable.UserData; // call from mibController, get user data structure
options.contSelIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex(); // index of the selected material
options.contAddIndex = obj.mibModel.I{obj.mibModel.Id}.getSelectedMaterialIndex('AddTo'); // index of the target material
options.selected_sw = obj.mibView.handles.mibSegmSelectedOnlyCheck.Value; // when 1- limit selection to the selected material
options.maskedAreaSw = obj.mibView.handles.mibMaskedAreaCheck.Value;
obj.mibModel.I{obj.mibModel.Id}.moveSelectionToModelDataset('add', options); // call from mibController, add selection to model
Attention
NOT sensitive to the blockModeSwitch
NOT sensitive to the shown ROI

References M.

◆ moveView()

function mibImage.moveView ( x,
y,
orient )

Center the image view at the provided coordinates: x, y.

Parameters
x- X coordinate of the window center, or index of the point
y- [optional] Y coordinate of the window center, can be NaN
orient- [optional] define orientation of the point, default is the currently shown orientation
  • when 0 (default) assumes that the points are taken at the current orientation (obj.orientation)
  • when 1 assumes that the points are taken at the zx orientation
  • when 2 assumes that the points are taken at the zy orientation
  • when 3 not used
  • when 4 assumes that the points are taken at the yx orientation
  • when 5 not used

Examples:

obj.moveView(50, 75); // call from mibController, center the view at the pixel 50, 75

References axesX, and axesY.

◆ replaceImageColor()

function mibImage.replaceImageColor ( type,
color_id,
channel_id,
slice_id,
time_pnt,
options )

Replace image intensities in the Masked or Selected areas with new intensity value.

Parameters
typea string that specifies which layer to use for color replacement: 'mask' or 'selection'
color_ida vector with intensity of the new color
channel_idindeces of the color channels to be replaced
slice_idindex of the slice number, or 0 for all
time_pntindex of the time point, or 0 for all
optionsa structure with optional parameters
  • .showWaitbar - logical, show or not the waitbar
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.replaceImageColor('mask', 0, 1, 0, 1); // call from mibController; to replace the Masked areas with black color for all slices of time point 1

◆ resliceDataset()

function result = mibImage.resliceDataset ( sliceNumbers,
orient,
options )

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

Parameters
sliceNumbersarray of slice numbers to keep, can be a range in MATLAB format as 1:10:end to keep each 10th slice
orient[optional], can be NaN (current orientation)
  • when 0 (default) reslice the the current orientation (obj.orientation)
  • when 1 reslice the zx configuration: [x,z,c,y,t] -> [y,x,c,z,t]
  • when 2 reslice the zy configuration: [y,z,c,y,t] -> [y,x,c,z,t]
  • when 3 not used
  • when 4 reslice the yx configuration: [y,x,c,z,t]
  • when 5 not implemented
optionsan optional structure with additional paramters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show Return values:
resultresult of the function, 0 fail, 1 success
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.resliceDataset('1:10:end', 0); // call from mibController; keep each 10th slice of the dataset

References min.

◆ rotateColorChannel()

function mibImage.rotateColorChannel ( channel1,
angle,
options )

Rotate color channel of the dataset.

The specified channel1 will be rotated

Parameters
channel1[optional] index of the color channel to invert, can be empty
angle[optional] rotation angle, should be a number: 90, 180 or -90, can be empty
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.rotateColorChannel(1, 90); // call from mibController; rotate color channel 1 by 90 degrees

References max, and mibInputMultiDlg().

Here is the call graph for this function:

◆ saveImageAsDialog()

function fnOut = mibImage.saveImageAsDialog ( filename,
options )

save image to a file

Parameters
filename[optional] a string with filename, when empty a dialog for filename selection is shown; when the filename is provided its extension defines the output format, unless the format is provided in the options structure
optionsan optional structure with additional parameters
  • .Format - string with the output format, as in the Formats variable below, for example Amira Mesh binary file sequence (*.am)
  • .FilenameGenerator - string, when 'Use original filename' -> use original filenames of the loaded datasets; 'Use sequential filename' -> the filenames are generated in sequence using the first filename of the loaded dataset as template
  • .DestinationDirectory - string, with destination directory, if filename has no full path
  • .Saving3DPolicy - string, [TIF only] save images as 3D TIF file or as a sequence of 2D files
  • .showWaitbar - logical, show or not the waitbar
  • .silent - logical, do not ask any questions and use default parameters
Return values
fnOuta string with the output filename
Required fields of options:

References bitmap2amiraMesh(), bitmap2nrrd(), generateSequentialFilename(), image2hdf5(), img, mibImage2jpg(), mibImage2mrc(), mibImage2png(), mibImage2tiff(), mibInputMultiDlg(), mibSaveHDF5Dlg(), min, saveBigDataViewerFormat(), and saveXMLheader().

Here is the call graph for this function:

◆ saveMask()

function fnOut = mibImage.saveMask ( filename,
options )

save mask to a file

Parameters
filename[optional] a string with filename, when empty a dialog for filename selection is shown; when the filename is provided its extension defines the output format, unless the format is provided in the options structure
optionsan optional structure with additional parameters
  • .Format - string with the output format, as in the Formats variable below, for example Matlab format (*.mask)
  • .DestinationDirectory - string, with destination directory, if filename has no full path
  • .Saving3DPolicy - string, [TIF only] save images as 3D TIF file or as a sequence of 2D files (3D stack, 2D sequence)
  • .FilenamePolicy - string, [mibCat, TIF, PNG only] policy for generation of filenames (Use existing name, Use new provided name)
  • .MaskColor - vector numeric [r g b] from 0 to 1 with the mask color
  • .showWaitbar - logical, show or not the waitbar
  • .silent - logical, do not ask any questions and use default parameters
Return values
optionsfnOut -> output mask filename
Required fields of options:

References bitmap2amiraLabels(), generateSequentialFilename(), image2hdf5(), maskImg, mibImage2png(), mibImage2tiff(), mibSaveHDF5Dlg(), min, saveBigDataViewerFormat(), and saveXMLheader().

Here is the call graph for this function:

◆ saveModel()

function fnOut = mibImage.saveModel ( filename,
saveModelOptions )

save model to a file

Parameters
filename[optional] a string with filename, when empty a dialog for filename selection is shown; when the filename is provided its extension defines the output format, unless the format is provided in the saveModelOptions structure
saveModelOptionsan optional structure with additional parameters
  • .Format - string with the output format, as in the Formats variable below, for example Matlab format (*.model)
  • .FilenameGenerator - string, when 'Use original filename' -> use original filenames of the loaded datasets; 'Use sequential filename' -> the filenames are generated in sequence using the first filename of the loaded dataset as template
  • .DestinationDirectory - string, with destination directory, if filename has no full path
  • .MaterialIndex - numeric, index of the material to save, when [] save all materials; NaN - save currently selected material
  • .Saving3DPolicy - string, [TIF, mibCat only] save images as 3D file or as a sequence of 2D files (3D stack, 2D sequence)
  • .FilenamePolicy - string, [mibCat, TIF, PNG only] policy for generation of filenames (Use existing name, Use new provided name)
  • .showWaitbar - logical, show or not the waitbar
  • .silent - logical, do not ask any questions and use default parameters
Return values
saveModelOptionsfnOut -> output model filename
Required fields of saveModelOptions:

References bitmap2amiraLabels(), bitmap2nrrd(), generateSequentialFilename(), image2hdf5(), mibExportModelToImodModel(), mibImage2mrc(), mibImage2png(), mibImage2tiff(), mibInputMultiDlg(), mibRenderModel(), mibSaveHDF5Dlg(), min, model, modelMaterialColors, modelMaterialNames, modelType, modelVariable, saveBigDataViewerFormat(), saveXMLheader(), selection, and stlwrite().

Here is the call graph for this function:

◆ setData()

function result = mibImage.setData ( type,
dataset,
orient,
col_channel,
options )

result = setData(obj, type, dataset, orient, col_channel, options) Set dataset

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. For the image type: [1:height, 1:width, 1:colors, 1:depth, 1:time]; for all other types: [1:height, 1:width, 1:thickness, 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 update, 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
  • .y -> [optional], [ymin, ymax] coordinates of the dataset to take after transpose for level=1, when 0 takes 1:obj.height; can be a single number
  • .x -> [optional], [xmin, xmax] coordinates of the dataset to take after transpose for level=1, when 0 takes 1:obj.width; can be a single number
  • .z -> [optional], [zmin, zmax] coordinates of the dataset to take after transpose, when 0 takes 1:obj.depth; can be a single number
  • .t -> [optional], [tmin, tmax] coordinates of the dataset to take after transpose, when 0 takes 1:obj.time; can be a single number
  • .level -> [optional], index of image level from the image pyramid
  • .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.setData('image', dataset); // update the complete dataset in the shown orientation
obj.setData('image', dataset, 4, 2); // update complete dataset in the XY orientation with only second color channel

References max, and min.

◆ setPixelIdxList()

function result = mibImage.setPixelIdxList ( type,
dataset,
PixelIdxList,
options )

result = setPixelIdxList(obj, type, dataset, PixelIdxList, options) Set dataset

Parameters
typetype of the dataset to update, image (not implemented), model,mask, selection, or everything (model,mask and selection for imageData.model_type=='uint6' only)
dataseta vector with values
PixelIdxListindices of pixels that have to be updated (calculated for the full dataset in the XY orientation)
options[optional], a structure with extra parameters NOT USED
  • .z -> [optional], z coordinate, when missing use the currently shown
  • .t -> [optional], time point, when missing use the currently shown
Return values
result-> 1 - success, 0 - error

Examples:

I = cell2mat(obj.mibModel.getData3D('mask')); // get current mask 3D
CC = bwconncomp(I, 26); // detect objects
val = zeros([numel(CC.PixelIdxList{1}), 1], 'uint8')+1; // set the values for the detected object 1
obj.mibModel.I{obj.mibModel.Id}.setPixelIdxList('selection', val, CC.PixelIdxList{1}); // move to the selection layer

◆ shiftColorChannel()

function mibImage.shiftColorChannel ( channel1,
dx,
dy,
fillValue,
options )

Shift color channel (channel1) by dx/dy pixels.

Parameters
channel1index of the color channel to shift
dxx-shift in pixels
dyy-shift in pixels
fillValue[optional, can be [], default==0] intensity value to fill a frame generated due to the shift of the color channel
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Required fields of options:

Examples:

handles = obj.mibModel.I{obj.mibModel.Id}.shiftColorChannel(1, 10, -5); // call from mibController; shift channel 1 by +10 pixels in X and -5 pixels in Y

◆ swapColorChannels()

function mibImage.swapColorChannels ( channel1,
channel2,
options )

Swap two color channels of the dataset.

The first color channel will be moved to the position of the second color channel, and the second color channel to the position of the first one

Parameters
channel1[optional] index of the first color channel
channel2[optional] index of the second color channel
optionsstructure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.swapColorChannels(1, 3); // call from mibController; swap color channel 1 and 3

References max, and mibInputMultiDlg().

Here is the call graph for this function:

◆ swapSlices()

function result = mibImage.swapSlices ( sliceNumberFrom,
sliceNumberTo,
orient,
options )

Swap specified slices.

Parameters
sliceNumberFromindeces of the source slice
sliceNumberToindeces of the destination slice
orient[optional], can be NaN (current orientation)
  • when 0 (default) the current orientation (obj.orientation)
  • when 1 the zx configuration: [x,z,c,y,t] -> [y,x,c,z,t]
  • when 2 the zy configuration: [y,z,c,y,t] -> [y,x,c,z,t]
  • when 3 not used
  • when 4 the yx configuration: [y,x,c,z,t]
  • when 5 the t configuration
optionsan optional structure with additional paramters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show
Return values
resultresult of the function, 0 fail, 1 success
Required fields of options:

Examples:

obj.mibModel.I{obj.mibModel.Id}.swapSlices([3, 4], [10, 11]); // call from mibController; swap slices 3 & 4 with 10 & 11

References max, and min.

◆ switchVirtualStackingMode()

function newMode = mibImage.switchVirtualStackingMode ( newMode,
enableSelection )

Function to switch between loading datasets to memory or reading them from HDD on demand.

Parameters
newMode[optional],
  • when 0 - uses the memory-resident mode, i.e. when the images loaded to memory
  • when 1 - uses the HDD-resident mode (virtual stacking), i.e. when the images kept on a hard drive
enableSelection[optional] a switch to set enableSelection based on mibModel.preferences.System.EnableSelection
Return values
newModeresult of the function,
  • [] - nothing was changed
  • 0 - switched to the memory-resident mode
  • 1 - switched to the virtual stacking mode

Examples:

result = obj.mibModel.I{obj.mibModel.Id}.switchVirtualStackingMode(1, obj.mibModel.preferences.System.EnableSelection); // enable the virtual stacking mode

References enableSelection.

◆ transpose()

function mibImage.transpose ( new_orient)

Change orientation of the image to the XY, XZ, or YZ plane.

Note
This function updates only the imageData.slices and imageData.orientation variables and do not rearrange the actual datasets.
Parameters
new_orienta desired orientation:
  • 1 -> XZ plane
  • 2 -> YZ plane
  • 3 -> YX plane

Examples:

mibImage.transpose(1); // transpose to the XZ plane

◆ updateBoundingBox()

function mibImage.updateBoundingBox ( newBB,
xyzShift,
imgDims )

Update the bounding box info of the dataset.

The bounding box info is needed to properly put the dataset in the 3D space. It is encoded in the header of the Amira mesh file, or in the beginning of the ImageDescription field of the TIF file.

Parameters
newBB- new Bounding Box parameters, Note! when NaN the dataset will be shifted with using xyzShift
  • bb(1) = Xmin
  • bb(2) = Width
  • bb(3) = Ymin
  • bb(4) = Height
  • bb(5) = Zmin
  • bb(6) = Depth
xyzShift[optional] a vector [height, width, z-stacks] with shifts of the bounding box; when omitted the function will use minimal parameters of the existing boinding box for the shitfs. Note! the units here are the image units: mibImage.pixSize.units.
imgDims[optional] a vector [height, width, z-stacks] with dimensions of the image; when omitted the function will use mibImage.height, mibImage.width and mibImage.no_stacks variables. Note! the units here are the image units: mibImage.pixSize.units.

Examples:

xyzShift = [10 5 0]; // shift the bounging box by 10 units in X, by 10 units in Y, and by 0 units in Z
mibImage.updateBoundingBox(NaN, xyzShift); // get bounding box info
newBB = [15 50 10 150 1 15]; // define new bounding box in mibImage.pixSize.units
mibImage.updateBoundingBox(newBB); // get bounding box info

References depth, max, and min.

◆ updateDisplayParameters()

function mibImage.updateDisplayParameters ( )

Update display parameters for visualization (mibImage.viewPort structure)

Examples:

mibImage.updateDisplayParameters(); // do update

References max.

◆ updateImgInfo()

function mibImage.updateImgInfo ( addText,
action,
entryIndex )

Update action log.

This function updates the image log with recent events done to the dataset; it updates the contents of mibImage.meta('ImageDescription') key.

Parameters
addTexta string that should be added to the log
action[optional] - defines additional actions that may be performed with the log:
  • 'delete' - delete entry defined with entryIndex
  • 'insert' - insert new entry after the one defined with entryIndex
  • 'modify' - modify entry with entryIndex
entryIndex[optional] - index of the entry to delete, modify or insert

Examples:

slice = mibImage.updateImgInfo('Image was filtered'); // Add 'Image was filtered' text into the mibImage.meta('ImageDescriotion')
slice = mibImage.updateImgInfo('','delete',4); // Delete entry number 4 from the log
slice = mibImage.updateImgInfo('New entry inserted','insert',4); // Insert new entry into the log at position 4
slice = mibImage.updateImgInfo('Updated text','modify',4); // Modify text at position 4

◆ updatePixSizeResolution()

function result = mibImage.updatePixSizeResolution ( pixSize)

Update mibImage.pixelSize, mibImage.meta('XResolution') and mibImage.meta('XResolution') and mibImage.volren.

The function starts a dialog to update voxel size and the units of the dataset. As result the voxel dimensions will be updated; in addition mibImage.meta('XResolution') and mibImage.meta('YResolution') keys will be recalculated.

Parameters
pixSize- [optional], a structure with new parameters, may have the following fields
  • .x - physical voxel size in X, a number
  • .y - physical voxel size in Y, a number
  • .z - physical voxel size in Z, a number
  • .t - time difference between the frames, a number
  • .units - physical units for voxels, (m, cm, mm, um, nm)
  • .tunits - time unit
Required fields of pixSize:

Examples:

pixSize.x = 10;
pixSize.y = 10;
pixSize.z = 50;
pixSize.units = 'nm';
obj.mibModel.I{obj.mibModel.Id}.updatePixSizeResolution(pixSize); // call from mibController, update parameters using voxels: 10x10x50nm in size
pixSize
a structure with diminsions of voxels,
Definition mibImage.m:273
obj.mibModel.I{obj.mibModel.Id}.updatePixSizeResolution(); // call from mibController, update parameters of the dataset

References magFactor, makeViewMatrix(), mibCalculateResolution(), mibInputMultiDlg(), and pixSize.

Here is the call graph for this function:

◆ updateServiceMetadata()

function mibImage.updateServiceMetadata ( metaIn)

update service metadata of MIB based on obj.img and metaIn

Parameters
metaIn[optional], a containers map with parameters that should be preserved

Examples:

obj.mibModel.I{obj.mibModel.Id}.updateServiceMetadata(); // call from mibController to clear the class

References makeViewMatrix(), mibUpdatePixSizeAndResolution(), and min.

Here is the call graph for this function:

◆ updateSlicesStructure()

function mibImage.updateSlicesStructure ( axesX,
axesY )

updates obj.slices structure using the provided axesX, axesY boundaries

Parameters
axesXa vector [min, max] for the X
axesYa vector [min, max] for the Y

Examples:

obj.I{id}.updateSlicesStructure(axesX, axesY); // call from mibController: update obj.slices structure
axesX
properties of the class a vector [min, max] with minimal and maximal coordinates of the axes X of the...
Definition mibImage.m:28
axesY
a vector [min, max] with minimal and maximal coordinates of the axes Y of the mibView....
Definition mibImage.m:37

References axesX, axesY, max, and min.

Member Data Documentation

◆ axesX

mibImage.axesX

properties of the class a vector [min, max] with minimal and maximal coordinates of the axes X of the mibView.handles.mibImageAxes axes; use

the main model class of MIB
Definition mibModel.m:18
function [ axesX , axesY ] = getAxesLimits(id)
get axes limits for the currently shown or id dataset
Definition getAxesLimits.m:18

to read this property

Referenced by moveView(), and updateSlicesStructure().

◆ axesY

mibImage.axesY

a vector [min, max] with minimal and maximal coordinates of the axes Y of the mibView.handles.mibImageAxes axes; use

to read this property

Referenced by moveView(), and updateSlicesStructure().

◆ BioFormatsMemoizerMemoDir

mibImage.BioFormatsMemoizerMemoDir

path to directory where BioFormats Memoizer is storing memo files

◆ blockModeSwitch

mibImage.blockModeSwitch

a variable to hold a status of the block mode (mibView.handles.toolbarBlockModeSwitch), 1 - enabled, 0 - disabled

Referenced by clearSelection().

◆ case

evnt* switch src Name* mibImage.case
Initial value:
{'Virtual'}
* % fprintf('Virtual changed: %s\n', toc)

◆ colors

mibImage.colors

number of color channels

Referenced by addFrameToImage().

◆ current_yxz

mibImage.current_yxz

a vector to remember last selected slice number of each yx, zx, zy planes,

Note
dimensions:
[1 1 1]

◆ datasets

virtual close mibImage.datasets

◆ defaultAnnotationText

mibImage.defaultAnnotationText

default text for the annotations

◆ defaultAnnotationValue

mibImage.defaultAnnotationValue

default value for the annotations

◆ depth

mibImage.depth

number of stacks in the dataset

Referenced by addFrameToImage(), addStack(), getDatasetDimensions(), and updateBoundingBox().

◆ dim_yxczt

mibImage.dim_yxczt

a matrix with dimensions of the dataset [height, width, colors, depth, time] equal to size obj.img{1} for non-virtual datasets

◆ enableSelection

mibImage.enableSelection

a switch (0/1) to enable or not the selection, mask, model layers

Referenced by clearContents(), and switchVirtualStackingMode().

◆ fixSelectionToMask

mibImage.fixSelectionToMask

a switch indicating the value of the obj.mibView.handles.mibMaskedAreaCheck

◆ fixSelectionToMaterial

mibImage.fixSelectionToMaterial

a switch indicating the value of the obj.mibView.handles.mibSegmSelectedOnlyCheck

◆ height

mibImage.height

image height, px

Referenced by addFrameToImage(), getDatasetDimensions(), and getROIBoundingBox().

◆ hLabels

mibImage.hLabels

a handle to class for keeping annotations

◆ hLines3D

mibImage.hLines3D

a handle to class for keeping 3D Lines and skeletons

◆ hMeasure

mibImage.hMeasure

a handle to class to keep measurements

◆ hROI

mibImage.hROI

handle to ROI class, mibRoiRegion

◆ img

mibImage.img

a cell array to keep the Image layer. The layer img{1} has image in full resolution, img{2} - bin2, img{3} - bin4

Note
The Image layer dimensions:
[1:height, 1:width, 1:colors 1:depth, 1:time]
colors
number of color channels
Definition mibImage.m:57
time
number of time points in the dataset
Definition mibImage.m:337

Referenced by clearContents(), clearSelection(), convertImage(), convertModel(), cropDataset(), insertSlice(), mibImage(), and saveImageAsDialog().

◆ lastSegmSelection

mibImage.lastSegmSelection

a vector with 2 elements of two previously selected materials for use with the e key shortcut

◆ lutColors

mibImage.lutColors

a matrix with LUT colors [1:colorChannel, R G B], (0-1)

◆ magFactor

mibImage.magFactor

magnification factor for the datasets, 1=100%, 1.5 = 150%; use

function magFactor = getMagFactor(id)
get magnification for the currently shown or id dataset
Definition getMagFactor.m:18

to read this property

Referenced by updatePixSizeResolution().

◆ maskExist

mibImage.maskExist

a switch to indicate presense of the Mask layer. Can be 0 (no model) or 1 (model exist)

◆ maskImg

mibImage.maskImg

a property to keep the Mask layer

Note
The Mask dimensions are:
[1:height, 1:width, 1:no_stacks]
When the imageData.model_type == 'uint6', imageData.maskImg = NaN

Referenced by saveMask().

◆ maskImgFilename

mibImage.maskImgFilename

file name of the Mask layer image

◆ maskStat

mibImage.maskStat

Statistics for the Mask layer with the PixelList info returned by regionprops Matlab function.

◆ meta

mibImage.meta

information about the dataset, an instance of the containers.Map class Default keys:

  • ColorType - a string witg type of colors - grayscale, truecolor, hsvcolor, indexed
  • ImageDescription - ''
  • Filename - 'none.tif'
  • SliceName - [optional] a cell array with names of the slices; for combined Z-stack, it is a name of the file that corresponds to the slice. Dimensions of the array should be equal to the obj.no_stacks
  • Height
  • Width
  • Depth
  • Colors
  • Time
  • MaxInt - maximal number that can be stored in the image container (255 for 8bit, 65535 for 16 bit)
  • imgClass - a string with image class, uint8, uint16, uint32;

Referenced by clearContents(), insertSlice(), mibImage(), and mibSetImarisDataset().

◆ model

mibImage.model

model is a property to keep the Model layer

Note
The model dimensions are
[1:height, 1:width, 1:no_stacks]

Referenced by materialsRemove(), mibSetImarisDataset(), and saveModel().

◆ modelExist

mibImage.modelExist

a switch to indicate presense of the Model layer. Can be 0 (no model) or 1 (model exist)

◆ modelFilename

mibImage.modelFilename

modelFilename is a property to keep filename of the Model layer

◆ modelMaterialColors

mibImage.modelMaterialColors

a matrix of colors [0-1] for materials of the Model, [materialIndex, R G B]

Referenced by mibRenderModelImaris(), mibSetImarisDataset(), and saveModel().

◆ modelMaterialNames

mibImage.modelMaterialNames

an array of strings to define names of materials of the Model

Referenced by createModel(), mibRenderModelImaris(), mibSetImarisDataset(), and saveModel().

◆ modelType

mibImage.modelType

type for models

  • 0 - an overlay type model with indices from -128 to 128
  • 63 - maximum 63 material for the model
  • 255 - maximum 255 material for the model
  • 65535 - maximum 65535 material for the model
  • 4294967295 - maximum 4294967295 material for the model

Referenced by createModel(), and saveModel().

◆ modelVariable

mibImage.modelVariable

modelVariable is a variable name in the mat-file to keep the Model layer; default: mibModel'

Referenced by saveModel().

◆ orientation

mibImage.orientation

Orientation of the currently shown dataset,.

  • 4 = the yz plane, default
  • 1 = the zx plane
  • 2 = the zy plane

◆ pixSize

mibImage.pixSize

a 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]

Referenced by mibRenderModelImaris(), mibSetImarisDataset(), and updatePixSizeResolution().

◆ selectedAddToMaterial

mibImage.selectedAddToMaterial

index of selected Add to Material, where the Selection layer should be targeted, assigned in the AddTo column of the mibView.handles.mibSegmentationTable 1 - Mask; 2 - Exterior; 3 - first material of the model, 4 - second material etc

◆ selectedColorChannel

mibImage.selectedColorChannel

color channel selected in the Color channel combo box of the Selection panel. 0 - all colors, 1, 2 - 1st, 2nd ...

◆ selectedMaterial

mibImage.selectedMaterial

index of material selected in the mibView.handles.mibSegmentationTable: 1 - Mask; 2 - Exterior; 3 - first material of the model, 4 - second material etc

◆ selectedROI

mibImage.selectedROI

a vector of indeces (as stored in mibRoiRegion class) of the selected ROI in the mibView.handles.mibRoiList table; -1 -> roi is not shown; [1, 3] -> first and third...

◆ selection

mibImage.selection

a property to keep the Selection layer

Note
The selection dimensions:
[1:height, 1:width, 1:no_stacks]
When the imageData.model_type == 'uint6', imageData.selection = NaN

Referenced by saveModel().

◆ slices

mibImage.slices

coordinates of the shown part of the dataset

Note
dimensions are
([height, width, color, depth, time],[min max])
#define min(a, b)
Definition imgaussian.c:5
#define max(a, b)
Definition imgaussian.c:8
  • (1,[min max]) - height
  • (2,[min max]) - width
  • (3,[min max]) - colors , array of color channels to show, for example [1, 3, 4]
  • (4,[min max]) - z - value
  • (5,[min max]) - t - time point

Referenced by mibRenderModelImaris(), and mibSetImarisDataset().

◆ src

mibImage.src

Referenced by Listner2_Callback().

◆ time

mibImage.time

number of time points in the dataset

Referenced by addFrameToImage(), getDatasetDimensions(), mibRenderModelImaris(), and mibSetImarisDataset().

◆ useLUT

mibImage.useLUT

use or not LUT for visualization of image, a number 0 - do not use; 1 - use a status of mibCpontroller.mibView.handles.mibLutCheckbox.Value

◆ viewPort

mibImage.viewPort

a structure with viewing parameters:

  • .min - a vector with minimal value for intensity stretching for each color channel
  • .max - a vector with maximal value for intensity stretching for each color channel
  • .gamma a vector with gamma factor for contrast adjustment for each color channel

Referenced by mibController.mibDoUndo(), and mibSetImarisDataset().

◆ Virtual

mibImage.Virtual

a structure to work with virtual stacks

  • filenames - a cell array with filenames for each reader, needed for deep copy of bio-format readers
  • .objectType - a cell array that defines type of the reader: bioformats, matlab.hdf5
  • .readerId - define readerId, which is a vector with length equal to the total number of slices. Each element identifies the reader index for desired slice number of the combined dataset: readerId(5) = 3; indicates that slice number 5 is stored in the reader 3. Obtained from the Virtual_readerId key of the metadata
  • .seriesName - a cell array that defines series name for each file: numbers for bioformats; strings for hdf5
  • .slicesPerFile - an array that specifies how many slices each reader contains. Obtained from the Virtual_slicesPerFile key of the metadata
  • .virtual - a main switch, when = 1, indicates that the dataset is in the virtual stack mode, i.e. disk resident, which is opposed to the normal memory resident mode

Referenced by mibSetImarisDataset().

◆ volren

mibImage.volren

a structure with parameters for the volume rendering the fields are

  • .show - a switch show or not the volume rendering
  • .viewer_matrix - a viewer matrix generated from the Rotation, Translation and Scaling vectors using makeViewMatrix function
  • .previewScale - scaledown factor for dataset preview during volren
  • .previewImg - scaled down image
  • .showFullRes - switch whether or not render image in full resolution or just preview

◆ width

mibImage.width

image width, px

Referenced by addFrameToImage(), getDatasetDimensions(), and getROIBoundingBox().


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