Line Profile
Hello
I'm writing an automation which measures the peak to peak distance in a binary image. I can measure the distances without problem, however I cannot access the data from the Line Profile table for measurements I use the following code
Dim data1 As McMMData With measure.MeasurementsCommands.GetData(Nothing) .Run(ThisApplication.ActiveImage, data1) End With With ThisApplication.Output For Each sf As McMMSubFeature In data1.SubFeatures Area = sf.Value(eMeasures.RgnArea) Next End With
but when I try the same thing using LineProfileCommands as below there is no GetData option. Is there another command to use instead
With measure.LineProfileCommands.??? End With
Any help appreciated
Regards
David
0
Answers
Hi David,
The Line Profile measurements table is not exposed directly, but you can “collect” this table with the Data Collector (select data provider: Line Profile, Edge Measurements). After the data collected in the Data Collector use the macro to retrieve the Edge Measurements table.
Hello Nikita
Still doesn't really help as I'd already tried to get the data from the data collector itself using the macro posted by Yuri (Programmatically extracting data from data collector) I can get yours and Yuri macro to give me the table names but no data and there is definitely data in the data collector and in the Line Profile data table.
The macro by Yuri does appear to cycle through the rows and columns held in the data collector but the only meaningful output is the column name the only other output is NaN or 1. So unfortunately I'm still confused.
Regards
David
David, this macro configures Data Collector to collect Line Profile Peak-Peak measurements.
Hello Yuri
Your testdatacollector script doesn't work at all. It causes an instant crash when I try to open it in the project explorer, I've never got it to the point of running. I've tried downloading it again so presumably the file is corrupt, can you post it again and I'll have another go
Dave
Hello Yuri
That worked in that it found and printed out all the measurments from the thresholded and counted image. Still not sure how to get it to switch table to show the line profile data but I'll persevere now that you've given me some code to get me started.
Dave
and to get column:
Yuri
Thanks Yuri/Nikita
This seems to work, I just need to refine it a little for my app
David