CODE to determine whether a MEASUREMENT OBJECT is completely (or partially) within an ROI?
2019-03-27-135924
All --
Lets say there are two RECTANGULAR ROIs within an IMAGE and 10 CIRCULAR MEASUREMENT OBJECTS in the SAME IMAGE. The MEASUREMENT OBJECTS were not generated with a COUNT and are not necessarily inside or outside of the ROIS.
Is there a way for CODE to SELECT the MEASUREMENT OBJECTS that are completely (or maybe partially) within one of the ROIs or perhaps completely (or maybe partially outside all of the ROIS?
I can do this with MASKS but it will be a multi-step process and it will be clunky. I am hoping there is some kind of comparison function that will do this efficiently.
Thanks in advance.
0
Best Answers
-
Hi Matt,
Yes, it can be done, but you should use measurement objects, not ROIs.
Here are the steps:
1. Create your RECTANGULAR objects as measurements of Class 1 (you can convert them from ROIs using Features Manager).
2. Activate Class 2
3. Add 10 CIRCULAR MEASUREMENT OBJECTS.
4. Use "Parent" measure to get parents of circles. The circle, which CENTER is within a rectangle will have Parent, circles outside - no parent.
Yuri0 -
Matt,
Image-Pro has other ways to filter out existing measurement objects. For example, you can set and Apply Filter in Data Histogram.
Yuri0
Answers
Regarding Edit Range: when you open it it tries to apply current segmentation method to the image. If you created all your objects manually, it may have unpredictable results. In short: Filter Range is used only for automatically segmented objects, and it cannot not be used with manually drawn features, as you have also pointed out.
Yuri