Top  Previous  Next

measFields ( integer Input [, integer Photo, string File, string User ] )

Use this function to perform automatic field measurements and collect information about geometrical and properties of phases to which objects in an image belong. A phase is represented by a group of pixels of the same value in the Input image, which can only be of the multiphase type. Such an image is usually created as a result of the segmentation of the original Photo image. ImageWarp takes intensity measurements from the Photo image, using the Input image as a binary mask.

Before applying this function, you should select the desired measurement parameters with the selectParam function. The image must be calibrated with proper spatial and intensity calibration scales, and the background corrected for transmission and optical density measurements.

An integer between 1 and 99 specifying the frame number of the multiphase image for which the measurements are taken.  
An optional integer between 1 and 116 specifying the number of the image frame used for intensity measurements. This is usually an original real-color or grayscale image from which the Input image was derived as a result of image processing and segmentation. When measuring intensity parameters, ImageWarp treats the Input image as a binary mask for the Photo image. If you do not need to perform the intensity measurements, you can omit this parameter or set its value to the number of the Input frame and work with the multiphase image only.  
An optional string specifying the name of the ImageWarp data file for saving measurement results. If a file of the same name already exists, ImageWarp will append it with the new measurement data. In this case the set of parameters from the data file will take precedence over the set selected with selectParam. If you leave this field empty, ImageWarp will collect the results in memory in the Global Grid. For more details refer to ImageWarp User's Guide.  
An optional string specifying the formulas for calculating user-defined parameter. See User-defined parameters for more details.  
Error flags

The flag set if successful.  
The flag set if failed.  
The flag set if the file could not be open.  
The flag set if there is not enough space to write the file.  

This set of statements binarizes a sample image, initializes measurement parameters, performs automatic field measurements and prints a resulting value of anisotropy:  
setCurDir ("samples")  
loadIm (1,"sample8.iwd")  
threshRGB(1, 2 , M_PRESET , TRUE, 1, 87,213, 46,151, 143,220)  
selectParam ("Area","InterceptX","InterceptY","Anisotropy")  
measFields (2,1,"")  
print "Anisotropy=", GetParamValue("Anisotropy")  
For the list of measurement parameters supported by Field measurements refer to ImageWarp User's Guide.