Region feature "heterogeneity"

Can you provide a more detailed explanation of the region feature, Heterogeneity? Can the user adjust the intensity range deviation?

Answers

  • Region Heterogeneity is the percentage of pixels in a region for which the monochrome intensity differs by more than +/- IntensityRange  (a percentage of full intensity range for the image's pixel type) from the the mean intensity (Intensity, Mean measurement).  The IntensityRange default value is 10% of the image RangeMax-RangeMin.  Unfortunately, this parameter is not currently exposed in the user-interface.  And so far I haven't been able to think up a practical way for a user to change it, but I'll post a solution if I come up with some way to do it.

  • Here's a macro that will update the Heterogeneity measurement with a new IntensityRange:

    Public Sub SetIntensityRange()
        Dim imgA As McImage = ThisApplication.ActiveImage
        Dim mmData As MediaCy.Addins.Measurements.McMMData = imgA.MeasurementsData
        If ( mmData Is Nothing OrElse mmData.Count = 0 ) Then Exit Sub
        Dim mcregionsMeas As MediaCy.IQL.Features.McRegions = mmData.SubFeature(0).GetFeatures
        If (mcregionsMeas Is Nothing) Then Exit Sub
        Dim hetMeas As MediaCy.IQL.Features.IMcHeterogeneity = mcregionsMeas.mRgnHeterogeneity
        Dim nIRng As Integer = CInt(hetMeas.IntensityRange)
        Dim nIRngNew As Integer = InputBox("New Heterogeneity Intensity Range (%): ", "Hetrogeneity Range", CStr(nIRng))
        hetMeas.IntensityRange = CDbl(nIRngNew)
        mmData.ShowMeasurements(MediaCy.Addins.Measurements.McMeasurements.enumShowMeasFlags.smfShowAll) 'update results display
    End Sub 'SetIntensityRange

    You will need a reference to Extensibility and MediaCy.Addins.Measurements in your macro references.

    Unfortunately, the new IntensityRange will not persist when a new Count is done, so this is only useful for exploring how the parameter affects the measurement result.

  • thank you for the code. very helpful
Sign In or Register to comment.