I have not seen many images, but IF aneurysms are characterized by a balloon-like shape, we can use HOG to detect them. HOG stands for Histogram of Oriented Gradients. In a region around the center of the balloon, all gradients are oriented towards the center, i.e. every angle is equally represented. In the center of a tube, gradient directions come from only two opposite angles.
We only need to evaluate the pixels that are in the center of the vessel/balloon. You can do that as follows:
- Take the segmentation
- If the vessels are white, compute the Distance Transform from black.
- Apply a Local Max to the Distance Transform.
- If pixels in the Distance Transform have the same value in the Local Max image, they are in the center of the vessel/balloon
- For each of those candidates, create a histogram of gradient angles. Lets try a 15x15 local neighborhood, and a bin-size of 30 degrees (12 bins). Compute the standard deviation of the histogram. the candidate with the lowest standard deviation would be the center of an aneurysm.
I tried it on the original image (not the segmented one, because it only has gradients at the borders), and it works nicely.
In the attached image, your segmentation is pure Green, the Frangi-filter segmentation pure Blue, and pixels that have a gradient-norm higher than 20, AND have the highest gradient in a 3x3 neighborhood, are pure Red. All other colors are overlaps of those three channels. You can see that the Frangi-filter preserves more details, that your segmentation shrinks most of the vessels, and that Frangi has difficulties where vessels branch.
For the first link and regionprops() function.... it didn't work for segmented vessel image... because we have only one component in the image which is the whole vessel tree.
For the second one, the page didn't open.
For the third one, I'll try and inform you with the result.
I managed to solve a similar problem once, by detecting and extracting the soma (body cell) from 2D binary images from neuron cells. To accomplish that, I used a non-linear filtering approach known as Mathematical Morphology, specifically the Morphological Opening operator. You will find good explanations here: http://goo.gl/aN6ocG
The good news is that there is an available good Mathematical Morphology toolbox implemented for Matlab from the authors of the aforementioned book here: http://www.mmorph.com/mxmorph/html/morph/mmopen.html
The Lambert Zijp's suggestion is a nice idea. In a same manner, Binary Watershed algorithm uses the distance transform first ("bwdist" command). It is easy to used and powerful for segmentation, especially when the sac is connected to the vessels (you can run the Matlab example for "watershed" command). Generally this method segments the objects in an unsupervised manner. Then, you need to define some criteria, such as size, circularity, ... to identify the sac. In addition, based on the shape of sacs in your images it is important to select the proper distance transform. Sometimes chessboard has better efficiency than Euclidean distance. In this regard you can take a look at this paper:
If you know the range of sizes of the vessels, you can also use multiscale tensor analysis to distinguish between the tubular part of the vascular tree, and the "balloon" part. The relation between the tensor components are different for these two parts, and you can distinguish them pretty much directly. Google "vesselness" and you'll find many existing code implementation.
If you have several images you would like to share, please do so; it helps.
You can also look for mathematical models of tubular structures. There have been in the past several approaches including cylindrical and superellipsoidal models for 3D structures (vessels and neuronal dendrites). A 2D image is obviously a simpler problem.
Regarding morphological operations, these are mostly trial and error based and may work for some images but not for others.
An easy way to go for it is to "skeletonize" the tube (find the medial axis). From there you can trace the vessel down and estimate local widths.