![]() |
Microscopy Image Browser 2.91
MIB
|
a basic class to contain individual datasets loaded in MIB. This class is ruled by the mibModel class More...
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 |
a basic class to contain individual datasets loaded in MIB. This class is ruled by the mibModel class
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
img | a new 2D-5D image stack |
meta | a containers .Map class with parameters of the dataset, can be [] |
options | a structure with additional options for the initialization of the instance .modelType - an integer that defines type of the model to use, 63 (default)
|
function BatchOpt = mibImage.addFrameToImage | ( | BatchOpt | ) |
Add a frame around the dataset see also addFrame function.
BatchOpt | an 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 |
BatchOpt | structure with parameters |
Examples
References colors, depth, height, max, mibInputMultiDlg(), min, time, and width.
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
I2 | a stack to add [1:height, 1:width, 1:color, 1:depth] |
shiftX | a value for the X-shift |
shiftY | a value for the Y-shift |
options | an optional structure with options
|
bbShiftXY | a vector [xMin, yMin] with shift of the reference dataset, or empty in case of problems |
function mibImage.clearContents | ( | img, | |
metaIn, | |||
enableSelection ) |
Set all elements of the class to default values.
img | [optional], image to use to initialize the imageData class |
metaIn | [optional], containers .Map class with parameters of the dataset, can be [] |
enableSelection | a switch (0 or 1) to enable/disable selection layer |
Examples:
References enableSelection, img, max, meta, min, and uint32.
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.
options | [optional] a structure with optional area to clear
|
Examples:
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.
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:
References blockModeSwitch, img, max, and min.
function mibImage.closeVirtualDataset | ( | ) |
Close opened virtual dataset readers.
function status = mibImage.convertImage | ( | format, | |
options ) |
Convert image to specified format: grayscale
, truecolor
, indexed
and uint8
, uint16
, uint32
class.
format | description of the new image format
|
options | an optional structure with additional parameters .showWaitbar - show or not the waitbar |
status | 1 -success, 0 -fail |
Examples:
References B(), img, max, mibInputDlg(), and uint32.
function mibImage.convertModel | ( | type | ) |
Convert model from obj.modelType==63 to obj.modelType==255 and other way around.
type | [optional] a double with type of a new model:
|
Examples:
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)
PixelIdxListCrop | vector of indices of the cropped dataset |
options | a structure with parameters
|
Examples:
function [ x , y , z ] = mibImage.convertPixelsToUnits | ( | x, | |
y, | |||
z ) |
convert pixel with x, y, z coordinate to the physical imaging units
x | -> x - coordinate in pixels |
y | -> y - coordinate in pixels |
z | -> z - coordinate in pixels |
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
function [ x , y , z ] = mibImage.convertUnitsToPixels | ( | x, | |
y, | |||
z ) |
convert coordinate with x, y, z in physical units to pixels
x | -> x - coordinate in physical units |
y | -> y - coordinate in physical units |
z | -> z - coordinate in physical units |
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);
|
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
channel1 | [optional] index of the source color channel |
channel2 | [optional] index of the target color channel |
options | structure 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 |
Examples:
References max, and mibInputMultiDlg().
function result = mibImage.copySlice | ( | sliceNumberFrom, | |
sliceNumberTo, | |||
orient, | |||
options ) |
Copy specified slice from one part of the dataset to another.
sliceNumberFrom | index of the source slice |
sliceNumberTo | index of the destination slice |
orient | [optional], can be NaN (current orientation)
|
options | an optional structure with additional paramters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
result | result of the function, 0 fail, 1 success |
Examples:
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
modelType | [optional] a number that defines type of the model (when NaN - use default model type)
|
modelMaterialNames | [optional] a cell array with names of materials, this parameter is not used for modelType > 255 |
Examples:
References modelMaterialNames, and modelType.
function result = mibImage.cropDataset | ( | cropF, | |
options ) |
Crop image and all corresponding layers of the opened dataset.
cropF | a 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
|
result | status of the operation, 1-success, 0-cancel |
Examples:
function mibImage.deleteColorChannel | ( | channel1, | |
options ) |
Delete specified color channel from the dataset.
channel1 | [optional] the index of color channel to delete. |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
status | result of the function: 0-fail/1-success |
Examples:
References max, mibInputDlg(), and min.
function result = mibImage.deleteSlice | ( | sliceNumber, | |
orient, | |||
options ) |
Delete specified slice from the dataset.
sliceNumber | the number of the slice to delete |
orient | [optional], can be NaN (current orientation)
|
options | an optional structure with additional paramters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show Return values: |
result | result of the function, 0 fail, 1 success |
Examples:
References min.
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.
status | result of the function: 0-fail/1-success |
Examples:
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.
bb | - bounding box info
|
Examples:
Referenced by mibSetImarisDataset().
function [ yMin , yMax , xMin , xMax , zMin , zMax ] = mibImage.getCoordinatesOfShownImage | ( | transposeTo4 | ) |
Return minimal and maximal coordinates (XY) of the image that is currently shown.
transposeTo4 | - [optional] when 1, transpose dataset to the orientation 4, when looking on the XY plane of the dataset, used in mibController.menuSelectionInterpolate |
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:
function slice_no = mibImage.getCurrentSliceNumber | ( | ) |
Get slice number of the currently shown image.
slice_no | index of the currently shown slice |
Examples:
function timePnt = mibImage.getCurrentTimePoint | ( | ) |
Get time point of the currently shown image.
timePnt | index of the currently shown slice |
Examples:
function dataset = mibImage.getData | ( | type, | |
orient, | |||
col_channel, | |||
options, | |||
custom_img ) |
Get dataset from mibImage class.
type | type 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
|
col_channel | [optional],
|
options | [optional], a structure with extra parameters
|
custom_img | get dataset from a provided custom image stack, not implemented |
dataset | 4D 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] |
Examples:
Referenced by mibSetImarisDataset().
function [ height , width , color , depth , time ] = mibImage.getDatasetDimensions | ( | type, | |
orient, | |||
color, | |||
options ) |
Get dimensions of the dataset.
type | type of the dataset to retrieve dimensions, image (default), model , mask , selection |
orient | [optional], can be NaN
|
color | [optional], can be NaN
|
options | [optional], a structure with extra parameters
|
height | height of the dataset |
width | width of the dataset |
color | vector of colors of the dataset |
depth | number of z-layers of the dataset |
time | number of time points |
Examples:
References depth, height, time, and width.
Referenced by mibSetImarisDataset().
function [ totalSize , imSize ] = mibImage.getDatasetSizeInBytes | ( | ) |
Get size of the loaded dataset in bytes.
totalSize | - total size of all layers in bytes |
imSize | - size of the image layer in bytes |
Examples:
function dataset = mibImage.getDataVirt | ( | type, | |
orient, | |||
col_channel, | |||
options, | |||
custom_img ) |
Get virtual dataset from mibImage class.
type | type 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
|
col_channel | [optional],
|
options | [optional], a structure with extra parameters
|
custom_img | get dataset from a provided custom image stack, not implemented |
dataset | 4D 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] |
Examples:
function [ lowIn , highIn , lowOut , highOut ] = mibImage.getImAdjustStretchCoef | ( | channels | ) |
Return image stretching coefficients to be used for imadjust function to stretch contrast of the image.
channels | [optional] color channel or vector of color channels to get coefficients; when skipped return coefficients for all color channels |
lowIn | values matching low_in parameter of imadjust |
highIn | values matching high_in parameter of imadjust |
lowOut | values matching low_out parameter of imadjust |
highOut | values matching high_in parameter of imadjust |
Examples:
function dataset = mibImage.getPixelIdxList | ( | type, | |
PixelIdxList, | |||
options ) |
dataset = getPixelIdxList(obj, type, PixelIdxList, options) Get dataset from the list of pixel indices
type | type of the dataset to update, image (not implemented), model , mask , selection , or everything (model , mask and selection for imageData.model_type=='uint6' only) |
PixelIdxList | indices 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
|
dataset | a vector with values |
Examples:
function bb = mibImage.getROIBoundingBox | ( | roiIndex | ) |
return the bounding box info for the ROI at the current orientation
roiIndex | [optional] index of ROI to return the bounding box |
bb | a vector with the bounding box in format: bb = [minX, maxX, minY, maxY, minZ, maxZ] |
Examples:
function index = mibImage.getSelectedMaterialIndex | ( | target | ) |
return the index of the currently selected material in the mibView.handles.mibSegmentationTable
target | a string with optional target column of the table
|
index | an index of the currently selected material;
|
Examples:
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
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 |
labelsList | a cell array with labels |
labelPositions | a matrix with coordinates of the labels [labelIndex, z x y] |
indices | indices of the labels |
Examples:
References max.
function mibImage.insertEmptyColorChannel | ( | channel1, | |
options ) |
Insert an empty color channel to the specified position.
channel1 | [optional] the index of color channel to insert. |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show Return values: |
Examples:
References mibInputDlg().
function mibImage.insertSlice | ( | img, | |
insertPosition, | |||
meta, | |||
options ) |
Insert a slice or a dataset into the existing volume.
img | new 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 |
options | an 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 |
Examples:
References img, max, meta, and mibInputDlg().
function mibImage.invertColorChannel | ( | channel1, | |
options ) |
Invert color channel of the dataset.
The specified channel1 will be inverted
channel1 | [optional] index of the color channel to invert |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
Examples:
References max, and mibInputMultiDlg().
function status = mibImage.materialsInsert | ( | materialIndex, | |
materialName, | |||
options ) |
Insert material with materialName into position materialIndex.
materialIndex | [numeric] index of the new material of the model |
materialName | [string] name of the new material of the model |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
status | result of the function: 0-fail/1-success |
Examples:
function status = mibImage.materialsRemove | ( | materialIndex, | |
options ) |
Remove material from the model.
materialIndex | [numeric] index or indices of materials to be removed from the model, when empty or NaN use the currently selected material |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
status | result of the function: 0-fail/1-success |
Examples:
References model.
function status = mibImage.materialsRename | ( | materialName, | |
materialIndex, | |||
options ) |
Rename material with index materialIndex using a new materialName.
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 |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
status | result of the function: 0-fail/1-success |
Examples:
function status = mibImage.materialsReorder | ( | newOrder, | |
options ) |
Reorder materials in the model.
newOrder | [string] new order of materials in the model |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
status | result of the function: 0-fail/1-success |
Examples:
References M.
function status = mibImage.materialsSwap | ( | material1, | |
material2, | |||
options ) |
Swap material1 and material2 in the model.
material1 | [numeric] index of the first material of the model |
material2 | [numeric] index of the second material of the model |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
status | result of the function: 0-fail/1-success |
Examples:
References M.
function status = mibImage.materialsSwapColors | ( | material1, | |
material2 ) |
Swap colors for material1 and material2 in the model.
material1 | [numeric] index of the first material of the model |
material2 | [numeric] index of the second material of the model |
status | result of the function: 0-fail/1-success |
Examples:
mibImage.methods | ( | Static | ) |
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.
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 |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
status | result of the function: 0-fail/1-success |
Examples:
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
action_type | a type of the desired action
|
options | a structure with additional paramters
|
Examples:
References M.
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
action_type | a type of the desired action
|
options | a structure with additional paramters
|
Examples:
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
action_type | a type of the desired action
|
options | a structure with additional paramters
|
Examples:
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.
action_type | a type of the desired action
|
options | a structure with additional paramters
|
Examples:
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
action_type | a type of the desired action
|
options | a structure with additional paramters
|
Examples:
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
action_type | a type of the desired action
|
options | a structure with additional paramters
|
Examples:
References M.
function mibImage.moveView | ( | x, | |
y, | |||
orient ) |
Center the image view at the provided coordinates: x, y.
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
|
Examples:
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.
type | a string that specifies which layer to use for color replacement: 'mask' or 'selection' |
color_id | a vector with intensity of the new color |
channel_id | indeces of the color channels to be replaced |
slice_id | index of the slice number, or 0 for all |
time_pnt | index of the time point, or 0 for all |
options | a structure with optional parameters
|
Examples:
function result = mibImage.resliceDataset | ( | sliceNumbers, | |
orient, | |||
options ) |
stride reslicing the dataset so that the selected slices are kept and all others are removed
sliceNumbers | array 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)
|
options | an optional structure with additional paramters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show Return values: |
result | result of the function, 0 fail, 1 success |
Examples:
References min.
function mibImage.rotateColorChannel | ( | channel1, | |
angle, | |||
options ) |
Rotate color channel of the dataset.
The specified channel1 will be rotated
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 |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
Examples:
References max, and mibInputMultiDlg().
function fnOut = mibImage.saveImageAsDialog | ( | filename, | |
options ) |
save image to a file
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 |
options | an optional structure with additional parameters
|
fnOut | a string with the output filename |
References bitmap2amiraMesh(), bitmap2nrrd(), generateSequentialFilename(), image2hdf5(), img, mibImage2jpg(), mibImage2mrc(), mibImage2png(), mibImage2tiff(), mibInputMultiDlg(), mibSaveHDF5Dlg(), min, saveBigDataViewerFormat(), and saveXMLheader().
function fnOut = mibImage.saveMask | ( | filename, | |
options ) |
save mask to a file
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 |
options | an optional structure with additional parameters
|
options | fnOut -> output mask filename |
References bitmap2amiraLabels(), generateSequentialFilename(), image2hdf5(), maskImg, mibImage2png(), mibImage2tiff(), mibSaveHDF5Dlg(), min, saveBigDataViewerFormat(), and saveXMLheader().
function fnOut = mibImage.saveModel | ( | filename, | |
saveModelOptions ) |
save model to a file
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 |
saveModelOptions | an optional structure with additional parameters
|
saveModelOptions | fnOut -> output model filename |
References bitmap2amiraLabels(), bitmap2nrrd(), generateSequentialFilename(), image2hdf5(), mibExportModelToImodModel(), mibImage2mrc(), mibImage2png(), mibImage2tiff(), mibInputMultiDlg(), mibRenderModel(), mibSaveHDF5Dlg(), min, model, modelMaterialColors, modelMaterialNames, modelType, modelVariable, saveBigDataViewerFormat(), saveXMLheader(), selection, and stlwrite().
function result = mibImage.setData | ( | type, | |
dataset, | |||
orient, | |||
col_channel, | |||
options ) |
result = setData(obj, type, dataset, orient, col_channel, options) Set dataset
type | type of the dataset to update, image , model ,mask , selection , or everything (model ,mask and selection for imageData.model_type=='uint6' only) |
dataset | 4D 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
|
col_channel | [optional],
|
options | [optional], a structure with extra parameters
|
result | -> 1 - success, 0 - error |
Examples:
function result = mibImage.setPixelIdxList | ( | type, | |
dataset, | |||
PixelIdxList, | |||
options ) |
result = setPixelIdxList(obj, type, dataset, PixelIdxList, options) Set dataset
type | type of the dataset to update, image (not implemented), model ,mask , selection , or everything (model ,mask and selection for imageData.model_type=='uint6' only) |
dataset | a vector with values |
PixelIdxList | indices 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
|
result | -> 1 - success, 0 - error |
Examples:
function mibImage.shiftColorChannel | ( | channel1, | |
dx, | |||
dy, | |||
fillValue, | |||
options ) |
Shift color channel (channel1) by dx/dy pixels.
channel1 | index of the color channel to shift |
dx | x-shift in pixels |
dy | y-shift in pixels |
fillValue | [optional, can be [], default==0] intensity value to fill a frame generated due to the shift of the color channel |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
Examples:
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
channel1 | [optional] index of the first color channel |
channel2 | [optional] index of the second color channel |
options | structure with additional parameters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
Examples:
References max, and mibInputMultiDlg().
function result = mibImage.swapSlices | ( | sliceNumberFrom, | |
sliceNumberTo, | |||
orient, | |||
options ) |
Swap specified slices.
sliceNumberFrom | indeces of the source slice |
sliceNumberTo | indeces of the destination slice |
orient | [optional], can be NaN (current orientation)
|
options | an optional structure with additional paramters .showWaitbar - logical, 1 [default] - show the waitbar, 0 - do not show |
result | result of the function, 0 fail, 1 success |
Examples:
function newMode = mibImage.switchVirtualStackingMode | ( | newMode, | |
enableSelection ) |
Function to switch between loading datasets to memory or reading them from HDD on demand.
newMode | [optional],
|
enableSelection | [optional] a switch to set enableSelection based on mibModel.preferences.System.EnableSelection |
newMode | result of the function,
|
Examples:
References enableSelection.
function mibImage.transpose | ( | new_orient | ) |
Change orientation of the image to the XY, XZ, or YZ plane.
new_orient | a desired orientation:
|
Examples:
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.
newBB | - new Bounding Box parameters, Note! when NaN the dataset will be shifted with using xyzShift
|
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:
function mibImage.updateDisplayParameters | ( | ) |
Update display parameters for visualization (mibImage.viewPort structure)
Examples:
References max.
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.
addText | a string that should be added to the log |
action | [optional] - defines additional actions that may be performed with the log:
|
entryIndex | [optional] - index of the entry to delete, modify or insert |
Examples:
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.
pixSize | - [optional], a structure with new parameters, may have the following fields
|
Examples:
References magFactor, makeViewMatrix(), mibCalculateResolution(), mibInputMultiDlg(), and pixSize.
function mibImage.updateServiceMetadata | ( | metaIn | ) |
update service metadata of MIB based on obj.img and metaIn
metaIn | [optional], a containers map with parameters that should be preserved |
Examples:
References makeViewMatrix(), mibUpdatePixSizeAndResolution(), and min.
function mibImage.updateSlicesStructure | ( | axesX, | |
axesY ) |
updates obj.slices structure using the provided axesX, axesY boundaries
axesX | a vector [min, max] for the X |
axesY | a vector [min, max] for the Y |
Examples:
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
to read this property
Referenced by moveView(), and updateSlicesStructure().
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().
mibImage.BioFormatsMemoizerMemoDir |
path to directory where BioFormats Memoizer is storing memo files
mibImage.blockModeSwitch |
a variable to hold a status of the block mode (mibView.handles.toolbarBlockModeSwitch), 1 - enabled, 0 - disabled
Referenced by clearSelection().
evnt* switch src Name* mibImage.case |
mibImage.colors |
number of color channels
Referenced by addFrameToImage().
mibImage.current_yxz |
a vector to remember last selected slice number of each yx
, zx
, zy
planes,
virtual close mibImage.datasets |
mibImage.defaultAnnotationText |
default text for the annotations
mibImage.defaultAnnotationValue |
default value for the annotations
mibImage.depth |
number of stacks in the dataset
Referenced by addFrameToImage(), addStack(), getDatasetDimensions(), and updateBoundingBox().
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
mibImage.enableSelection |
a switch (0/1) to enable or not the selection, mask, model layers
Referenced by clearContents(), and switchVirtualStackingMode().
mibImage.fixSelectionToMask |
a switch indicating the value of the obj.mibView.handles.mibMaskedAreaCheck
mibImage.fixSelectionToMaterial |
a switch indicating the value of the obj.mibView.handles.mibSegmSelectedOnlyCheck
mibImage.height |
image height, px
Referenced by addFrameToImage(), getDatasetDimensions(), and getROIBoundingBox().
mibImage.hLabels |
a handle to class for keeping annotations
mibImage.hLines3D |
a handle to class for keeping 3D Lines and skeletons
mibImage.hMeasure |
a handle to class to keep measurements
mibImage.hROI |
handle to ROI class, mibRoiRegion
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
Image
layer dimensions: Referenced by clearContents(), clearSelection(), convertImage(), convertModel(), cropDataset(), insertSlice(), mibImage(), and saveImageAsDialog().
mibImage.lastSegmSelection |
a vector with 2 elements of two previously selected materials for use with the e
key shortcut
mibImage.lutColors |
a matrix with LUT colors [1:colorChannel, R G B], (0-1)
mibImage.magFactor |
magnification factor for the datasets, 1=100%, 1.5 = 150%; use
to read this property
Referenced by updatePixSizeResolution().
mibImage.maskExist |
a switch to indicate presense of the Mask
layer. Can be 0 (no model) or 1 (model exist)
mibImage.maskImg |
a property to keep the Mask
layer
Mask
dimensions are: Referenced by saveMask().
mibImage.maskImgFilename |
file name of the Mask
layer image
mibImage.maskStat |
Statistics for the Mask
layer with the PixelList
info returned by regionprops
Matlab function.
mibImage.meta |
information about the dataset, an instance of the containers
.Map
class Default keys:
uint8
, uint16
, uint32
; Referenced by clearContents(), insertSlice(), mibImage(), and mibSetImarisDataset().
mibImage.model |
model is a property to keep the Model
layer
Referenced by materialsRemove(), mibSetImarisDataset(), and saveModel().
mibImage.modelExist |
a switch to indicate presense of the Model
layer. Can be 0 (no model) or 1 (model exist)
mibImage.modelFilename |
modelFilename is a property to keep filename of the Model
layer
mibImage.modelMaterialColors |
a matrix of colors [0-1] for materials of the Model
, [materialIndex, R G B]
Referenced by mibRenderModelImaris(), mibSetImarisDataset(), and saveModel().
mibImage.modelMaterialNames |
an array of strings to define names of materials of the Model
Referenced by createModel(), mibRenderModelImaris(), mibSetImarisDataset(), and saveModel().
mibImage.modelType |
type for models
Referenced by createModel(), and saveModel().
mibImage.modelVariable |
modelVariable is a variable name in the mat-file to keep the Model
layer; default:
mibModel'
Referenced by saveModel().
mibImage.orientation |
Orientation of the currently shown dataset,.
yz
plane, default zx
plane zy
plane mibImage.pixSize |
a structure with diminsions of voxels,
the fields are
Referenced by mibRenderModelImaris(), mibSetImarisDataset(), and updatePixSizeResolution().
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
mibImage.selectedColorChannel |
color channel selected in the Color channel combo box of the Selection panel. 0 - all colors, 1, 2 - 1st, 2nd ...
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
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...
mibImage.selection |
a property to keep the Selection layer
Referenced by saveModel().
mibImage.slices |
coordinates of the shown part of the dataset
Referenced by mibRenderModelImaris(), and mibSetImarisDataset().
mibImage.src |
Referenced by Listner2_Callback().
mibImage.time |
number of time points in the dataset
Referenced by addFrameToImage(), getDatasetDimensions(), mibRenderModelImaris(), and mibSetImarisDataset().
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
mibImage.viewPort |
a structure with viewing parameters:
Referenced by mibController.mibDoUndo(), and mibSetImarisDataset().
mibImage.Virtual |
a structure to work with virtual stacks
bioformats
, matlab.hdf5
Virtual_readerId
key of the metadata Virtual_slicesPerFile
key of the metadata Referenced by mibSetImarisDataset().
mibImage.volren |
a structure with parameters for the volume rendering the fields are
mibImage.width |
image width, px
Referenced by addFrameToImage(), getDatasetDimensions(), and getROIBoundingBox().