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
-
Great!Thanks a lotBest,Friedrich0
-
Hi Yuri,after I have converted the ROI into a measurement with the macro, I cannot move or enlarge or reduce the measurement with the selection tool. This also happens when I try the first method described with the feature manager.Best,Friedrich0
-
Hi Yuri,yes, the measurement was locked. I enlarged the code with:
md.UnlockObjects(True)
ThanksBest,Friedrich0
Categories
- All Categories
- 961 Image-Pro v9 and higher
- 9 Image-Pro FAQs
- 18 Image-Pro Download & Install
- 448 Image-Pro General Discussions
- 486 Image-Pro Automation (Macros, Apps, Reports)
- 20 AutoQuant Deconvolution
- 2 AutoQuant Download & Install
- 18 AutoQuant General Discussions
- 195 Image-Pro Plus v7 and lower
- 3 Image-Pro Plus Download & Install
- 106 Image-Pro Plus General Discussions
- 86 Image-Pro Plus Automation with Macros
- 19 Legacy Products
- 16 Image-Pro Premier 3D General Discussions
- 26 Image-Pro Insight General Discussions