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

class is resposnible for keeping Labels/Annotations of the model More...

Inheritance diagram for Labels:
Collaboration diagram for Labels:

Public Member Functions

 Labels ()
 Constructor for the class. More...
 
function  clearContents ()
 Set all elements of the class to default values. More...
 
function  crop (cropF)
 Recalculation of annotation positions during image crop. More...
 
function [
labelsList ,
labelPositions ,

indices ] = 
getCurrentSliceLabels (handles)
 [labelsList, labelPositions] = getCurrentSliceLabels(obj, handles) Get list of labels shown at the current slice More...
 
function [
labelsList ,
labelPositions ,

indices ] = 
getLabels (rangeZ, rangeX, rangeY, rangeT)
 Get list of labels. More...
 
function
labelsNumber = 
getLabelsNumber ()
 Get total number of labels. More...
 
function [
labelsList ,
labelPositions ,

indices ] = 
getSliceLabels (handles, sliceNumber, timePoint)
 [labelsList, labelPositions, indices] = getSliceLabels(obj, handles, sliceNumber, timePoint) Get list of labels shown at the specified slice More...
 
function  removeLabels (labels)
 removeLabels(obj, labels) Remove specified labels More...
 
function  replaceLabels (labels, positions)
 replaceLabels(obj, labels, positions) Replace existing labels with a new list of labels More...
 
function result = updateLabels (oldLabel, newLabelText, newLabelPos)
 Update specified labels with newLabels. More...
 

Public Attributes

 labelText
 a cell array with labels More...
 
 labelPosition
 a matrix with coordinates of the labels [pointIndex, z x y t] More...
 

Detailed Description

class is resposnible for keeping Labels/Annotations of the model

Constructor & Destructor Documentation

Labels.Labels ( )

Constructor for the class.

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

Member Function Documentation

function Labels.clearContents ( )

Set all elements of the class to default values.

Examples:

LabelsInstance.clearContents();
clearContents(obj); // Call within the class

Examples:

labels{1} = 'my label 1';
labels{2} = 'my label 2';
positions(1,:) = [50, 75, 1, 3]; // position 1: z=1, x=50, y=75, t=3;
positions(2,:) = [50, 75, 2, 5]; // position 1: z=2, x=50, y=75, t=5;
LabelsInstance.addLabel(labels, positions); // add a labels to the list
addLabel(obj, labels, positions); // Call within the class; add a labels to the list
function Labels.crop (   cropF)

Recalculation of annotation positions during image crop.

Parameters
cropFa vector [x1, y1, dx, dy, z1, dz, t1, dt] with parameters of the crop. Note! The units are pixels! Parameters t1 and dt are optional!

Examples:

cropF = [100 512 200 512 5 20 7 15]; // define parameters of the crop
cropF2 = [100 512 NaN NaN 5 NaN 7 NaN]; // alternative definition of parameters for the crop
indices = roiRegion.crop(cropF); // crop ROIs
indices = remove(obj, cropF); // Call within the class; crop ROIs
Attention
parameters dx, dy, dz, dt are not used, so they can be replaced with NaNs
function [ labelsList , labelPositions , indices ] = Labels.getCurrentSliceLabels (   handles)

[labelsList, labelPositions] = getCurrentSliceLabels(obj, handles) Get list of labels shown at the current slice

Parameters
handlesa handles structure of im_browser
Return values
labelsLista cell array with labels
labelPositionsa matrix with coordinates of the labels [labelIndex, z x y t]
indicesindices of the labels
Required fields of handles:

Examples:

[labelsList, labelPositions, indices] = LabelsInstance.getCurrentSliceLabels(); // get all labels from the currently shown slice
[labelsList, labelPositions, indices] = getCurrentSliceLabels(obj); // Call within the class; get all labels from the currently shown slice

Referenced by getSliceLabels().

Here is the caller graph for this function:

function [ labelsList , labelPositions , indices ] = Labels.getLabels (   rangeZ,
  rangeX,
  rangeY,
  rangeT 
)

Get list of labels.

Parameters
rangeZ[optional] define range of labels to retrieve for Z [minZ maxZ], can be NaN
rangeX[optional] define range of labels to retrieve for X [minX maxX], can be NaN
rangeY[optional] define range of labels to retrieve for Y [minY maxY], can be NaN
rangeT[optional] define range of labels to retrieve for T [minT maxT], can be NaN
Return values
labelsLista cell array with labels
labelPositionsa matrix with coordinates of the labels [labelIndex, z x y t]
indicesindices of the labels

Examples:

[labelsList, labelPositions, indices] = LabelsInstance.getLabels(); // get all labels
[labelsList, labelPositions, indices] = LabelsInstance.getLabels(50); // get all labels from slice 50
[labelsList, labelPositions, indices] = getLabels(obj, 50); // Call within the class; get all labels from slice 50
function labelsNumber = Labels.getLabelsNumber ( )

Get total number of labels.

Return values
labelsNumbera number of labels

Examples:

labelsNumber = LabelsInstance.getLabelsNumber(); // get number of labels
labelsNumber = getLabelsNumber(obj); // Call within the class; get number of labels
function [ labelsList , labelPositions , indices ] = Labels.getSliceLabels (   handles,
  sliceNumber,
  timePoint 
)

[labelsList, labelPositions, indices] = getSliceLabels(obj, handles, sliceNumber, timePoint) Get list of labels shown at the specified slice

Parameters
handlesa handles structure of im_browser
sliceNumber[], a slice number to get labels
timePoint[], a time point to get the labels
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 handles:

Examples:

[labelsList, labelPositions, indices] = LabelsInstance.getSliceLabels(handles, 15); // get all labels from the slice 15
[labelsList, labelPositions, indices] = getSliceLabels(obj, handles); // Call within the class; get all labels from the currently shown slice

References getCurrentSliceLabels().

Here is the call graph for this function:

function Labels.removeLabels (   labels)

removeLabels(obj, labels) Remove specified labels

Parameters
labelsa variable or a vector with a label:
  • omitted: remove all labels
  • a single number or a column of numbers: remove label that have index equal to the number
  • a matrix: remove all labels that have coordinates specified in the matrix [labelIndex, z x y t]
  • a cell array: remove all labels that have text specified in the cell array

Examples:

labels{1} = 'my label 1';
LabelsInstance.removeLabels(labels); // remove annotations that match labels
removeLabels(obj, labels); // Call within the class; remove annotations that match labels
function Labels.replaceLabels (   labels,
  positions 
)

replaceLabels(obj, labels, positions) Replace existing labels with a new list of labels

Parameters
labelsa cell array with labels
positions% a matrix with coordinates of the labels [pointIndex, x, y, z, t]

Examples:

labels{1} = 'my label 1';
labels{2} = 'my label 2';
positions(1,:) = [50, 75, 1, 5]; // position 1: x=50, y=75, z=1,t=5;
positions(2,:) = [50, 75, 2, 6]; // position 1: x=50, y=75, z=2, t=6;
LabelsInstance.replaceLabels(labels, positions); // replace labels with a new list
replaceLabels(obj, labels, positions); // Call within the class; replace labels with a new list
function result = Labels.updateLabels (   oldLabel,
  newLabelText,
  newLabelPos 
)

Update specified labels with newLabels.

Parameters
oldLabela variable or a vector with an old label to be updated:
  • a single number or a column of numbers: remove label that have index equal to the number
  • a matrix: remove all labels that have coordinates specified in the matrix [labelIndex, z x y t]
  • a cell array: remove all labels that have text specified in the cell array
newLabelText% a cell or a char string with new text for the label
newLabelPos% coordinates of the new label [z, x, y]
Return values
resultresult of the function work: 1 - good, 0 - bad

Examples:

label{1} = 'my label 1';
newPosition(1,:) = [50, 75, 1, 5]; // position 1: x=50, y=75; z=1, t=5
LabelsInstance.updateLabels(label, label, newPosition); // update coordinates of a label that has "my label 1" text
updateLabels(obj, label, label, newPosition); // Call within the class; update coordinates of a label that has "my label 1" text

Member Data Documentation

Labels.labelPosition

a matrix with coordinates of the labels [pointIndex, z x y t]

Labels.labelText

a cell array with labels


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