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

class is resposnible for keeping Measurements of the model More...

Inheritance diagram for Measure:
Collaboration diagram for Measure:

Public Member Functions

 Measure (hImg)
 Constructor for the class. More...
 
function  addMeasurements (newData, n)
 add or insert measurement into the obj.Data structure More...
 
function
handles = 
addMeasurementsToPlot (handles, mode, axes)
 plot measurement marks above the imageAxes of im_browser More...
 
function  clearContents ()
 Set all elements of the class to default values. More...
 
function  editMeasurements (handles, index, colCh)
 
function  removeMeasurements (index)
 removeMeasurements(obj, index) Remove measurement(s) from the class More...
 
function  setOptions ()
 Update all values of the Options structure of the class. More...
 
function  setDefaultOptions ()
 Set all values of the Options structure of the class to default values. More...
 
function
position = 
drawROI (handles, type, pos, instant)
 show a ROI object in the handles.imageAxes for selection of the area to measure More...
 
function  updateROIposition1 (new_position)
 Update ROI position during movement of imrect and imellipse. More...
 
function  updateROIposition2 (new_position)
 Update position during movement of impoly, imline. More...
 
function  updateROIScreenPosition (mode)
 Updates position of ROI when plotting in handles.imageAxes. More...
 
function number = getNumberOfMeasurements ()
 number = getNumberOfMeasurements(obj) Get number of stored measurements More...
 
function circ = circlefit (x, y)
 least squares circle fitting (see matlab help/demo (pendulum)) More...
 
function result = AngleFun (handles, index, colCh, finetuneCheck)
 This function allows the measurement an angle between 3 points. More...
 
function result = CaliperFun (handles, index, colCh, finetuneCheck)
 measuring a distance between two opposite sides of an object More...
 
function result = CircleFun (handles, index, colCh, finetuneCheck)
 This function allows the measurement of a radius, using a cirlce. More...
 
function result = DistanceFreeFun (handles, colCh, finetuneCheck)
 measuring of distance along the free-hand path. The path is converted to impoly line More...
 
function result = DistancePolyFun (handles, index, colCh, noPoints, finetuneCheck)
 measuring of distance along the path More...
 
function result = PointFun (handles, index, colCh, finetuneCheck)
 add a point as a marker More...
 
function result = DistanceFun (handles, index, colCh, finetuneCheck)
 measuring of a two point distance More...
 

Public Attributes

 Data
 a structure with measurements .Data.n - index, double .Data.type - type, string: LinDistance, .Data.value - value, double .Data.X - X-coordinates of points .Data.Y - Y-coordinates of points .Data.Z - Z-coordinates of points .Data.T - T-coordinates of points .Data.spline .Data.circ .Data.intensity - average intensity of the profile .Data.profile - intensity profile More...
 
 hImg
 handle to imageData class More...
 
 Options
 a structure with show options .Options.marker1 = o; - style 1 for markers .Options.marker2 = .; - style 2 for markers .Options.markersize = 10; - size of markers .Options.linestyle1 = -; - style 1 for lines .Options.linestyle2 = ; - style 2 for lines .Options.linewidth = 1 ; - width for lines .Options.color1 = y; - color style 1 .Options.color2 = k; - color style 2 .Options.textcolorfg = y; - text color .Options.textcolorbg = none; - color for text background .Options.fontsize = 14; - size of the font .Options.splinemethod = spline; - method for splines .Options.showMarkers = 1; .Options.showLines = 1; .Options.showText = 1; More...
 
 roi
 a structure with ROI data: More...
 
 typeToShow
 a string that defines type of measurements to show: More...
 

Detailed Description

class is resposnible for keeping Measurements of the model

Constructor & Destructor Documentation

Measure.Measure (   hImg)

Constructor for the class.

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

Parameters
hImg- handle to imageData class

References hImg.

Member Function Documentation

function Measure.addMeasurements (   newData,
  n 
)

add or insert measurement into the obj.Data structure

Parameters
newDatastructure of a new measurement to insert. Fields should match those of obj.Data
n[optional] position where to add the measurement, default - number of measurements in obj.Data + 1

Examples:

Measure.addMeasurements(newData, 5); insert measurement to position 5
addMeasurements(obj, newData); // Call within the class. Add a measurement
function handles = Measure.addMeasurementsToPlot (   handles,
  mode,
  axes 
)

plot measurement marks above the imageAxes of im_browser

Parameters
handleshandles structure of im_browser.m
modea string that defines a mode of the shown image: shown (in most cases), or full (for panning)
axes[optional], define a handles to axes that should be used for drawing, used in ib_snapshotGui.m; default handles.imageAxes
Required fields of handles:

Examples:

handles = handles.Img{handles.Id}.I.hMeasure.addMeasurementsToPlot(handles, 'shown'); // to show the measurements above the image in the imageData.plotImage function
handles = handles.Img{handles.Id}.I.hMeasure.addMeasurementsToPlot(handles, 'full'); // to show the measurements above the image in the im_browser_WindowButtonDownFcn function
function result = Measure.AngleFun (   handles,
  index,
  colCh,
  finetuneCheck 
)

This function allows the measurement an angle between 3 points.

Parameters
handleshandles of im_browser
index[Optional] an index of measurement to update; when empty ([] ) - adds a new measurement
colCh[optional] color channel to use for profile; default = 1
finetuneCheck[optional] 1 (default) - allow fine-tuning during the placing of measurements; 0 - instant placing
Return values
finetuneCheckresult - 1-success, 0-cancel
Required fields of handles:

Examples

Measure.AngleFun(handles, [], 1); // get points and measure the angle between them. Calculate intensity profile for color channel 1
Measure.AngleFun(handles, 2, 1); // edit second measurement.

References getClickPoint().

Here is the call graph for this function:

function result = Measure.CaliperFun (   handles,
  index,
  colCh,
  finetuneCheck 
)

measuring a distance between two opposite sides of an object

Parameters
handleshandles of im_browser
index[Optional] an index of measurement to update; when empty ([] ) - adds a new measurement
colCh[optional] color channel to use for profile; default = 1
finetuneCheck[optional] 1 (default) - allow fine-tuning during the placing of measurements; 0 - instant placing
Return values
finetuneCheckresult - 1-success, 0-cancel
Required fields of handles:

Examples

Measure.CaliperFun(handles, [], 1); // get points and measure the distance between them. Calculate intensity profile for color channel 1
Measure.CaliperFun(handles, 2, 1); // edit second measurement.

References getClickPoint().

Here is the call graph for this function:

function circ = Measure.circlefit (   x,
  y 
)

least squares circle fitting (see matlab help/demo (pendulum))

Parameters
x
y
Return values
circ
Generated fields of circ:
function result = Measure.CircleFun (   handles,
  index,
  colCh,
  finetuneCheck 
)

This function allows the measurement of a radius, using a cirlce.

Parameters
handleshandles of im_browser
index[Optional] an index of measurement to update; when empty ([] ) - adds a new measurement
colCh[optional] color channel to use for profile; default = 1
finetuneCheck[optional] 1 (default) - allow fine-tuning during the placing of measurements; 0 - instant placing
Return values
finetuneCheckresult - 1-success, 0-cancel
Required fields of handles:

Examples

Measure.CircleFun(handles, [], 1); // get points and measure the radius. Calculate intensity profile for color channel 1
Measure.CircleFun(handles, 2, 1); // edit second measurement.

References getClickPoint().

Here is the call graph for this function:

function Measure.clearContents ( )

Set all elements of the class to default values.

Examples:

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

Examples:

MeasureInstance.clearData();
clearData(obj); // Call within the class
function result = Measure.DistanceFreeFun (   handles,
  colCh,
  finetuneCheck 
)

measuring of distance along the free-hand path. The path is converted to impoly line

Parameters
handleshandles of im_browser
colCh[optional] color channel to use for profile; default = 1
finetuneCheck[optional] 1 (default) - allow fine-tuning during the placing of measurements; 0 - instant placing
Return values
finetuneCheckresult - 1-success, 0-cancel
Required fields of handles:

Examples

Measure.DistanceFreeFun(handles, 1); // draw a path and measure the distance between points. Calculate intensity profile for color channel 1

References mib_inputdlg().

Here is the call graph for this function:

function result = Measure.DistanceFun (   handles,
  index,
  colCh,
  finetuneCheck 
)

measuring of a two point distance

Parameters
handleshandles of im_browser
index[Optional] an index of measurement to update; when empty ([] ) - adds a new measurement
colCh[optional] color channel to use for profile; default = 1
finetuneCheck[optional] 1 (default) - allow fine-tuning during the placing of measurements; 0 - instant placing
Return values
finetuneCheckresult - 1-success, 0-cancel
Required fields of handles:

Examples

Measure.DistanceFun(handles, [], 1); // get points and measure the distance between them. Calculate intensity profile for color channel 1
Measure.DistanceFun(handles, 2, 1); // edit second measurement.

References getClickPoint().

Here is the call graph for this function:

function result = Measure.DistancePolyFun (   handles,
  index,
  colCh,
  noPoints,
  finetuneCheck 
)

measuring of distance along the path

Parameters
handleshandles of im_browser
index[Optional] an index of measurement to update; when empty ([] ) - adds a new measurement
colCh[optional] color channel to use for profile; default = 1
noPoints[optional] define number of points in the path; default = 5
finetuneCheck[optional] 1 (default) - allow fine-tuning during the placing of measurements; 0 - instant placing
Return values
finetuneCheckresult - 1-success, 0-cancel
Required fields of handles:

Examples

Measure.DistancePolyFun(handles, [], 1, 10); // get 10 points and measure the distance between them. Calculate intensity profile for color channel 1
Measure.DistancePolyFun(handles, 2, 1); // edit second measurement.

References getClickPoint().

Here is the call graph for this function:

function position = Measure.drawROI (   handles,
  type,
  pos,
  instant 
)

show a ROI object in the handles.imageAxes for selection of the area to measure

Creates an instanse of Matlab imroi class and store it in Measure.roi.imroi

Parameters
handleshandles structure of im_browser.m
typea type of ROI: 'imline', 'imellipse'
poscoordinates of the ROI
  • [x1, y1; x2, y2] -> 'imline'
  • [x1, y1, Rwidth, Rheight] -> 'imellipse'
instant[optional], used only for imellipse to automatically get position of vertices. 1 or 0 (default).
Return values
positioncoordinates of the selected area
Required fields of handles:

Examples:

position = roiRegion.drawROI(handles, 'imline', [10, 10; 50, 50]); // draw a line
position = drawROI(obj, handles, 'imline', [10, 10; 50, 50]);; // Call within the class; draw a line
function Measure.editMeasurements (   handles,
  index,
  colCh 
)
function number = Measure.getNumberOfMeasurements ( )

number = getNumberOfMeasurements(obj) Get number of stored measurements

Return values
numbernumber of stored measurements

Examples

number = Measure.getNumberOfMeasurements(); // get the total number
number = getNumberOfMeasurements(obj); // Call within the class; get the total number
function result = Measure.PointFun (   handles,
  index,
  colCh,
  finetuneCheck 
)

add a point as a marker

Parameters
handleshandles of im_browser
index[Optional] an index of measurement to update; when empty ([] ) - adds a new measurement
colCh[optional] color channel to use for profile; default = 1
finetuneCheck[optional] 1 (default) - allow fine-tuning during the placing of measurements; 0 - instant placing
Return values
finetuneCheckresult - 1-success, 0-cancel
Required fields of handles:

Examples

Measure.PointFun(handles, [], 1); // place points and assign a label.
Measure.PointFun(handles, 2, 1); // edit second measurement.

References getClickPoint(), and mib_inputdlg().

Here is the call graph for this function:

function Measure.removeMeasurements (   index)

removeMeasurements(obj, index) Remove measurement(s) from the class

Parameters
index[optional], an index of the measurement point to remove, when empty or zero - removes all points

Examples

Measure.removeMeasurements(); // remove all measurements
removeMeasurements(obj, 5); // Call within the class; remove 5th measurement
function Measure.setDefaultOptions ( )

Set all values of the Options structure of the class to default values.

Examples:

MeasureInstance.setDefaultOptions();
setDefaultOptions(obj); // Call within the class
function Measure.setOptions ( )

Update all values of the Options structure of the class.

Examples:

MeasureInstance.setOptions();
setOptions(obj); // Call within the class
function Measure.updateROIposition1 (   new_position)

Update ROI position during movement of imrect and imellipse.

one of two functions resposible for update of Measure.roi. pos. The other one is Measure.updateROIposition2()

Parameters
new_positiona vector with coordinates of a new position [xmin, ymin, width, height]
function Measure.updateROIposition2 (   new_position)

Update position during movement of impoly, imline.

one of two functions resposible for update of Measure.roi. pos. The other one is Measure.updateROIposition1()

Parameters
new_positiona vector with coordinates of a new position [point_number][x, y]
function Measure.updateROIScreenPosition (   mode)

Updates position of ROI when plotting in handles.imageAxes.

Parameters
modeidentifier of the updating mode:
  • 'crop' during zooming
  • 'full' during panning of the axes

Examples

Measure.updateROIScreenPosition('crop'); // update positions of all ROIs during zoom in/out
updateROIScreenPosition(obj, 'full'); // Call within the class; update positions of all ROIs during panning

Member Data Documentation

Measure.Data

a structure with measurements .Data.n - index, double .Data.type - type, string: LinDistance, .Data.value - value, double .Data.X - X-coordinates of points .Data.Y - Y-coordinates of points .Data.Z - Z-coordinates of points .Data.T - T-coordinates of points .Data.spline .Data.circ .Data.intensity - average intensity of the profile .Data.profile - intensity profile

Measure.hImg

handle to imageData class

Referenced by Measure().

Measure.Options

a structure with show options .Options.marker1 = o; - style 1 for markers .Options.marker2 = .; - style 2 for markers .Options.markersize = 10; - size of markers .Options.linestyle1 = -; - style 1 for lines .Options.linestyle2 = ; - style 2 for lines .Options.linewidth = 1 ; - width for lines .Options.color1 = y; - color style 1 .Options.color2 = k; - color style 2 .Options.textcolorfg = y; - text color .Options.textcolorbg = none; - color for text background .Options.fontsize = 14; - size of the font .Options.splinemethod = spline; - method for splines .Options.showMarkers = 1; .Options.showLines = 1; .Options.showText = 1;

Measure.roi

a structure with ROI data:

  • roi.pos - coordinates of ROIs
  • roi.type - ROIs type: imline
  • roi.imroi - handle to imroi Matlab class
  • roi.cb - array of callbacks to addNewPositionCallback function
Measure.typeToShow

a string that defines type of measurements to show:

  • All - show all
  • Angle
  • Caliper
  • Circle (R)
  • Distance (linear)
  • Distance (polyline)
  • Point

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