How to draw an AOI, dilate it, bring it back and measure color intenisty in the new AOI
Hi there,
I am running IPP 7.0 and I would need some guidance on transferring outlines to AOIs.
I have a fluorophore (green) that is staining in the close proximity of blood vessels (red). I would like to measure the intensity of the green color around the blood vessel and not all the green staining in a given rectangle that I might draw by hand around the vessel.
So I was thinking of the following algorithm:
- Draw AOI of the vessels (by hand or by using the red channel).
- Convert the AOI to an object
- Apply a Dilation morphological filer to the object so that its contour grows with the same number of pixels in all directions.
- Convert back the resulting object to AOI and overlay it on the original image
- Measure the green intensity in the new (dilated) AOI.
- Ideally I would like to substract the original AOI from the dilated one in order to analyze only the ring area around the vessel!
What I did until now was to (1) define first an AOI (freehand or by channel color), (2) convert the AOI to objects, (3) in the Count/Size menu Make Mask, and thus obtain a new image with my AOI as an object. (4) Next on this binary image I applied a dilate morphological filer and the mask grew eccentrically from the original outline with the same number of pixels in al directions. (5) I used the automated threshold (Count/Size) to select the dilated AOI, (6) then Count to generate an object, then (7) I saved the outlines of the object, and lastly, on the original image (8) load outlines. But here the problem is that I cannot make the measurement only inside the outline…
Please, if you have any ideas how this might work best, I would greatly appreciate it!
I am not so good with writing a macro but I can record it very easily in IPP once the workflow is working, so could you please direct me to menu commands?
Thanks so much from now!
Daniel
Answers
Thanks so much for your time!
Well, I think I am loosing a step somewhere and the final measurement is not done only under my AOI:
- I create a mask, I dilate it, select it based on histogram, count to generate the object, and then export outlines. On the original image I load the outlines:
- Then still on the original image I use a predefined color selection (saved as the RGB profile, it will be the same for all images) to highlight my green signal:
- The outline (mask) is not there anymore and if I select to measure area and density, it will measure everything and not only under my AOI:
I think somehow the object outline is not considered an AOI in the end...
Any thoughts on what am I doing wrong?
Thanks so much again!!!
Daniel
Dear Matt,
Please see a screen capture during the analysis (zip archive and inside a .webm movie).
I am selecting first the RGB profile of the green signal, then I am drawing the AOI, convert it to object and save the outlines. Then I import the outlines and make the measurements on the green profile defined in the beginning. In the end the objects are through the image and not only under the AOI.
What do you think now?
THANKS BIG TIME!!!
Daniel
Option Explicit
Sub fred()
ret = IpBlbMeasure()
End Sub
Dear Matt,
I have tried to use Measure instead of Count but now I only have one measurement, the full AOI!
Without this AOI, the green sampling tool selected a multitude of points in this region, so I am guessing the software does not use the color picker profile anymore, but just counts the average density and the full area of the AOI since I get only one measurement! Thus does it also count the red channel too because is a part of the RGB image below?
Please, would you be so kind to upload a movie capture with your desktop during the exercise? I am attaching an image here for this purpose. So the idea is to draw around a red vessel, dilate the profile, but then analyze the green color in this dilated ROI, and not the red! If possible I would not extract the green channel and I would work on the full RGB image to see how the algorithm is working!
Thanks so much for everything and please excuse me for my clumsiness :-)))
All the best,
Daniel