Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

using IMAQ for segmentation in an ultrasound image

Greetings, apologies if this is a vague/basic question, I am somewhat new to Labview and completely new to image processing within it.
 
I have been thrown onto a partially-completed project in which one step is that the cross section of a blood vessel must be located in an ultrasound image.  It is not so important to get the borders exactly right (a circular/oval approximation is sufficient), but it has to reliably find the general location of the vessel which is no mean feat even for the naked eye (ultrasound images are characteristically noisy and grainy).
 
The way my predecessor has done it so far is by using a template image of what such a cross section should look like, and using Color Pattern Match to find it, after which an oval is just drawn on the image to show the basic borders.  This does very well when using a phantom (test setup) but in actual in vivo images it is not so successful, and sometimes finds "vessels" in other tissue.
 
My questions:  Is this an appropriate approach to trying to accomplish such segmentation, that can be fine-tuned using different parameters?  Are there other functions, like Extract curve, which might be useful?  Is there a way to look at the process and make it a little less black box-y?  I understand that is an appeal of Labview, but I perusing the online help doesn't really offer any hints at how it does its pattern matching.
 
My first alternative will be to try to implement some sort of active contour approach to approximating the blood vessel borders, but I would rather not go barking up a different tree if this first one is the right one!
 
I appreciate any input, and can dig around for a good example image if anyone is interested/willing to help but needs more info.

Message Edited by JJoe on 03-05-2007 03:42 PM

0 Kudos
Message 1 of 9
(4,156 Views)
JJoe--

      There is definitely some parameters that you can tune when using pattern matching.  On the block diagram, there should be a place where the pattern match is applied, the name of this VI is IMAQ Match Color Pattern. So right before this look for a IMAQ Setup Match Color Pattern, this will have all of the parameters that you can change.  A couple things to help out.  If you go to the help menu and select context help (or push ctrl-H) you can easily find out which VI's are where on the block diagram. Furthermore, there is a link to even more detailed help on each particular VI.  I would suggest looking at this help for the Setup Pattern Match VI.  You can make controls or constants and modify these and that might help a bit.

      That may help the sensitivity a bit; otherwise, there are plenty of other things you can try out.  One might be to try to "Find Circular Edge" which is a VI that you can use.  Then you could do an ROI and extract just the part you are interested in and do a pattern match on that.....or just draw a circle based on the results of the find circular edge.

      I would suggest taking a look at the relevant examples.  LabVIEW ships with lots of example programs. When you are looking at the detailed help at the bottom of the page it will tell you which examples are relevant.  For color pattern matching there is an example named roughly this. For finding circular edges there is an example named battery clamp inspection.  In the example finder just browse to the tookits and modules folder and look for vision.

     These should give you a few places to look for more information and a few other things to try.  Let us know if you have any other questions.

Regards,

John H
National Instruments Applications Engineer
   
0 Kudos
Message 2 of 9
(4,123 Views)

I did a little bit of work on ultrasound images on veins, but we weren't able to accomplish our goal.  Your goal sounds much simpler, though.

If you could post a few example images, that would be very useful.  I might be able to suggest some processing to isolate the veins.

I have doubts that pattern matching will work.  There is not a distinct pattern to look for in an ultrasound image.

What kind of speed do you need in the processing?  Does it need to run on a live video image?  Could you live with a few frames per second?

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 3 of 9
(4,121 Views)
Thank you both for your responses.  I will take a closer look at the .vis and helpfiles John suggested.
 
Bruce:  From an initial look I do agree.  I think one fundamental problem with trying pattern match alone is often you need to look at movement in the images (either internal or simply by the probe) to identify what you're looking at (from my limited ultrasound experience).   I found my way to the concepts manual, where the examples of color pattern matching fighting through blurriness and changes in lighting don't really compare to the ambiguity in ultrasound images, where the vessel shape and surrounding tissue change quite drastically.
 
Right now the approach is to maintain a library of possible vessel appearance templates, and go down the list until we find one that gives a good match in the image.  The library is currently only 3 templates deep, but would probably have to grow quite significantly as we move to in vivo
 
I've attached an image of the rubber-tube phantom we have, which is very nice for such tracking. I think the inside-water has a lot of contrast agent in it as well in this image, which gives it its solid appearance.
 
In the in vivo image, the artery is the "hole" with the two chunks of blue which are Doppler signals from the fluid motion (for the US uninitiated).  I may be able to work in the Doppler effect to identify the vessels, but it because of the heart-beat it is far more inconsistent than the actual physical features.
 
Speed is not too much of an issue I believe.  This program will also be controlling the probe location so it doesn't need to keep up with someone else moving the images around, and while the probe is still I don't believe it would be too much of an issue if we only grabbed the occasional frame.
 
Thanks all for your input, figuring out whether this could be the right approach before digging too deep would save a ton of time!
 
 
Download All
0 Kudos
Message 4 of 9
(4,112 Views)

Your phantom image doesn't really look anything like the invivo image, so I wouldn't try to develop any routines using it.

Are you always looking at a cross section of the vessel, where it is roughly circular?  That will be helpful.  In the work I did earlier, we were trying to look along the length of the vessel.

The doppler may be the most promising part of the image.  It appears that that is the only colored item in the ultrasound portion of the image, so it would be very easy to detect quickly.  After locating the doppler, you could probably search outward for the edges.

I would consider taking a sequence of images, perhaps 1 to 2 seconds, where you are sure to see the doppler.  Analyze each one, and keep the one with the largest colored area, then locate the edges of the vein.  Analyzing the image in the HSL domain may simplify things.

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 9
(4,103 Views)
Good suggestion.  Yes, hopefully we can keep on getting tranverse slices of the blood vessel so they should stay circular which makes things much simpler.  The quirk of these blood vessels is that they do bleed sometimes making a mess on the Doppler image, but perhaps that can be overcome by looking for the circular shape of uniform color, over a longer period of time rather than trying to look for the physical vessel first.
 
I will not abandon hope on fixing this up, then.  Thanks again!
0 Kudos
Message 6 of 9
(4,095 Views)

Alternatively you could think of averaging some (2 to 5, optionally weighted) sequenced images. The noise will change from image to image whereas the blood vessel will remain in almost the same location. Thus you might find some contrast between vessel and tissue. In practice the US head will be moved. So taking a lot of images for averaging is not the best idea. A least the contributing weight should be choosen appropriately. But if the blood flow is examined the US head must remain in the same location for a longer time. There is a good chance to find the vessel from doppler or averaging many images.

The effect of averaging you can experience from looking at a live US and compare it to an still image. The still image looks more noisy than the video. Your brain is filtering the noise.

0 Kudos
Message 7 of 9
(4,075 Views)

Hi,

I have no experience of ultrasound, so excuse my ignorance...

Is it possible to have no doppler overlay on the image and if so, does the blood vessel show up as dark? If so you could threshold the image to give you only the dark areas, then use blob analysis and filter the blobs on size and circularity to give you only objects that are smaller than a maximum limit, larger than a minimum limit, roughly circular,etc.Just looking at the image I would guess this would work, but with this kind of thing you can't be sure (well I can't, anyway). What you'd need to do is get a reasonable number of different images and then tweak your filters so they work on all of them.

Cheers,

Mike

 

 

 

 

0 Kudos
Message 8 of 9
(4,064 Views)
Wonderful.  Thank you for all the suggestions folks.  Will have plenty to play with, after which I'll hopefully be equipped to come back and help someone else.
0 Kudos
Message 9 of 9
(4,051 Views)