Is there a way to add object count from the data collector to a report?
I am using the data collector to aggregate measurements from multiple images to count enough objects for my statistics. I then want to create a report that includes an entry with the total number of counted object. I can get the data collector easily enough, but I'm not sure how to get a total count.
0
Best Answer
-
You could use the count summary, which is available for all these tables.0
Answers
-
Thanks, that's the ticket.0
-
I've been trying to add this value to a table so the report looks a little more elegant, but if I copy the summary field it copies the values, rather than the link to the data collector data. Is there any way to get a table with just the summary values without the rather inelegant "Region:Measurement:Diameter Max-Average:" prefix?0
-
The next Image-Pro Premier release will introduce an easier way to include measurements statistics in Data Collector and in reports for single images.In the more general case, in order to have full control over the layout of your data, and statistics specifically, you have the option of adding your own data to the report using "code behind" which consists of small macros that are used to drive the report.Your modified sample report is attached with an implementation of this approach which produces the table you were looking for.The code needed for this (included in the report, see code view) is as follows:
Imports System.Data Public Class arieh ' Statistics table Private _dataSet As DataSet Private _dtStatistics As DataTable Private Sub ThisReport_RefreshSchema(ByVal source As Object, ByVal args As MediaCy.Addins.Reporter.ReportEventArgs) Handles ThisReport.RefreshSchema ' Add new table for Data Collector statistics _dataSet = New DataSet _dtStatistics = _dataSet.Tables.add("Statistics") _dtStatistics.Columns.Add("Measure") _dtStatistics.Columns.Add("Value",GetType(Double)) args.Report.DataSources.Add("Data Statistics",_dtStatistics,_dataSet) End Sub Private Sub ThisReport_RefreshData(ByVal source As Object, ByVal args As MediaCy.Addins.Reporter.ReportEventArgs) Handles ThisReport.RefreshData ' Fill new data table If _dtStatistics.Rows.Count=0 Then If args.Report.DataSources.Item("Data Collector") IsNot Nothing Then Dim dsDataCollector As DataSet = args.Report.DataSources.Item("Data Collector").DataRoot If dsDataCollector.Tables.Contains("Measurements") Then Dim dtMeasurements As DataTable = dsDataCollector.Tables.Item("Measurements") _dtStatistics.Rows.Add("Diameter Max (Average)", dtMeasurements.Compute("Avg(mRgnMaxDiameter)","")) _dtStatistics.Rows.Add("Diameter Mean (Average)", dtMeasurements.Compute("Avg(mRgnMeanDiameter)","")) _dtStatistics.Rows.Add("Diameter Min (Average)", dtMeasurements.Compute("Avg(mRgnMinDiameter)","")) _dtStatistics.Rows.Add("Roundness (Average)", dtMeasurements.Compute("Avg(mRgnRoundness)","")) _dtStatistics.Rows.Add("Roundness (Max)", dtMeasurements.Compute("Max(mRgnRoundness)","")) _dtStatistics.Rows.Add("Object Count)", dtMeasurements.Rows.Count) End If End If End If End Sub End Class
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