Home Image-Pro General Discussions

thickness avg/min/max

Hi,

i'm pretty new in the IPP world ; i'm a programmer and i'm doing a contract for a client to merge all their macros from IPP 7 to IPP 9.1.

My client was using the thickness measurement tool in IPP 7. The behavior with this tool was that a new measure is added with the average, the min and the max of the thickness between two measures.

When I use the tool that seems to be the same in IPP 9.1, I'm not getting the same behavior. Rather than get one new measure with avg/min/max I got dozen and dozen of new measures.

What I have to do to get the same behavior than in IPP 7 ?

Thanks in advance.

Answers

  • You, probably, use Incremental distance tool, which is a new tool in Premier. If you want to get the same behavior as in IPPlus, you have to use "Distance between centers" tool, which will report average distance if the selected objects are poly-lines. The same for Min and Max tools.

    Yuri
  • Hi Yuri,

    I just told this to my client and he said to me that the "distance between centers" don't do the same job that what we have in IPP 7.

    I attached a file of an example of what my client needs to do.

    IpMeasTool(MEAS_CTHICK) was the command used in the macro of IPP 7 to do what they want.

    Can you help me ?

    Thanks,

    Martin
  • edited January 2015
    Hi Martin,

    "Distance between centers" reports average distance between traces only when the selected features are poly-lines. In your case they are polygons, so the tool returns distance between centers of polygons, not really what you need.

    You can use Incremental distance in that case. 
    1. Create 2 polygons, for internal and external outlines. (use measurements Polygon tool).
    2. Select these 2 polygons. Note that the order of selection is important, select first Internal and then External polygon.
    3. Click the "Incremental Distance" button using "Shortest" measurement type.



    The result will report all distances in the Line:Length column, note that the statistics pane will show all necessary values (Min, Max, Average, Std.Deviation,...).



    You can also get this statistical measurements in macro:

        Public Sub PrintDistStats
            Dim md As MediaCy.Addins.Measurements.McMMData=ThisApplication.ActiveImage.MeasurementsData
            With ThisApplication.Output
                .Show
                .PrintMessage(String.Format("Average={0}",md.Statistics(eMeasures.LnLength).Mean))
                .PrintMessage(String.Format("Maximum={0}",md.Statistics(eMeasures.LnLength).Maximum))
                .PrintMessage(String.Format("Minimum={0}",md.Statistics(eMeasures.LnLength).Minimum))
            End With
        End Sub
    
    The output is:

    Average=110.607113102972
    Maximum=165.477079018553
    Minimum=53.6872980663348


    Regards,

    Yuri

  • Yuri,

    many thanks for this nice answer.
Sign In or Register to comment.