bep -
The CWIMAQVision.Quantify method takes in a mask parameter which it uses to determine the regions on which to quantify. So, after adding the rectangle to your regions object, add the following lines of code (you'll need to add "Dim maskImage As New CWIMAQImage" and "Dim numParticles As Variant" at the top of this function):
maskImage.Type = cwimaqImageTypeU8
Me.CWIMAQVision1.RegionsToMask maskImage, Me.imaqDisplay.Regions
Me.CWIMAQVision1.Label maskImage, maskImage, numParticles
and then the quantify statement will become:
Me.CWIMAQVision1.Quantify Me.imaqDisplay.Image, globalReport, regionsReport, maskImage
Let me know if you have problems with this approach. Thanks!
Greg Stoll
IMAQ R & D
National Instruments
Greg Stoll
LabVIEW R&D