Transfer or copy measured objects found within an image to another image (without feature manager)
There are two images loaded in Image Pro. In the first image a huge amount of objects found within (~1000000 objects). The measurements should now transfered to the second image to read out the intensity and so on. The feature manager does not show it when I try to add the measurements to the feature manager. I think because of the huge amount of objects. The only way I can do it now is to save it in a measurement results file and reload it to the second image.
Thanks in advance.
Is there a way to solve this programmatically?
Thanks in advance.
fsup
0
Best Answer
-
Hi fsub,
Transferring measurements from one image to another using IQM file is an acceptable solution, it also can be automated (just activate macro recording to see the commands).
Another option would be to use lower level code and transfer data between documents like in the macro below (Activate source image with measurements and run the macro, when prompted, click on destination image and measurements will be transferred).Public Sub CopyMeasurementData Dim srcDoc As IMcDocument=ThisApplication.ActiveDocument Dim md As McMMData=srcDoc.Data.MeasurementsData If md.Count=0 Then MsgBox("ActiveImage doesn't have measurements") Exit Sub End If Dim dstDoc As IMcDocument With Automate.ScriptingCommands.ClickOnWorkspace(Nothing) .Prompt = "Please click on destination document." .SelectDocuments=True .Run(Nothing, dstDoc, Nothing) End With Dim md2 As McMMData=dstDoc.Data.MeasurementsData md2.AddFeaturesAsManualMeasurements(md.GetMcFeatures()(0)) End Sub
Yuri0
Answers
thank you. I'll try your solution and give my feedback.