Wednesday, September 27, 2006

Determining local maximas and saddle points of an EDT

I am still studying this paper (left atrium segmentation by cutting blood pools at narrowings) and looking to see if some of the techniques can be adopted and implemented. The blood pool is cut at narrowings which are saddle points. After studying the atrium for sometime now it seems its safe to assume that the atrium is connected to the extra cardiac structures (such as the aorta) by narrow blood vessels. This is the narrowing we are after. Our segmentation step should be able to identify these narrowings. However, saddle points can only be calculated once the local maximas are determined.

Computing saddle points is not trivial. In the mathematical world, saddle points in 3D are points where a function is both convex and concave, on any two chosen direction. For a continuous function, this can be determined by computing the Hessian matrix (matrix of partial derivatives) and checking if the eigen values of the Hessian are both positive and negative. A good summary is given here.

However, in our 3D graphics world, the saddle point can be determined using an iterative algorithm which examines a neighborhood of pixels (26, 14 neighborhoods). As the paper states, a voxel v is a saddle point if in its neighborhood one can determine two voxels v1, v2 which have a scalar values larger than that v, and these voxels are separated from one another by a ring of voxels with smaller values than v1 and v2 .

I was also able to complete designing an Euclidean distance transform (EDT) tool which computes the EDT for each voxel, given a roughly-segmented atrium. I am visualizing and anlyzing the EDT results to see where the local maximas and saddle points actually occur, and if they are of any real significance in segmenting the atrium.

Here's an example of a z-slice I extracted off an EDT I computed over a segmented dataset. What you see in the image below is a certain z-slice of the segmented-MRI showing the EDT values. I have roughly pointed out where these values occur. Notice how the large EDT values indicate a local maxima (major heart structures) and the narrow blood vessels connecting these structures have a low EDT indicating saddle points.


Some non-PhD stuff: Firefox memory leak and Google analytics

I love Firefox. It allows tabbing and seems quite lightweight when compared to IE. But sometimes Firefox can be a pain. On my computer, sometimes it starts taking up a lot of memory for some reason. This is a known memory leak issue, and there is a fix for this. Look here, you can assign a certain amount of allocated cache memory for firefox.

Another interesting piece of software i came across is Google Analytics. It provides useful visitor information for your website. For e.g. if a visitor is a new or a returning visitor, the total number of visitors on a certain day and even the geographical location of your visitors. It displays all these information in a nice way (pie charts, line graphs, world-map display). Try it out . If you are a Google fan, another product to try out is the Google calendar. It's like any electronic calendar with a special feature: for certain countries, you can set it so that a reminder is sent to your celll-phone via an sms. These reminders are sent out right before an event in your calendar. You can set whenthese reminders should be sent to you, for e.g. 15 minutes before an event is about to take place.

Tuesday, September 19, 2006

Euclidean distance transform tool

Recently I have been preoccupied developing an Euclidean distance transform (EDT) tool. Although ITK provides functions to do this; there is a need to be able to perturb the transformation parameters. A recent MICCAI 2005 paper on left atrium segmentation is my motivation for experimenting with this function. The authors of the paper have published an intuitive algorithm to segment the left atrium by cutting the blood pool at narrowings. The narrowings, I am hoping can be detected after performing the EDT. There is however a great deal of user-interactivity still required at this stage, for segmentation.

Sunday, September 17, 2006

Bounding boxes in manual segmentation

From my experience with manual segmentation, for a left atrium which has 4 PV branches, we need to define a minimum of 4 bounding boxes, with a seed-point in each bounding box. Region-growing segmentation at each of these bounding boxes are then merged together to give the final segmentation result.


Above is a dirty hand-drawn illustration of the bounding boxes together with the region they segment.

Manual segmentation results

I was trying to manually segment a left atrium, using the segmentation tool I have developed (C++/VTK/FLTK/ITK). The results are rather crude, and the segmentation is not that great. Here is a segmentation I obtained by segmenting parts of the atrium separately and stichting them together (performing a union of segmentations):


Each of the pulmonary trunks (4 in total for this atrium) have been segmented separately. Some of the trunks are over-segmented. It is very hard to tell sometimes where the trunks finish, whereby drawing out a bounding-box (for region-grow) which is bigger than it's necessary.

Here's a glimpse of a part of the tool I use:


The segmented result is super-imposed on the 3D volumetric view of the MRI scan which uses movable orthogonal slices. This is useful in locating deficiencies in the segmentation.

Saturday, September 16, 2006

So what does it mean to manually segment?

From most of the works I have read on medical image segmentation, researchers first aim to interactively manually segment training data sets. These segmented data sets are then possibly fed into a machine learning process whereby a model is produced. This model is then capable of recognizing unseen instances of its shape, thus fitting itself to the new instance. Fitting here means segmentation, since the model has fitted itself and segmented an instance.

This all sounds ok, but the manual interactive segmentation part leaves us thinking: is it that easy to manually segment all those training sets by hand?? That's the reason why we are trying so hard to create ways of automatically segment, since manual segmentation is so strenuous and time consuming. Although, it depends on the sort of segmentation tool you are using and your experience in segmenting that particular structure; this is definitely not trivial.

I think I would be wrong saying that manual segmentation is always difficult. For some structures it can be relatively easy, and in some cases quite trivial. For the left atrium, it's a nightmare. The main reason being: there are lots of other blood vessels or arteries which run over (for example) the PV drainages of the left atrium. The diagram below illustrates this:

This is a poorly hand-drawn mspaint illustration. The main point I want to bring out are the red vessels which run over the black-coloured bordererd left atrium and its PV drainages. If one were to use a segmentation tool which enabled the user to pick a seed point (starting point of the region-growing segmentation process), and define a bounding box that defined the boundaries of the region-growing process; it would be impossible to segment out the left atrium in one go. A careful and interactive segmentation is required, possibly taking a great deal of time, depending on experience and the segmentation tool's capabilities.

A technique which I tend to follow is to first start out with the core of the atrium. Once the core is segmented, I move out to the PV drainages, segmenting each PV drainage one at a time. This also requires me to define bounding boxes for each of these drainages, and possibly also sometimes changing the threshold levels. This is since, the blood intensity at the drainages tend to be a lot less (35-150) than that of the core of the atrium (typically 60-150). Before getting a properly segmented atrium, it takes on an average 10-15 steps of stichting (union of segmented results) and removing unwanted regions.

After a visit to the cardiologist, I learned that this is exactly what cardiologists do these days. They strenuously join pieces of the left atrium from a 3D rendering of an MRI scan. There seems to be an urgent need of an automatic segmentation tool for the left atrium.


Monday, September 11, 2006

Removing extra-cardiac structures

Segmentation of the left-atrium will usually yield connecting extra-cardiac structures. These could be parts of the ventricle and other vessels nearby (such as the aorta). Here is an image of what an initial segmentation would produce:


The structure crossed in red, is the left atrium. The red-outlined structure is presumably the aorta passing right infront of the left-atrium, which was segmented along with the left atrium, in the process of segmenting some of the atrial pulmonary vein drainage endings.

The cardiac structure attached to the left atrium was observed to be attached at points where the blood pool narrows down and opens up into the structure. However, it was also observed to be attached at points which are not narrowed blood pools. The image below is an attachment which is narrowed:



And the image below shows an attachment which is not narrowed.



This makes the removal of such post-segmentation artifacts non-trivial, although there is still a possibility of removing most of these by detecting blood-pool narrowings (M. John et. al. MICCAI 2005).

Saturday, September 09, 2006

Differing left atrial morphologies

The left atrium, like many organs of the body, comes in different sizes and shapes. They exhibit quite a wide range of differing morphologies. After reading through a medical journal paper by J. Sra et. al. I started to realize how complicated left atrial segmentation can get, due to its varying morphology. Sra's paper looks at 3D reconstructions of left atriums and down below is an image of three varying topologies:

The image on top is the 3D rendering of the left atriums, and the images below are the corresponding endocardial views. If we look the left and right pulmonary veins, we notice that there is a great degree of variation. The far-most left atrial image is what I would call the standard atrial configuration. The middle atrial image is what surprised me the most, and something I have never come across. The right atrial image is also unusual since it has a right middle pulmonary vein portruding out of the right panel.
The paper talks very little about segmentation, and seems more like a review of registration technique and how both segmentation and registration can benefit the medical community, especially in the treatment of cardiac arrhythmias. Total automated segmentation of the left atrium is still far from becoming a reality, and most segmentation techniques I have come across yet requires a great deal of user interaction.

Monday, September 04, 2006

Segmentation is not straightforward

Today i realized that it's not at all easy to segment the left-atrium, or be it any cardiac structure. I asked my PhD colleague, who's working on tongue segmentation, if it was easy to segment the tongue. From his experiences its neither easier to segment the tongue.

I attempted to draw out using ms-paint, an illustration of why it is difficult. The top two reasons are these:

  • Left atrium is connected to other cardiac structures by blood-vessels. The segmentation algorithm needs to be able to differentiate between these.
  • Sometimes, blood vessels (not connected to the LA) might pass over, or under the Left atrium. In an attempt to define a region-of-interest box, one might try to avoid the vessel, lets say, which passes on top of a LA vein. This would cause the box to define a region which is not sufficient and crops remaining part of the LA vein, which would have emerged out in further slices.
Here's my illustration:


There may be other segmentation methods (apart frm region-growing) which may be worth trying. There are deformable models such as Active contours or snakes, which ITK-Snap uses to segment its MRIs. However, all methods will require a great-deal of user-interaction, which is why I am doing my PhD.

Friday, September 01, 2006

Left atrium segmentation

It is quite a tedious process to segment the left atrium from an MRI, interactively, using a recursive-region growing segmentation algorithm. Small changes in threshold levels causes a major change in the segmented volume. The segmentation is performed within a region of interest (a user-defined cuboid). This ROI is the volume within which the human user thinks is where the left atrium is expected to lie by looking at the MRI.

I totally quite yet dont understand if we can assume whether the blood has filled the entire left atrium, in the post-angiograph. I suspect, frm initial segmentation results, that there could be parts where the blood hasnt completely reached the left atrium. However, this is total image acquisition issue. But a burning question, when is a post-angiograph taken? I can definitely confirm that I have seen post-angiographs where the radiocontrast-agent hasn't yet reached the left atrium. But I wonder, why is that the case? Shouldnt post-angiographs be taken when the patient has a complete circulation of radio-constrasting agent blood?

Following is what would be, my dream segmentation of the left atrium:



As you can see, the number of branches of the PV drainage branching out of this atrium is what makes our lives difficult, and thus giving people like us the opportunity to do a PhD.