Measurements to ROI
Hello
I have a ring measurement which I apply to other images however I also want to be able to threshold within this ring measurement when I apply it to other images. To do this I need to be able to convert it to an ROI, this is easy for a standard measurement and can be done in the features manager but it doesn't work for my ring measurement as it has an inner line and an outer line (doughnut). Is there any way to convert this type of non standard measurement to an ROI either manually so that the code can be recorded or any existing code.
Regards
David
0
Best Answer
-
Hi David,
Features Manager doesn’t support all measurement variations. In order to convert "Donut" measurement into ROIs you need to call Convert Holes macro and then use Features Manager.
Convert Holes macro converts “holes” into regular measurement.
Public Function Convert_Holes() As SimpleScript Convert_Holes = New SimpleScript Dim doc1, meas With Application.DocumentCommands.Active(Convert_Holes) .Run(doc1) End With With Measure.MeasurementsCommands.GetData(Convert_Holes) .Run(doc1, meas) End With With Automate.ScriptingCommands.CodeCommand(Convert_Holes) If .Run() Then ' User Code Here Dim m As MediaCy.Addins.Measurements.McMMData Dim f As MediaCy.IQL.Features.McRegions m = TryCast(meas, MediaCy.Addins.Measurements.McMMData) If m IsNot Nothing Then For Each f In m.GetMcFeatures( McMeasurements.enumMMFeatures.mmfRegions) If f.Holes.Count > 0 Then f.Merge(f.Holes) End If Next End If End If End With End Function
0
Answers
Hello Yuri
I've had a look at the code and I see that f.Merge(f.Holes) is where the donut is created but I cannot use it. The count still remains for the whole donut and if I try to threshold and then count it does it on the whole image rather than the bit inside the donut. Where does the shape made by f.Merge appear as its not in the feature manager so I can't apply it.
Regards
David