Is there a Macro Function that emulates COUNT / SIZE + SELECT MEASUREMENTS + RESET RANGES BUTTON

All --

I'm working on a macro for customer with IMAGE-PRO PLUS.

I would like to embed a function call within my macro that does the same thing as

  COUNT / SIZE
  +
  SELECT MEASUREMENTS
  +
  RESET RANGES BUTTON

so that I can make only 1 of the 5 measurements that is being made actually be a filter.

If the

  RESET RANGES BUTTON

is pressed with the MACRO RECORDER running, nothing is recorded and nothing in the IpBlb section of the AUTO-PRO section of the HELP FILE seems to be appropriate.

Is there a way to stop a measurement from being a FILTER other than using

  IpBlbSetFilterRange

to set the limits beyond the actual expected range?

I guess I could COUNT with only the 1 measurement that is a filter active and then MEASURE with all 5 measurements active.

Any other (more elegant) suggested solutions?

Thanks.

-- Matt


Best Answer

  • edited October 2014 Accepted Answer
    Sorry, Matt, I missed the name of the group and responded how it would be handled in Premier.

    In Image-Pro Plus clicking the Reset range button just sets the default ranges to that measurement, so you can just record a macro adjusting the range to default values. Default ranges are set to include all possible values, so it's equivalent to switching off the filter.

    ret = IpBlbSetFilterRange(BLBM_BOX_AREA, 0.0, 1.0)

    Regards,

    Yuri

Answers

  • edited October 2014
    Hi Matt,

    The list of selected measurements and filter ranges are independent in Premier, so resetting filter range or disabling filter is equivalent to removing this measurement from FilterRanges list. You can record it also in the selected measurement dialog (Types). The result macro will look like this. The macro selects 3 measurements, but only one of them is used as filter range:
        Public Function SetFilterRanges() As SimpleScript
            SetFilterRanges = New SimpleScript
            Dim doc1
    
            With Application.DocumentCommands.Active(SetFilterRanges)
                .Run(doc1)
            End With
    
            With Measure.MeasurementsCommands.Options(SetFilterRanges)
                .SelMeasurements = New MeasCollection()
                    .SelMeasurements.Add( New MeasEntry(eMeasures.RgnArea))
                    .SelMeasurements.Add( New MeasEntry(eMeasures.RgnAspect))
                    .SelMeasurements.Add( New MeasEntry(eMeasures.RgnPerimeter))
                .Segmentation.FilterRanges = New System.Collections.Generic.List(Of MeasFilterEntry)
                    .Segmentation.FilterRanges.Add( New MeasFilterEntry(eMeasures.RgnArea,50R,10000000R))
                .Run(doc1)
            End With
    
        End Function
    

    You can then modify the Options command in the Designer view of the Project workbench adjusting ranges or adding new filters.

    Regards,

    Yuri
  • Yuri --

    Thank you for the prompt response.

    The information you provided applies to IMAGE-PRO PREMIER but this challenge is within IMAGE-PRO PLUS.

    I'm thinking the best way to solve this is

         1) COUNT with 1 MEASUREMENT & 1 FILTER RANGE ACTIVE
         2) MEASURE with 5 MEASUREMENTS & NO FILTERS

    If you have a better suggestion, it would be much appreciated.

    Thanks.

    -- Matt
  • Yuri --

    Thank you for the prompt response.

    I'll incorporate your suggestion into the program.

    Thanks again.

    -- Matt
Sign In or Register to comment.