Convert ROI into Measurement
Hallo,
I am looking for an easy way to convert ROIs in Measurements. Because I know there is a simple way to convert Measurements into ROIs. Like:
<div>Private Sub ConvertMeasurementsToROIs()</div><div> Dim imageA as McImage=ThisApplication.ActiveImage</div><div> Dim md As Mediacy.Addins.Measurements.McMMData=imageA.MeasurementsData</div><div> If md.SubFeatures.Count=0 Then Exit Sub</div><br><div> 'get McRegions from the first features</div><div> Dim rgns As MediaCy.IQL.Features.McRegions=TryCast(md.SubFeatures(0).GetFeatures,MediaCy.IQL.Features.McRegions)</div><div> If rgns IsNot Nothing Then</div><div> 'create ROIs from measurement features</div><div> imageA.Aoi.CopyFrom(rgns)</div><div> End If</div><div><span>End Sub</span></div>
Thank you in advance
Best,
Friedrich
0
Best Answers
-
Hi Friedrich,
You can do it using the Features manager (Select tab). Add ROIs to feartures manager and put it on the image as Measurements:
Or, if you want to do it using a macro, use this code:Public Sub ROIsToMeasurements Dim im As McImage = ThisApplication.ActiveImage Dim md As McMMData = im.MeasurementsData md.AddFeaturesAsManualMeasurements(im.Aoi.Duplicate) 'optionally cleanup ROIs im.Aoi.Reset End Sub
Yuri0 -
Hi Friedrich,
The measurements could be locked, to unlock them:
1. Ensure that the Filled option of the measurement outlines is off:
2. Unlock the objects in the Select group dropdown:
Regards,
Yuri
0
Answers