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

Can you use data collector to select only rows that contain a certain measurement type?

I'm using IPP to measure the thickness of two coatings on a substrate. I'm trying to automate the measurement, so I'm using the bright or dark segmentation tools to automatically identify the coatings as large particles, then use Incremental Distance to measure the thickness of each coating at multiple points.

I want to batch process and use Data Collector to accumulate the list of line lengths and process them later with another program. The issue I want to address is that Data Collector takes all the measurements from the Measurement Table, including the segmented particles (Feature Names P#R#) that don't have a line length associated with them. I'd like to use data collector to collect only the line lengths (Feature Names G#L#) so there aren't extra rows that other programs need to run through and ignore. Is there a way to get measurements of G#L# features only in either the Measurement Table or Data Collector Table?

Best Answer

  • Answer ✓
    The right approach would be to remove unwanted measurement objects from the image before collecting the measurements to Data Collector. Just be sure that you set measurement filters to have only one measurement object (coating layer) after Count and then create Incremental distance  with Hide Base Lines option active:


    Then the measurement table will contain only lines, which will be collected to Data Collector.

    Yuri

Answers

  • Thanks Yuri, selecting the bright objects and deleting them worked and gave just the line measurements. I'll have to rewatch the webinar on macros to see how you might do that for one entire measurement class using macros to make it suitable to batch processing.

  • Actually, I just tried to use the data collector after deleting the regions from the measurement table, and the data collector still shows rows for the regions, so that doesn't work right it seems.
  • How did you delete the regions? What regions are shown in the Data Collector?

    Yuri

  • I selected the regions on the Measurement Table, then hit the Delete Selected option under the Select sub-window. The Measurement Table only showed the lines for the coating thickness, but when I did Data Collector again, the regions showed up there.
  • If you delete the measurement object - it's gone, it will not be shown in Measurements data table and not collected to Data Collector.
    How do you collect data to Data Collector? Clicking the Collect button, using Auto collect option or by your macro? If you use a macro for data collection, be sure it's not recreating the objects (e.g. Executing Count in that macro).
    Can you trace the measurement object from Data Collector by name to see if it's present on the image or measurements table?

    Yuri
  • I was mistaken, I didn't clear the old Data Collector data, it's working fine when I delete the 'regions' from the Measurement Table. Is there an easy way to set up a macro to delete only the regions from the Measurement Table? I've recorded the macro in such a way that the regions are one class of object while the lines for thickness measurement are another, but I'm wondering if there's an easier way.

  • Using 2 classes might work, but if you want another way, here is a macro that hides all Region measurement objects:
        Public Sub HideRegionMeasurementObjects
            Dim im As McImage=ThisApplication.ActiveImage
            If im Is Nothing Then Exit Sub
            Dim md As MediaCy.Addins.Measurements.McMMData=im.MeasurementsData
            For Each sf As MediaCy.Addins.Measurements.McMMSubFeature In md.SubFeatures
                If sf.FeatureType=McMMSubFeature.mcmmsfTypes.mcmmsfRegion Then
                    sf.Selected=True'select Region object
                End If
            Next
            'hide selected measuremetns
            md.ShowMeasurements(McMeasurements.enumShowMeasFlags.smfHideSel)
        End Sub
    

    Run it before collecting data to Data Collector.

    Yuri
Sign In or Register to comment.