![]() |
Microscopy Image Browser 2.91
MIB
|
class is responsible for keeping Labels/Annotations of the model More...


Public Member Functions | |
| Labels () | |
| Constructor for the class. | |
| function | clearContents () |
| Set all elements of the class to default values. | |
| function | addLabels (labels, positions, values) |
| Add labels with positions to the class. | |
| function | crop (cropF) |
| Recalculation of annotation positions during image crop. | |
| function [ labelsList , labelValues , labelPositions , indices ] = | getCurrentSliceLabels () |
| [labelsList, labelValues, labelPositions, indices] = getCurrentSliceLabels(obj) Get list of labels shown at the current slice | |
| function [ labelsList , labelValues , labelPositions , indices ] = | getLabels (rangeZ, rangeX, rangeY, rangeT) |
| Get list of labels. | |
| function [ labels , values , positions , indices ] = | getLabelsById (labelId) |
| Get labels using labelId. | |
| function labelsNumber = | getLabelsNumber () |
| Get total number of labels. | |
| function [ labelsList , labelValues , labelPositions , indices ] = | getSliceLabels (handles, sliceNumber, timePoint) |
| [labelsList, labelValues, labelPositions, indices] = getSliceLabels(obj, handles, sliceNumber, timePoint) Get list of labels shown at the specified slice | |
| function [ minZ , labelIds ] = | getMinValueZ () |
| find and return the minimum Z value for all annotations as well as their indices | |
| function [ maxZ , labelIds ] = | getMaxValueZ () |
| find and return the maximum Z value for all annotations as well as their indices | |
| function | removeLabels (labels) |
| removeLabels(obj, labels) Remove specified labels | |
| function result = | renameLabels (oldLabel, newLabelText) |
| Rename specified labels with new text. | |
| function | replaceLabels (labels, positions, values) |
| replaceLabels(obj, labels, positions, values) Replace existing labels with a new list of labels and their values | |
| function result = | updateLabels (oldLabel, newLabelText, newLabelPos, newLabelValues) |
| Update specified labels with newLabels. | |
| function | saveToFile (filename, options) |
| save Labels to a file | |
| function | sortLabels (sortBy, direction) |
| Resort the list of annotation labels. | |
Public Attributes | |
| labelText | |
| a cell array with labels | |
| labelValue | |
| an array with values for labels | |
| labelPosition | |
| a matrix with coordinates of the labels [pointIndex, z x y t] | |
class is responsible for keeping Labels/Annotations of the model
| Labels.Labels | ( | ) |
Constructor for the class.
Constructor for the Labels class. Create a new instance of the class with default parameters
| function Labels.addLabels | ( | labels, | |
| positions, | |||
| values ) |
Add labels with positions to the class.
| labels | a cell array with labels |
| positions | a matrix with coordinates of the labels [pointIndex, z x y t] |
| values | an array of numbers with values for the labels [optional], default = 1 Return values: |
Examples:
| function Labels.clearContents | ( | ) |
Set all elements of the class to default values.
Examples:
| function Labels.crop | ( | cropF | ) |
Recalculation of annotation positions during image crop.
| cropF | a 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:
| function [ labelsList , labelValues , labelPositions , indices ] = Labels.getCurrentSliceLabels | ( | ) |
[labelsList, labelValues, labelPositions, indices] = getCurrentSliceLabels(obj) Get list of labels shown at the current slice
| labelsList | a cell array with labels |
| labelPositions | a matrix with coordinates of the labels [labelIndex, z x y t] |
| indices | indices of the labels |
Examples:
Referenced by getSliceLabels().

| function [ labelsList , labelValues , labelPositions , indices ] = Labels.getLabels | ( | rangeZ, | |
| rangeX, | |||
| rangeY, | |||
| rangeT ) |
Get list of labels.
| 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 |
| labelsList | a cell array with labels |
| labelValues | an array of numbers with values |
| labelPositions | a matrix with coordinates of the labels [labelIndex, z x y t] |
| indices | indices of the labels |
Examples:
| function [ labels , values , positions , indices ] = Labels.getLabelsById | ( | labelId | ) |
Get labels using labelId.
| labelId | a variable or a vector with an old label to be updated:
|
| labels | - cell array with labels of annotations |
| values | - array with values of annotations |
| positions | - a matrix with coordinates (index; z,x,y,t) |
| indices | - array with indices of annoations | Examples: labelIds = [5, 7, 10]';
[labels, values, positions, id] = obj.mibModel.I{obj.mibModel.Id}.hLabels.getLabelsById(labelIds); // call from mibController, get labels with indices 5, 7, 10
|
| function labelsNumber = Labels.getLabelsNumber | ( | ) |
Get total number of labels.
| labelsNumber | a number of labels |
Examples:
| function [ maxZ , labelIds ] = Labels.getMaxValueZ | ( | ) |
find and return the maximum Z value for all annotations as well as their indices
| maxZ | value of max Z for all annotations |
| labelIds | indices of those annotations |
References max.
| function [ minZ , labelIds ] = Labels.getMinValueZ | ( | ) |
find and return the minimum Z value for all annotations as well as their indices
| minZ | value of min Z for all annotations |
| labelIds | indices of those annotations |
References min.
| function [ labelsList , labelValues , labelPositions , indices ] = Labels.getSliceLabels | ( | handles, | |
| sliceNumber, | |||
| timePoint ) |
[labelsList, labelValues, labelPositions, indices] = getSliceLabels(obj, handles, sliceNumber, timePoint) Get list of labels shown at the specified slice
| handles | a handles structure of im_browser |
| sliceNumber | [optional], a slice number to get labels |
| timePoint | [optional], a time point to get the labels |
| 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 getCurrentSliceLabels().

| function Labels.removeLabels | ( | labels | ) |
removeLabels(obj, labels) Remove specified labels
| labels | a variable or a vector with a label:
|
Examples:
| function result = Labels.renameLabels | ( | oldLabel, | |
| newLabelText ) |
Rename specified labels with new text.
| oldLabel | a variable or a vector with an old label to be updated:
|
| newLabelText | a cell or a char string with new text for the label |
| result | result of the function work: 1 - good, 0 - bad |
Examples:
| function Labels.replaceLabels | ( | labels, | |
| positions, | |||
| values ) |
replaceLabels(obj, labels, positions, values) Replace existing labels with a new list of labels and their values
| labels | a cell array with labels |
| positions | a matrix with coordinates of the labels [pointIndex, z x y t] |
| values | an array of numbers with values of the labels, [optional] default = 1 |
Examples:
Referenced by mibAnnotationsController.loadBtn_Callback().

| function Labels.saveToFile | ( | filename, | |
| options ) |
save Labels to a file
| filename | full path to file |
| options | a structure with optional paramters .format - a char string ann - MIB annotation format landmarksAscii - amira landmarks in the ascii format landmarksBin - amira landmarks as binaries psi - PSI format ASCII xls - Microsoft Excel format .showWaitbar - [optional] a number 1-show; 0-do not show the waitbar .outputDir - [optional] output directory .convertToUnits - [optional] a logical, or not convert pixel coordinates to the units requires bounding box and pixSize information .boundingBox - a matrix [x1 width y1 height z1 depth], required for conversion to units .pixSize - a MIB structure with pixel sizes .labelText - [optional], instead of obj.labelText save provided labelText .labelPosition - [optional], instead of obj.labelPosition save provided labelPosition .labelValue - [optional], instead of obj.labelValue save provided labelValue .sliceNames - [optional], cell array with filenames, used for export to excel and csv .addLabelToFilename - [optional], logical add annotation label to filename, default = false |
References labelPosition, labelText, labelValue, points2amiraLandmarks(), points2psi(), and xlswrite2().

| function Labels.sortLabels | ( | sortBy, | |
| direction ) |
Resort the list of annotation labels.
| sortBy | a string with the field to be used for sorting
|
| direction | a string with sorting direction
|
Examples:
| function result = Labels.updateLabels | ( | oldLabel, | |
| newLabelText, | |||
| newLabelPos, | |||
| newLabelValues ) |
Update specified labels with newLabels.
| oldLabel | a variable or a vector with an old label to be updated:
|
| newLabelText | a cell or a char string with new text for the label |
| newLabelPos | coordinates of the new label [z, x, y] |
| newLabelValues | an array of numbers with values of the labels, [optional] default = 1 |
| result | result of the function work: 1 - good, 0 - bad |
Examples:
| Labels.labelPosition |
a matrix with coordinates of the labels [pointIndex, z x y t]
Referenced by saveToFile().
| Labels.labelText |
a cell array with labels
Referenced by saveToFile().
| Labels.labelValue |
an array with values for labels
Referenced by saveToFile().