Thread Subject: Horn Detection in Leukaemia Images

Subject: Horn Detection in Leukaemia Images

From: Lee Borland

Date: 17 Feb, 2009 15:55:05

Message: 1 of 10

Hi all,

I have an interesting problem that is currently proving difficult to solve.

I have an image (http://i41.tinypic.com/10i71o2.jpg) containing leukaemia infected red blood cells. My task is to firstly detect and count the biconcave cells in my image, which I have done. The second is to detect the presence of horn like features (far left, bottom left). Following their detection, a count of the number of horns on each cell needs to be conducted.

Im struggling to complete this as the horns are all unique. Can anyone shed some light on this issue?

Thanks in advance for any help.

Subject: Horn Detection in Leukaemia Images

From: Image Analyst

Date: 17 Feb, 2009 16:39:01

Message: 2 of 10

Lee Borland:
Well you've done the hard part - finding and isolating the cells (not easy in this kind of image, particularly when the overlap). Now all you have to do is to analyze each cell for the perimeter squared divided by the area. This will distinguish between your cells with smooth boundaries and those with the "horns."
Good luck,
ImageAnalyst
P.S. Thanks for posting the image first.

Subject: Horn Detection in Leukaemia Images

From: Lee Borland

Date: 17 Feb, 2009 16:47:04

Message: 3 of 10

Thank you for your reply. I used CircularHough_SL, created by Tao Peng to detect my diameters.

Your advise is very helpful. Can you advise me as to how I would calculate perimeter and area? regionprops is it?

And this will detect the presence or my horn structures. Still undecided as to counting the number of horns present. Seems to me a difficult challenge.

Thanks again

Subject: Horn Detection in Leukaemia Images

From: ImageAnalyst

Date: 17 Feb, 2009 19:44:53

Message: 4 of 10

Lee Borland:
regionprops will give you the perimeter, area, and solidity. In a
loop, go through all the blobs examining the ratio (4*Perimeter^2)/
(pi*Area) and the solidity measurement. There will be some number for
smooth contour blobs, that will distinguish the two. For example the
ratio < 5 for smooth blobs and is > 5 for "horny" blobs. You may also
see some value were you can distinguish the two kinds of blobs based
on the solidity value.

If counting the number of blobs is important, then that's tougher
since not all of the horns appear on the perimeter - some appear in
the middle of the blob. If it were just the perimeter then you could
erode a few pixels (to get rid of horns) then dilate out a bit more
than you eroded and find the boundary of that (using bwboundaries).
That would give a line (the outline) a little bigger than the main
bulk of the blob and then you could run around this to see where a
horn intersected it. However you may still have horns on the back
side of the blob that you can't see so I'm wondering if you can't
really get what you need with out the horn count. Maybe it's not
necessary. If it is, you're out of luck since you can't see the back
side and getting the ones in the middle will be tough. You may have
to fall back to manual inspection where a user enters the number of
horns they see. And of course even this won't tell you how many horns
are on the back side and thus are unseen in the image, so you'll never
really have the true number anyway.
Regards,
ImageAnalyst

Subject: Horn Detection in Leukaemia Images

From: Pete

Date: 17 Feb, 2009 20:45:04

Message: 5 of 10

This looks tricky.

How well is your current detection working? And how automated do you need your analysis to be? If your project is to develop an automated method, it looks difficult but interesting. If your project is more concerned with using the results, a computer-assisted manual or semi-automated method might be a better option.

If you don't mind it being mostly manual, you could write something simple to allow you to click each horn / cell, leave a coloured marker there, then automatically count up the markers corresponding to each cell. I suppose that wouldn't necessarily be much better than printing each image and using coloured pens, except that you could automate the processing of the results or save them.

Somewhat more advanced would be to click each cell, then use a region growing / marker controlled watershed segmentation method to find the interior of the cells. I think at some point you will need a labeled image in which the interior of each cell has a separate label - only then can you use regionprops to do what Image Analyst describes. You can also trace the perimeter coordinates and look for abrupt changes in direction to try to detect the horns occurring on the exterior, although they'll need to be distinguished from overlaps...

If you can solve these problems, the step to full automation is simplified to a matter of finding a good centre point so the user doesn't have to click. But even without that analysis should be speeded up by a lot.

There are a lot of options, but the best one depends upon how deep into the problem you want to get...


"Lee Borland" <lborland01@qub.ac.uk> wrote in message <gnemko$pnv$1@fred.mathworks.com>...
> Hi all,
>
> I have an interesting problem that is currently proving difficult to solve.
>
> I have an image (http://i41.tinypic.com/10i71o2.jpg) containing leukaemia infected red blood cells. My task is to firstly detect and count the biconcave cells in my image, which I have done. The second is to detect the presence of horn like features (far left, bottom left). Following their detection, a count of the number of horns on each cell needs to be conducted.
>
> Im struggling to complete this as the horns are all unique. Can anyone shed some light on this issue?
>
> Thanks in advance for any help.

"Lee Borland" <lborland01@qub.ac.uk> wrote in message <gnemko$pnv$1@fred.mathworks.com>...
> Hi all,
>
> I have an interesting problem that is currently proving difficult to solve.
>
> I have an image (http://i41.tinypic.com/10i71o2.jpg) containing leukaemia infected red blood cells. My task is to firstly detect and count the biconcave cells in my image, which I have done. The second is to detect the presence of horn like features (far left, bottom left). Following their detection, a count of the number of horns on each cell needs to be conducted.
>
> Im struggling to complete this as the horns are all unique. Can anyone shed some light on this issue?
>
> Thanks in advance for any help.

Subject: Horn Detection in Leukaemia Images

From: Lee Borland

Date: 17 Feb, 2009 22:41:01

Message: 6 of 10

My current detection is working well on other images, see below:

http://i40.tinypic.com/1huu1e.jpg (a little overdetection)
http://i44.tinypic.com/34nrss2.jpg (perfect)

I have not yet attempted on the image attached in my original post as my attention has switched to the horn shaped objects. In terms of automation, I would like to aim for an end result of an automated process but as this is only a masters project and not a phd type researching post, i am happy to initially place importance on manual completion. I have thoughts in my head of my final result being incorporated into a GUI. Would you advise this?

I like your idea on perimeter / area, Image Analysist, thank you for that. Although it may seem crude, I really am attempting for a best estimation type result. For example, if i were to say count the horns in the cell centre, add to the horns found on the cell edge then double the result for the unseen rear of the cell.

I also like the click method. Although manual, it would indeed solve the issue. Can you advise me as to how I would attempt this? Once I finish clicking the horns I could have matlab then double the result, outputting a horn estimation.

What I am now unsure about is that in order to complete analysis in regionprops, I need to complete some segmentation and labelling. As you can see in the images above, I have avoided segmentation through Hough Transform circle detection. Prior to reaching this point i used watershed, blob analysis etc but it really did get tricky. Hough transform detection proved easier in the end. I suppose i'll need to go back to alternatives for horn detection.

Thank you both for your help.

Subject: Horn Detection in Leukaemia Images

From: Pete

Date: 18 Feb, 2009 06:56:02

Message: 7 of 10

If you happen to know Java pretty well and are willing to commit to the more manual option, you could check out ImageJ - which is freely available, making it easier to share your work. I've written ImageJ plugins to do a few semi-automated tasks - I prefer it to MATLAB for making nice user interfaces when the user will have to click a lot, but it is much, much easier and faster to design and test out more complicated new algorithms in MATLAB. In any case, there are lots of ImageJ plugins available for download on the website - they might at least give you some inspiration.

Unless I really preferred Java programming to MATLAB though, I'd probably stick with the latter because the fiddly and annoying problems of automated detection are usually more interesting than the fiddly and annoying problems of user interface design. If you have time, you can make a MATLAB user interface in GUIDE - if not, you can use functions like uigetfile to make things a bit easier for the user at the command line.

The functions getpts from the Image Processing Toolbox can be used to, well, get points. I guess you could prompt the user three times: once to click on normal cells, once to click on cells with horns, once to click on horns (assuming an average number of horns per cell is ok). You can overlay markers on the image using the line or plot functions.

getline would allow the user to draw around a cell instead.

The results on your detection images look pretty good, although I wonder how the other image would fare. My images (also cells, but different ones) haven't contained interesting features that are consistently enough shaped for me to rely on the Hough transform, but I didn't explore it for very long and maybe it is more powerful than I realise.

Maybe Image Analyst, or anyone else, has better segmentation suggestions. I briefly tested a couple of techniques I knew on your images, with the familiar result that they seem to almost worked well.... but, frustratingly, not quite well enough, because some of the borders between cells are quite indistinct.

Subject: Horn Detection in Leukaemia Images

From: Lee Borland

Date: 18 Feb, 2009 22:41:01

Message: 8 of 10

Thanks for the reply Pete. Im sorry to say, my coding experience in general is quite limited so I think I will have to stick to Matlab. The GUIDE seems quite intuitive though, Ive heard good things about it. Ive looked into uigetfile since you mentioned it aswell. Can you advise as to how I could make use this?

Hmmm...I think getpts could be the way forward here, will try tomorrow. I know what you mean about the cell borders proving difficult. Could I ask which functions you used? Just to compare the reults to mine. The Hough Transform actually suprised me with its detection powers, working well to date. Are you using alternative segmentation methods in your project?

Anyone else have segmentation suggestions? I can post the original versions of the images I have implemented the Hough Transform on if that would help.

Subject: Horn Detection in Leukaemia Images

From: Pete

Date: 19 Feb, 2009 09:38:01

Message: 9 of 10

Hi there,

I tried creating a gradient magnitude image after different levels of Gaussian smoothing to see how strong the edges looked... they are pretty good, but not all of the time. I also tried a wavelet transform in case it happened to make things any clearer. Then I tried thresholding, and some morphological operations. All of them provided interesting alternative ways to view the image, but none suggested (to me) a really straightforward solution.

The Hough transform surprised me too - it looks pretty good, but I wonder how you can take it further. It could perhaps suggest cell centres to use as seed locations for region growing.

I've sent you an email.

-----
Regarding the GUI stuff.... uigetfile just gives a slightly nicer way for the user to input a filename, rather than having to type it (and possibly the file path) at the command line.
[fname, fpath] = uigetfile;
im = imread(fullfile(fpath, fname));

There are other options in uigetfile that let you refine it a bit, such as applying a filter so that only files with valid (image) extensions are selectable.

Which is only really to suggest that if you don't have time for a full GUI, you can use functions like that to quickly make things a bit simpler for users who feel uncomfortable with controlling everything from the command line. You can also try dialog boxes, like
  n_cells = inputdlg('Input the number of cells');
although sometimes this can be more distracting than helpful.... and you'll need to deal with the possibility the user will enter something silly.... but that's for later.

Subject: Horn Detection in Leukaemia Images

From: Sven

Date: 21 Feb, 2009 05:01:18

Message: 10 of 10

"Pete " <pete.dot.bankhead@btinternet.dot.com> wrote in message <gngbe2$gg$1@fred.mathworks.com>...
> If you happen to know Java pretty well and are willing to commit to the more manual option, you could check out ImageJ - which is freely available, making it easier to share your work. I've written ImageJ plugins to do a few semi-automated tasks - I prefer it to MATLAB for making nice user interfaces when the user will have to click a lot, but it is much, much easier and faster to design and test out more complicated new algorithms in MATLAB. In any case, there are lots of ImageJ plugins available for download on the website - they might at least give you some inspiration.
>
> Unless I really preferred Java programming to MATLAB though, I'd probably stick with the latter because the fiddly and annoying problems of automated detection are usually more interesting than the fiddly and annoying problems of user interface design. If you have time, you can make a MATLAB user interface in GUIDE - if not, you can use functions like uigetfile to make things a bit easier for the user at the command line.
>
> The functions getpts from the Image Processing Toolbox can be used to, well, get points. I guess you could prompt the user three times: once to click on normal cells, once to click on cells with horns, once to click on horns (assuming an average number of horns per cell is ok). You can overlay markers on the image using the line or plot functions.
>
> getline would allow the user to draw around a cell instead.
>
> The results on your detection images look pretty good, although I wonder how the other image would fare. My images (also cells, but different ones) haven't contained interesting features that are consistently enough shaped for me to rely on the Hough transform, but I didn't explore it for very long and maybe it is more powerful than I realise.
>
> Maybe Image Analyst, or anyone else, has better segmentation suggestions. I briefly tested a couple of techniques I knew on your images, with the familiar result that they seem to almost worked well.... but, frustratingly, not quite well enough, because some of the borders between cells are quite indistinct.

Hi Lee,

Just a couple of suggestions that may improve your (already quite good) results using hough circle detection.
For the overdetection problem, I think you could tune things a little by looking at the radius of each circle that has been detected. It seems that you're generally getting up to 3 concentric circles:
1. The "inner" radius (I'm not sure if this is a required result or not)
2. The "outer" radius
3. Overdetected circles.
If it's safe to assume the cells in your image will all be around the same size, I think you could trim away the overdetected circles by creating a histogram of these radii found in your initial pass. You should see a plateau at each of the levels (1) and (2) above, which might help you decide automatically which are the oversampled circles. Other logic may be something as simple as "if there are 3 or more concentric circles detected, discard all but the smallest two".

As for the interface side of things, my suggestion is to think about how many images you will be processing, and how you comparatively value the data (ie, results of cell counts, horn counts etc) vs the implementation (how clean and reusable your code and gui is).

If you need to process, say, 100 images and they're already saved as .jpgs with standard file names, then you will probably attack the problem differently compared to needing to process 2000 images one by one as they are being made. For the former, you might just loop over your detection code for each image, and ask for manual input to count the horns - and be done in an afternoon. For the latter case, you might get more value out of spending the extra time on creating a nice gui for the user, as well as an auto-horn-detector.

It looks like an interesting problem. Please keep us updated as to how things progress.

Cheers,
Sven.

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
detection Lee Borland 17 Feb, 2009 11:02:40
segmentation Lee Borland 17 Feb, 2009 11:02:40
horn Lee Borland 17 Feb, 2009 11:02:39
rssFeed for this Thread
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com