Home Image-Pro General Discussions

I need a one button solution for calirating up loaded files from another source.

I load a lot of 1,000x images from SEM (FEI) that come to Premier as uncalibrated.  That's expected with proprietary tags.  But I'd like to select all the up loaded images and apply a calibration without having to do each one individually. Or have a function like global that applies a calibration to all images that are opened.

Best Answer

  • Answer ✓
    Another solution would be to assign System calibration to every loaded image automatically. System calibration is selected in the Characteristics group  (be sure that Spatial Calibration combobox is visible in the Characteristics group).
    Just load the attached project and all newly loaded images will get calibrated.

    Yuri

Answers

  • Hi wmallory,

    This macro calibrates all open images:
        Public Function Calibrate_All_Open_Images() As SimpleScript
            Calibrate_All_Open_Images = New SimpleScript
            Dim var1 = "CALIBRATION_NAME", spcal1
    
            With Measure.Calibration.SpatialCommands.Define(Calibrate_All_Open_Images)
                .Run(var1, spcal1)
            End With
    
            With Automate.ScriptingCommands.CodeCommand(Calibrate_All_Open_Images)
                If .Run() Then
                    ' User Code Here
                    If spcal1 IsNot Nothing Then
                        For Each doc As IMcDocument In .Application.Documents.Values
                            With Measure.Calibration.SpatialCommands.Apply(Calibrate_All_Open_Images)
                                .Run(doc, spcal1)
                            End With
                        Next
                    End If
                End If
            End With
        End Function
    
    All you need just to change the calibration name in the code.
    
    Thanks,
    Nikita.
  • I noticed that the project in my previous post contained a wrong path to Module1.vb file. It's corrected in the attached project.
    And one more note: Spatial Calibration combo can be added to the Characteristics ribbon activating Spatial Calibration checkbox on the Applicaton page of the Application Options dialog (File | Options).

    Yuri
Sign In or Register to comment.