Microscopy Image Browser  1.233
All Classes Files Functions Variables Pages
imageUndo Class Reference

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

Inheritance diagram for imageUndo:
Collaboration diagram for imageUndo:

Public Member Functions

 imageUndo (max_steps, max3d_steps)
 imageUndo class constructor More...
 
function  clearContents ()
 Set all elements of the class to default values. More...
 
function  store (type, data, img_info, options)
 Store the data. More...
 
function [ type ,
data ,

img_info ,
options ] = 
undo (index)
 Recover the stored dataset. More...
 
function  removeItem (index)
 Delete a stored item. More...
 
function  replaceItem (index, type, data, img_info, options)
 Replace the stored item with a new dataset. More...
 

Public Attributes

 enableSwitch
 Enable/disable undo operation a variable to store whether Undo is available or not: More...
 
 type
 a variable to store type of the data: 'image', 'model', 'selection', 'mask',labels,'measurement','everything' (for imageData.model_type=='uint6' only) More...
 
 undoList
 a structure to store the list of the actions for undo More...
 
 max_steps
 a variable to limit maximal number of history steps More...
 
 max3d_steps
 a variable to limit maximal number of history for the 3D datasets More...
 
 undoIndex
 a variable to keep index of NaN (currently restored dataset) element of the undoList structure More...
 
 prevUndoIndex
 a variable to keep previous index of NaN element of the undoList structure, for use with Ctrl+Z More...
 
 index3d
 an array of indeces of the 3D datasets More...
 
EVENT none
 none More...
 

Detailed Description

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

Constructor & Destructor Documentation

imageUndo.imageUndo (   max_steps,
  max3d_steps 
)

imageUndo class constructor

Constructor for the imageUndo 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

function imageUndo.clearContents ( )

Set all elements of the class to default values.

Examples:

clearContents(obj); // Call within the class

Referenced by store().

Here is the caller graph for this function:

function imageUndo.removeItem (   index)

Delete a stored item.

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

Examples:

imageUndo.removeItem(5); // delete item number 5
removeItem(obj, 5); // Call within the class; delete item number 5
function imageUndo.replaceItem (   index,
  type,
  data,
  img_info,
  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)
dataa variable with the new dataset to store
img_info[optional] imageData.img_info 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
Required fields of options:

Examples:

storeOptions.t = [5 5];
imageUndo.replaceItem(1, 'image', img, img_info, storeOptions); // replace the 1st stored dataset
replaceItem(obj, 1, 'selection', selection, storeOptions); // Call within the class; replace the 1st stored dataset

References type.

function imageUndo.store (   type,
  data,
  img_info,
  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)
dataa variable with actual 3D or 2D dataset to store
img_info[optional] a imageData.img_info 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
Required fields of options:
Required fields of img_info:

Examples:

storeOptions.t = [5 5];
imageUndo.store('image', img, img_info, 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

References clearContents(), and type.

Here is the call graph for this function:

function [ type , data , img_info , options ] = imageUndo.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
img_info[optional, NaN for 2D] a imageData.img_info 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 -> [optional], [ymin, ymax] coordinates of the stored of the part of the dataset
  • .x -> [optional], [xmin, xmax] coordinates of the stored of the part of the dataset
  • .z -> [optional], [zmin, zmax] coordinates of the stored of the part of the dataset
  • .z -> [optional], [tmin, tmax] coordinates of the stored of the part of the dataset
Generated fields of options:

Examples:

[type, img, img_info, options] = imageUndo.undo(); // recover the image
[type, img] = undo(obj); // Call within the class; recover the image

Member Data Documentation

imageUndo.enableSwitch

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

  • 1 - enable
  • 0 - disable
imageUndo.index3d

an array of indeces of the 3D datasets

imageUndo.max3d_steps

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

Referenced by imageUndo().

imageUndo.max_steps

a variable to limit maximal number of history steps

Referenced by imageUndo().

imageUndo.none

none

Events:
none
imageUndo.prevUndoIndex

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

imageUndo.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(), and store().

imageUndo.undoIndex

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

imageUndo.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 3D dataset or 2D slice
  • .img_info - img_info containers.Map , for the 'image' type
  • .orient - orientation of the slice, 1 - xz, 2 - yz, 4 - yx
  • .x - vector with .x values
  • .y - vector with .y values
  • .z - vector with .z values
  • .t - vector with .t values

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