Get number of ROI
Hello
I've got an image with several ROI on it which have been added to the features manager I want to apply the ROI's to a separate image 1 at a time in a loop. I've got code to perform the loop but I can't find a command to end the loop. Here is the code
Dim AddUp As Integer AddUp = 0 Do With Select.FeaturesManagerCommands.Apply(NewMacro) .Collection = 0 .Feature = 0 .Item = AddUp .Run(doc1) End With AddUp = AddUp + 1 Loop
I was trying to use the result of Feature to stop the loop but its always set to true. Is there another command I can put within the With statement or is there a way to get an ROI count so that I can use a For loop
Regards
David
0
Best Answer
-
Public Function GetItemsCount (collection As Integer, feature As Integer) As Integer Dim items As Object Dim f As MediaCy.IQL.Features.McFeatures Dim o As MediaCy.IQL.Display.Overlays.McGraphOverlay items = MediaCy.Commands.Features.FeaturesManager.Common.GetFeature(collection,feature) f = TryCast(items, MediaCy.IQL.Features.McFeatures) If f IsNot Nothing Then Return f.Count o = TryCast(items, MediaCy.IQL.Display.Overlays.McGraphOverlay) If o IsNot Nothing Then Return o.Count Return 0 End Function
0
Answers
-
Hi David,
The following function returns number of items in the selected collection/feature:
0 -
Hello Nikita
Works and even gives me the image overlays as well
Thanks
David
0 -
GetItemsCount function counts objects stored in the Features Manager and they are not from the active image.0
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