measurement in an ROI
I want to count thresholded cells inside a free drawn ROI and get 'count per unit area.' I can threshold the cells and draw the ROI but I don't know which measurement parameters to use - I can't find the ROI area.
0
Answers
The ROI Area is not reported directly. If you use a macro you can get ROI area using the following line:
Public Sub PrintROIArea Debug.Print ThisApplication.ActiveImage.Aoi.mRgnArea.Sum End Sub
There is also a way getting this area from Percent Area measurement.
Regards,
Yuri
I took a bit of time this (FRI) AM and created a PREMIER PROJECT that performs the TASK that you described in your question.
I have packaged this into an IPX FILE and attached that file as
Demo-2016-11-04-094836.ipx
The PROJECT consists of two files:
Demo-2016-11-04-094836.ipp
Module1.vb
The CODE for MODULE1 is shown below with the DEPENDENCIES that are needed.
The DEMOMACRO FUNCTION within MODULE1 contains code to:
'Declare LOCAL VARIABLES
'Set up ERROR HANDLING
'Connect with IMAGE
'Clear MEASUREMENT LIST
'Activate AREA MEASUREMENT
'Set APPLY FILTERS to OFF
'Learn OBJECT COUNT
'Learn CALIBRATION INFORMATION
'Learn AOI AREA (using Yuri's example + a mechanism for NO ROI)
'Calculate OBJECT DENSITY
'Create RESULTS STRING
'Display RESULTS STRING in OUTPUT WINDOW
'Send RESULTS STRING to CLIPBOARD
This FUNCTION will handle the ERROR CONDITIONS (No Objects, No ROIs, No Calibrations) that seemed to be appropriate.
This FUNCTION will also put the RESULTS STRING in the PREMIER OUTPUT WINDOW and on the WINDOWS CLIPBOARD (so they can be pasted into WORD, EXCEL, etc.).
I have also attached a SCREEN CAPTURE as
2016-11-04-113147.jpg
That shows the general configuration and operation of this PROJECT and the appearance of the RESULTS STRING when PASTED into EXCEL.
*-*-*-*-*-
!!! PLEASE NOTE !!!
I have just realized that I goofed on the UNITS for DENSITY!
I did not include the "^2" to make the DISTANCE UNITS into AREA UNITS.
I'm sure you can resolve this if you use this CODE.
*-*-*-*-*-
I hope this information is helpful.
-- Matt
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-