classify
Top  Previous  Next

classify ( integer Input, integer Output, string Param , integer Classes )

Use this command to classify objects in a binary image or selection based on a selected geometrical parameter. The function works by performing blob measurements on each object and sorting the objects into a user-defined number of classes, the range of possible parameter's values to be evenly divided among the classes. Each pixel of a given object then is assigned a value equal to the class ID of the object. Note that the function modifies the original phase information that the input image might contain.

Parameters
 
Input  
 
An integer between 1 and 116 specifying the input image frame number. Values in the range of 100-116 correspond to hidden frames.  
 
Output  
 
An integer between 1 and 116 specifying the output image frame number. Values in the range of 100-116 correspond to hidden frames.  
 
Param  
 
A string argument specifying the measurement parameter used in the function. Must be one of the following values:  
 
AngleMajor
the angle between the major axis of the object and X-axis
Pixels
the number of pixels in an object
Area
the area of an object in calibrated units
AreaBox
the area of the bounding box of an object in calibrated units
Dcircle
the diameter of the equivalent circle in caliblrated units
AxisMajor
the major axis of the equivalent ellipse in calibrated units
AxisMinor
the minor axis of the equivalent ellipse in calibrated units
Perim
the perimeter of an object in the calibrated units
StartX
the X-coordinate of the starting point of an object in pixels
StartY
the Y-coordinate of the starting point of an object in pixels
EndX
the X-coordinate of the endpoint of an object in pixels
EndY
the Y-coordinate of the endpoint of an object in pixels
CenterX
the X-coordinate of object's centroid in calibrated units
CenterY
the Y-coordinate of object's centroid in calibrated units
Aspect
the aspect ratio of the major axis divided by the minor axis
Circularity
the circular form-factor of an object
Ellipticity
the elliptical form-factor of an object
Class
the class ID of an object
Count
the ordinal number of an object in the current session
FeretX
the length of the horizontal projection of an object in calibrated units
FeretY
the length of the vertical projection of an object in calibrated units
MaxX
the maximum X coordinate of an object in calibrated units
MinX
the minimum X coordinate of an object in calibrated units
MaxY
the maximum Y coordinate of an object in calibrated units
MinY
the minimum Y coordinate of an object in calibrated units
YatMaxX
the associated Y-value at the maximum X coordinate of an object
YatMinX
the associated Y-value at the minimum X coordinate of an object
XatMaxY
the associated X-value at the maximum Y coordinate of an object
XatMinY
the associated X-value at the minimum Y coordinate of an object
 
 
Classes  
 
An integer specifying the number of classes .  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  

Example

This set of statements binarizes a sample image and classifies the objects in it by their area into 5 classes:  
 
setCurDir("samples")  
loadIm (1,"sample8.iwd")  
threshRGB(1, 1 , M_PRESET , TRUE, 1, 87,213, 46,151, 143,220)  
classify (1, 2, "Area", 0., 0.3)  
 
Remark
 
For more information on the measurement parameters refer to ImageWarp User's Guide.