UPDATE FOR FEATURES IN DATA TABLE . . .
2022-11-02-171736
All --
I have a routine named
Update_Results
The CODE for that routine is below.
This ROUTINE works properly if the BLOB / CELLS are found via a COUNT.
If the BLOBS / CELLS are edited (MANUALLY ADDED or MANUALLY DELETED) the ROUTINE shows the results from the COUNT rather than the results from the IMAGE.
Is there a way to get the POST EDIT "STATISTICS" on the image?
Lets say that the COUNT identified 100 BLOBS and filtered 75 so there are 25 CELLS. If the USER deletes one CELL there would be 24 CELLS. If the USER adds two CELLS with a TOOL (CIRCLE, POLYGON, ETC), there would be 26 CELLS.
Thanks.
-- Matt
PUBLIC Sub Update_Results() 'CONNECT WITH THE IMAGE DATA FOR THE ACTIVE IMAGE Dim im As McImage = _ ThisApplication.ActiveImage 'CONNECT WITH THE MEASUREMENT DATA IN THE IMAGE DATA Dim md As McMMData = _ im.MeasurementsData 'Learn the number of hulls in the ACTIVE IMAGE If md.lastcountinrange <> 0 _ Then textBox_BlobsFound.Text = _ md.LastCountTotal.ToString("0.000") textBox_BlobsFiltered.Text = _ Format(md.LastCountTotal - md.LastCountInRange,"0.000") textBox_CellsFound.Text = _ md.LastCountInRange.ToString("0.000") Else textBox_BlobsFound.Text = _ "0.000" textBox_BlobsFiltered.Text = _ "0.000" textBox_CellsFound.Text = _ "0.000" End If End Sub
0
Answers
You routine reports Count operation results. If you create objects differently (drawing manually or editing), you can also get the number of objects using
md.SubFeatures.Count
Regards,
Yuri