Home Image-Pro General Discussions

Region feature "heterogeneity"

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


  • 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()<br>&nbsp;&nbsp;&nbsp; Dim imgA As McImage = ThisApplication.ActiveImage<br>&nbsp;&nbsp;&nbsp; Dim mmData As MediaCy.Addins.Measurements.McMMData = imgA.MeasurementsData<br>&nbsp;&nbsp;&nbsp; If ( mmData Is Nothing OrElse mmData.Count = 0 ) Then Exit Sub<br>&nbsp;&nbsp;&nbsp; Dim mcregionsMeas As MediaCy.IQL.Features.McRegions = mmData.SubFeature(0).GetFeatures<br>&nbsp;&nbsp;&nbsp; If (mcregionsMeas Is Nothing) Then Exit Sub<br>&nbsp;&nbsp;&nbsp; Dim hetMeas As MediaCy.IQL.Features.IMcHeterogeneity = mcregionsMeas.mRgnHeterogeneity<br>&nbsp;&nbsp;&nbsp; Dim nIRng As Integer = CInt(hetMeas.IntensityRange)<br>&nbsp;&nbsp;&nbsp; Dim nIRngNew As Integer = InputBox("New Heterogeneity Intensity Range (%): ", "Hetrogeneity Range", CStr(nIRng))<br>&nbsp;&nbsp;&nbsp; hetMeas.IntensityRange = CDbl(nIRngNew)<br>&nbsp;&nbsp;&nbsp; mmData.ShowMeasurements(MediaCy.Addins.Measurements.McMeasurements.enumShowMeasFlags.smfShowAll) 'update results display<br>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.