Home Image-Pro Automation (Macros, Apps, Reports)

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


Answers

  • Hi Matt,

    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
  • 2022-11-03-143218

    Yuri --

    Thank you for that information.

    I am working to upgrade an APP that I wrote for IP7 in 2010.  I was attempting to maintain as much of the original USER INTERFACE DESIGN as possible (see below please). 

    The VALUE of BLOBS FOUND (by COUNT) and BLOBS FILTERED (by COUNT) may be lower than an accurate VALUE of CELLS FOUND (by COUNT and MANUAL).

    If there is not an easy way to quantify the number of FEATURES/OBJECTS created MANUALLY then I think I will remove BLOBS FOUND and BLOBS FILTERED from the INTERFACE.

    Thanks again.

    -- Matt

    Old IP7 APP INTERFACE



    New IP10 APP INTERFACE



Sign In or Register to comment.