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

This class is responsible to store the previous versions of the dataset, to be used for Undo (Ctrl+Z) command. More...

Inheritance diagram for mibImageUndo:
Collaboration diagram for mibImageUndo:

Public Member Functions

 mibImageUndo (max_steps, max3d_steps)
 mibImageUndo class constructor
 
function  clearContents ()
 Set all elements of the class to default values.
 
function  setNumberOfHistorySteps (max_steps, max3d_steps)
 setNumberOfHistorySteps(obj, max_steps, max3d_steps) Set number of history steps for undo
 
function  store (type, data, meta, options)
 Store the data.
 
function [ type , data , meta , options ] = undo (index)
 Recover the stored dataset.
 
function  removeItem (index)
 Delete a stored item.
 
function  replaceItem (index, type, data, meta, options)
 Replace the stored item with a new dataset.
 

Public Attributes

 enableSwitch
 Enable/disable undo operation a variable to store whether Undo is available or not:
 
 type
 a variable to store type of the data: 'image', 'model', 'selection', 'mask', 'labels', 'measurement','everything' (for imageData.model_type=='uint6' only)
 
 undoList
 a structure to store the list of the actions for undo
 
 max_steps
 a variable to limit maximal number of history steps
 
 max3d_steps
 a variable to limit maximal number of history for the 3D datasets
 
 undoIndex
 a variable to keep index of NaN (currently restored dataset) element of the undoList structure
 
 prevUndoIndex
 a variable to keep previous index of NaN element of the undoList structure, for use with Ctrl+Z
 
 index3d
 an array of indeces of the 3D datasets
 
EVENT none
 none
 
- Public Attributes inherited from handle
 addlistener
 Creates a listener for the specified event and assigns a callback function to execute when the event occurs.
 
 notify
 Broadcast a notice that a specific event is occurring on a specified handle object or array of handle objects.
 
 delete
 Handle object destructor method that is called when the object's lifecycle ends.
 
 disp
 Handle object disp method which is called by the display method. See the MATLAB disp function.
 
 display
 Handle object display method called when MATLAB software interprets an expression returning a handle object that is not terminated by a semicolon. See the MATLAB display function.
 
 findobj
 Finds objects matching the specified conditions from the input array of handle objects.
 
 findprop
 Returns a meta.property objects associated with the specified property name.
 
 fields
 Returns a cell array of string containing the names of public properties.
 
 fieldnames
 Returns a cell array of string containing the names of public properties. See the MATLAB fieldnames function.
 
 isvalid
 Returns a logical array in which elements are true if the corresponding elements in the input array are valid handles. This method is Sealed so you cannot override it in a handle subclass.
 
 eq
 Relational functions example. See details for more information.
 
 transpose
 Transposes the elements of the handle object array.
 
 permute
 Rearranges the dimensions of the handle object array. See the MATLAB permute function.
 
 reshape
 hanges the dimensions of the handle object array to the specified dimensions. See the MATLAB reshape function.
 
 sort
 ort the handle objects in any array in ascending or descending order.
 

Detailed Description

This class is responsible to store the previous versions of the dataset, to be used for Undo (Ctrl+Z) command.

Constructor & Destructor Documentation

◆ mibImageUndo()

mibImageUndo.mibImageUndo ( max_steps,
max3d_steps )

mibImageUndo class constructor

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

Parameters
max_stepsmaximal length of the history log
max3d_stepsmaximal length of the 3D history log

References max3d_steps, and max_steps.

Member Function Documentation

◆ clearContents()

function mibImageUndo.clearContents ( )

Set all elements of the class to default values.

Examples:

mibImageUndo.clearContents();
mibImageUndo(max_steps, max3d_steps)
mibImageUndo class constructor
Definition mibImageUndo.m:117
clearContents(obj); // Call within the class
function clearContents()
Set all elements of the class to default values.
Definition mibImageUndo.m:136

Referenced by store().

Here is the caller graph for this function:

◆ removeItem()

function mibImageUndo.removeItem ( index)

Delete a stored item.

Parameters
index[optional] - index of the item to remove, when empty will remove the last entry

Examples:

mibImageUndo.removeItem(5); // delete item number 5
removeItem(obj, 5); // Call within the class; delete item number 5
function removeItem(index)
Delete a stored item.
Definition mibImageUndo.m:391

◆ replaceItem()

function mibImageUndo.replaceItem ( index,
type,
data,
meta,
options )

Replace the stored item with a new dataset.

Parameters
indexan index of the item to replace, when empty replace the last entry
typea string that defines the type of the new dataset: 'image', 'model', 'selection', 'mask', 'everything' (for imageData.model_type=='uint6' only), or 'mibImage'
dataa variable with the new dataset to store
meta[optional] imageData.meta containers.Map, not required for 'model', 'selection', 'mask', 'everything', can be NaN
optionsa structure with fields:
  • .orient -> [optional], a number with the orientation of the dataset
  • .y -> [optional], [ymin, ymax] of the part of the dataset to store
  • .x -> [optional], [xmin, xmax] of the part of the dataset to store
  • .z -> [optional], [zmin, zmax] of the part of the dataset to store
  • .z -> [optional], [tmin, tmax] of the part of the dataset to store
  • .viewPort -> [optional], viewPort structure (only for the image)
  • .switch3d -> switch that indicates 3D dataset
  • .id -> index of MIB container
Required fields of options:

Examples:

storeOptions.t = [5 5];
mibImageUndo.replaceItem(1, 'image', img, meta, storeOptions); // replace the 1st stored dataset
replaceItem(obj, 1, 'selection', selection, storeOptions); // Call within the class; replace the 1st stored dataset
function replaceItem(index, type, data, meta, options)
Replace the stored item with a new dataset.
Definition mibImageUndo.m:410

References handle.sort, and type.

◆ setNumberOfHistorySteps()

function mibImageUndo.setNumberOfHistorySteps ( max_steps,
max3d_steps )

setNumberOfHistorySteps(obj, max_steps, max3d_steps) Set number of history steps for undo

References max3d_steps, and max_steps.

◆ store()

function mibImageUndo.store ( type,
data,
meta,
options )

Store the data.

Parameters
typea string that defines the type of the stored data: 'image', 'model', 'selection', 'mask', 'everything' (for imageData.model_type=='uint6' only), labels, lines3d, mibImage
dataa cell/cell array with actual 3D or 2D dataset to store, or with a structure for labels or with Lines3D class for lines3d object
meta[optional] a imageData.meta containers.Map, not required for 'model', 'selection', 'mask', 'everything', can be NaN
optionsa structure with fields:
  • .orient -> [optional], a number with the orientation of the dataset
  • .y -> [optional], [roiId][ymin, ymax] of the part of the dataset to store
  • .x -> [optional], [roiId][xmin, xmax] of the part of the dataset to store
  • .z -> [optional], [roiId][zmin, zmax] of the part of the dataset to store
  • .t -> [optional], [roiId][tmin, tmax] of the part of the dataset to store
  • .viewPort -> [optional] viewPort structure (only for the image)
  • .switch3d -> a switch indicating 3D dataset
  • .id -> index of MIB container to store
Required fields of options:
Required fields of meta:

Examples:

storeOptions.t = [5 5];
mibImageUndo.store('image', img, meta, storeOptions); // store 3D image dataset at the 5th time point
store(obj, 'selection', selection, NaN, storeOptions); // Call within the class; store selection at the 5th time point
function store(type, data, meta, options)
Store the data.
Definition mibImageUndo.m:175

References clearContents(), and type.

Here is the call graph for this function:

◆ undo()

function [ type , data , meta , options ] = mibImageUndo.undo ( index)

Recover the stored dataset.

Parameters
index[Optional] - index of the dataset to restore. When omitted return the last stored dataset
Return values
typea string that defines the type of the stored data: 'image', 'model', 'selection', 'mask', 'everything' (for imageData.model_type=='uint6' only)
dataa variable where to retrieve the dataset
meta[optional, NaN for 2D] a imageData.meta containers.Map, not required for 'model', 'selection', 'mask', 'everything'
optionsa structure with fields:
  • .orient -> [optional], a number with the orientation of the dataset, for 2D slices; or NaN for 3D
  • .y -> [ymin, ymax] coordinates of the stored of the part of the dataset
  • .x -> [xmin, xmax] coordinates of the stored of the part of the dataset
  • .z -> [zmin, zmax] coordinates of the stored of the part of the dataset
  • .z -> [tmin, tmax] coordinates of the stored of the part of the dataset
  • .viewPort -> viewPort structure (only for the image)
  • .switch3d -> a switch indicating 3d dataset
  • .id -> index of MIB container

Examples:

[type, img, meta, options] = mibImageUndo.undo(); // recover the image
type
a variable to store type of the data: 'image', 'model', 'selection', 'mask', 'labels',...
Definition mibImageUndo.m:44
[type, img] = undo(obj); // Call within the class; recover the image
function [ type , data , meta , options ] = undo(index)
Recover the stored dataset.
Definition mibImageUndo.m:340

References type.

Member Data Documentation

◆ enableSwitch

mibImageUndo.enableSwitch

Enable/disable undo operation a variable to store whether Undo is available or not:

  • 1 - enable
  • 0 - disable

◆ index3d

mibImageUndo.index3d

an array of indeces of the 3D datasets

◆ max3d_steps

mibImageUndo.max3d_steps

a variable to limit maximal number of history for the 3D datasets

Referenced by mibImageUndo(), and setNumberOfHistorySteps().

◆ max_steps

mibImageUndo.max_steps

a variable to limit maximal number of history steps

Referenced by mibImageUndo(), and setNumberOfHistorySteps().

◆ none

EVENT mibImageUndo.none

none

Events
none

◆ prevUndoIndex

mibImageUndo.prevUndoIndex

a variable to keep previous index of NaN element of the undoList structure, for use with Ctrl+Z

◆ type

mibImageUndo.type

a variable to store type of the data: 'image', 'model', 'selection', 'mask', 'labels', 'measurement','everything' (for imageData.model_type=='uint6' only)

Referenced by replaceItem(), store(), and undo().

◆ undoIndex

mibImageUndo.undoIndex

a variable to keep index of NaN (currently restored dataset) element of the undoList structure

◆ undoList

mibImageUndo.undoList

a structure to store the list of the actions for undo

  • .type - type of the data: 'image', 'model', 'selection', 'mask', 'labels', 'measurement','everything' (for imageData.model_type=='uint6' only)
  • .data - a field to store a cell with 3D dataset or 2D slice
  • .meta - meta containers.Map , for the 'image' type
  • .options - a substructure with all additional parameters, as for example the following list
  • .orient - orientation of the slice, 1 - xz, 2 - yz, 4 - yx
  • .switch3d - a switch indicating 3D dataset
  • .x - coordinates of the stored of the part of the dataset,as [roiId; xmin, xmax]
  • .y - coordinates of the stored of the part of the dataset
  • .z - coordinates of the stored of the part of the dataset
  • .t - coordinates of the stored of the part of the dataset
  • .viewPort - viewPort structure (only for the image)
  • .id - index of MIB container
  • .LinkedData - structure with additional data to be stored
  • .LinkedVariable - structure that keeps variable names for data stored in LinkedData for example (see in mibController.mibSegmentationSAM), .LinkedData.Points = obj.mibModel.sessionSettings.SAMsegmenter.Points; .LinkedVariable.Points = obj.mibModel.sessionSettings.SAMsegmenter.Points;

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