Home Image-Pro General Discussions
Options

Calibration of MASK images . . .

All --

I've noticed something that seems a bit odd.

If IPP904 takes a CALIBRATED ORIGINAL IMAGE (in say 'mm') and a COUNT is done and then a MASK is done, the resulting image inherits the same calibration (in this case mm) as the CALIBRATED ORIGINAL IMAGE.

If IPP904 takes a CALIBRATED ORIGINAL IMAGE (in say 'mm') and the THRESHOLD TOOL (from the SELECT RIBBON) is used to designate a RANGE then a MASK is made from within the THRESHOLD TOOL, the resulting image is UNCALIBRATED (in 'pix').

Is this behavior intentional?

Thanks.

-- Matt

Best Answers

  • Options
    Answer ✓
    Matt,

    This may be a bug, maybe Yuri will have more details. In any case it's not really an automation issue so I am moving it to the Premier General Discussions.

    Pierre
  • Options
    Answer ✓
    Yes, it's a bug and will be fixed. For now, if you use a macro, you can just assign spatial calibration of the original image to the mask:

            mask.SpatialCalibration = image1.SpatialCalibration

  • Options
    Answer ✓
    Matt, The code looks good. The way you can save a line is to assign the calibration on line 13 ThisApplication.ActiveImage.SpatialCalibration=Image1.SpatialCalibration, unless you need Image2 down in the code. Yuri
  • Options
    Answer ✓
    The assignment ThisApplication.ActiveImage.SpatialCalibration=Image1.SpatialCalibration will work fine even after the fixing the mask calibration, so you won't have to change anything later.

Answers

  • Options
    Pierre and Yuri --

    Thank you for your prompt replies.

    Pierre --

    I'm writing a macro that creates a MASK using the THRESHOLD TOOL before the COUNT gets a chance to do its job so I'll have to have the macro carry the calibration from the ORIGINAL IMAGE to the MASK IMAGE so that I can do a CALIBRATED COUNT.

    Yuri --

    I worked up a method to do this but it takes about 20 lines of code.

    I'll try to implement your suggestion.

    -- --

    Thanks again.

    -- Matt

  • Options
    Yuri --

    Here is my successful attempt to implement the advice that you gave me on this topic.

            'Call the routine that will select the original image
            Call SelectOriginalImage
    
            'Learn the information about the current image
            Dim Image1 = ThisApplication.ActiveImage
    
            'Call the appropriate routine based on the checkboxes in the SETTINGS for MAKE MASK IMAGE
            If (radiobutton1.Checked = True) Then Call MaskBright
            If (radiobutton2.Checked = True) Then Call MaskDark
            If (radiobutton3.Checked = True) Then Call MaskManual
    
            'Learn the information about the current image
            Dim Image2 = ThisApplication.ActiveImage
    
            'Transfer the calibration information from the original image into the mask image
            Image2.SpatialCalibration = Image1.SpatialCalibration
    Thank you for pointing me in the right direction.

    If there is a more elegant way to do this, please let me know.

    Thanks again.

    -- Matt



  • Options
    Yuri --

    I see what you mean about

    ThisApplication.ActiveImage.SpatialCalibration=Image1.SpatialCalibration

    eliminating the declaration and initialization of Image2.

    Thanks.

    -- Matt
  • Options
    Yuri --

    A related question . . .

    Once the CALIBRATION issue is resolved relative to the way the mask is being made, this step will not be necessary.  Would it work to test for this with something like

    If (ThisApplication.ActiveImage.SpatialCalibration<>Image1.SpatialCalibration) then
            ThisApplication.ActiveImage.SpatialCalibration=Image1.SpatialCalibration
        End if

    I don't think it will do any harm to carry the calibration across anyway but I'm just trying to learn what you can and can't do within IPP9.

    Thanks.

    -- Matt

Sign In or Register to comment.