Home Image-Pro General Discussions

Asking about the equal function as Linearize New command

I heard that the Linearize New command function of Image-Pro Plus soft was quitted in Image-Pro Premier.
And there is no same or equal function in Image-Pro Premier soft.

Could you tell me the method of using Image-Pro Premier soft as like the Linearize New command.

This question is from Kimura
(Temporarily I am using  Mr. Morita's account of Japan Roper for that I ask this question.)

Comments

  • Hi Kimura,

    Can you please provide more details on what is "Linearize New"? Is it histogram equalization method? Or something related to object outlines?

    Yuri

  • edited December 2017

    Hello,Yuri.

    I ask one more question,please.

    The explanation of Linearization New command in Image-Pro Plus help message is written as below.

    --------------------------------------
    If you want to generate the image which is linearized from a present active image on the basic of brightness calibration curve,you have to do the following works.

     1, Calibrate the brightness of image by the "Intensity" command.
     2, Execute "Linearize New" command from the sub menu of  "Calibration" command.
     3, As a result,a floating point type new image is created.
    --------------------------------------


    I would like to gain a standard deviation value of a created new image's histogram.
    I guess that there is no linearization function in Image-Pro Premier,so I'm searching other method to get the similar result of image processing.

    Thank you for your advice.

    Kimura
     

  • Hello Kimura,

    The Histogram standard deviation can be shown on the Histiogram window (when you switch on Statistics in the context menu).

    You can also get it using ThisApplication.ActiveImage.Histogram.StdDev(0)
    as in this macro:
        Public Sub PrintHistogramStdDev
            'print standard deviation or the Gray image (or first channel of the color image)
            Debug.Print( String.Format("Histogram standard deviation = {0}",ThisApplication.ActiveImage.Histogram.StdDev(0)))
        End Sub
    
    
    Is this what you need?

    Yuri

  • edited December 2017
    And here is the macro that converts active image to a new floating point image with pixel values based on Intensity calibration, the equivalent of the "Measure | Calibration |  Linearize New" function of Image-Pro Plus:

        Public Sub ApplyIntensityCalibration
            Dim im As McImage=ThisApplication.ActiveImage
            If im Is Nothing OrElse im.IntensityCalibration Is Nothing Then
                MsgBox("Active image doesn't have intensity calibration")
                Exit Sub'no intensity calibration
            End If
            Dim floatIm As McImage=im.Convert(Mediacy.IQL.Engine.mcImageQuickTypes.mciqtFloat)
            Dim vArea As Object, calPixels
            floatIm.GetArea(vArea)
            'convert pixels values to intensity calibrated values
            im.IntensityCalibration.CalibrateValues(vArea,calPixels)
            floatIm.PutArea(calPixels)
            'set display range according to Intensity calibration
            floatIm.RangeMin=im.IntensityCalibration.LutMin
            floatIm.RangeMax=im.IntensityCalibration.LutMax
        End Sub
    

    Yuri
  • Hello Yuri,


    Thank you for your telling about the macro for getting a standard deviation of histogram.
    And also thank you for your instruction about the macro for carrying out the process equaled as Linearize New function of Image-Pro Plus.

    It may be so helpful for me to get the same result as Linearize New carrying out function.

    However I'm not used to macro work.
    So I can't find how to use macro for this case well.

    I couldn't get the same result as Linearize New carrying ouf fanction by only that I copy and paste the macro which you taught me in module of  "project work bench".

    Please tell me the process how to start up the macro which you taught.
    Thank you for your kindness.


    Kimura

  • edited December 2017
    Hello Kimura,

    You should just  copy the macro to some existing VB file in Project Work Bench and then can run it. Note, that the project should have references to MediaCy.Addins.Calibration.dll and MediaCy.Addins.Measurements.dll (and imports).

    To make it easier for you I have created the project (attached IntensityCalibration.ipx) that already have all the references, so you can just load the project and then run the ApplyIntensityCalibration macro on the active image (that has intensity calibration).

    Sample image with IntensityCalibration (OD):

    Result after running the ApplyIntensityCalibration macro:


    You can also check some video tutorials on our web site about macro recording:

    http://www.mediacy.com/resources/media (seach by "macro")
    or this:
    https://mediacy.wistia.com/medias/vtkmwcwr4b 


    You can also check the current forum for topics about "references" and "Imports" to get additional info, like this one:
    http://forums.mediacy.com/discussion/507/references-and-competing-macros/p1 

    Regards,

    Yuri


  • Hello Yuri,

    Thank you for your attachment of the project file.
     However,the error message is displayed when I copy and run the project file.

    Kimura

  • Hello Kimura,

    The reference to MediaCy.Viewers.ND.dll was added unintentionally as I used Premier 3D to generate the project, it's not used. You can either remove this reference or use the new, adjusted project, without the reference, which is attached.

    Regards,

    Yuri

  • edited January 2018

    Hello Yuri,


    Thank you for your advice and attachment of new file.

    I could get the value of the standard deviation of histogram without error
    thanks of your telling macro code.

     I confirmed the same result when I run the Image-Pro Plus command.

     Honestly and in detail,there are accident errors a little that the standard deviation of Image-Pro Plus displayed
    till sixth place after the decimal point,but the standard deviation of Image-Pro Premier displayed till third place
     after the decimal point.
    However it's no problem.

     I really appreciate for your telling.
    Thank you very much.


    Kimura

  • Kimura,

    I'm glad the macro works in your installation.

    Regarding the number of digits after decimal: this parameter can be changed in the application options, File | Options | Display Page, Formats group. The default value is 3, but you can change it to any other value, e.g. 6, if necessary:



    Yuri 
  • Hello Yuri,


    Thank you for telling how to set up the display of the digit less than decimal point.
    From now,I'll set up it  if necessary.


    Kimura

  • I solved it.
Sign In or Register to comment.