Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Medical Image Feature Extraction

Subject: Medical Image Feature Extraction

From: Reza Reza

Date: 25 Oct, 2010 11:46:04

Message: 1 of 27

Hi,

I'm doing X-Ray image classification, I need to exctract features of the images such as texture and shape features, use it as an input to classifier.
what are the good techniques to extract the features of this type of images ( X-ray ).
I really appreciate if you could provide some sample code?
Thanks

Subject: Medical Image Feature Extraction

From: ImageAnalyst

Date: 25 Oct, 2010 13:45:33

Message: 2 of 27

"Reza Reza" <persianfrien...@yahoo.com>:
Here are some good techniques:

http://iris.usc.edu/Vision-Notes/bibliography/contentsmedical.html#Medical%20Applications,%20CAT,%20MRI,%20Ultrasound,%20Heart%20Models,%20Brain%20Models

Virtually every image analysis technique ever published is listed
there. Just pick one that sounds good and try it.

Thresholding and region growing are popular - maybe you could try
something like that.

Seriously though, your approach is way too broad to get any kind of
useful results on any real world images. You're going to have to
narrow your focus. For example if you want to find nodules on lung
images, then look for papers that talk about that specifically.

Subject: Medical Image Feature Extraction

From: Reza Reza

Date: 25 Oct, 2010 14:05:06

Message: 3 of 27

Thanks for the reply, My data are any sort of X-ray images, its not only for specific body region, I'm using ImageClef05 dataset...


ImageAnalyst <imageanalyst@mailinator.com> wrote in message <b7f074e2-c533-4e31-8cc1-593b2a298a84@u10g2000yqk.googlegroups.com>...
> "Reza Reza" <persianfrien...@yahoo.com>:
> Here are some good techniques:
>
> http://iris.usc.edu/Vision-Notes/bibliography/contentsmedical.html#Medical%20Applications,%20CAT,%20MRI,%20Ultrasound,%20Heart%20Models,%20Brain%20Models
>
> Virtually every image analysis technique ever published is listed
> there. Just pick one that sounds good and try it.
>
> Thresholding and region growing are popular - maybe you could try
> something like that.
>
> Seriously though, your approach is way too broad to get any kind of
> useful results on any real world images. You're going to have to
> narrow your focus. For example if you want to find nodules on lung
> images, then look for papers that talk about that specifically.

Subject: Medical Image Feature Extraction

From: ImageAnalyst

Date: 25 Oct, 2010 14:38:44

Message: 4 of 27

On Oct 25, 10:05 am, "Reza Reza" <persianfrien...@yahoo.com> wrote:
> Thanks for the reply, My data are any sort of X-ray images, its not only for specific body region, I'm using ImageClef05 dataset...
-------------------------------------------------------------------
Uh, okay. Then just use threshold. All image analysis eventually
gets to the point where you have to do thresholding. Here's your
basic algorithm:
1. process image in some way
2. threshold to get foreground and background (objects you're
interested in and those you're not)
3. bwlabel()
4. regionprops()

There - image analysis in 4 easy (or not so easy) steps.
Good luck.

Subject: Medical Image Feature Extraction

From: Reza Reza

Date: 25 Oct, 2010 15:55:04

Message: 5 of 27

Thanks alot,,,
then how about region growing? its not suitable for my data?


"Reza Reza" <persianfriend12@yahoo.com> wrote in message <ia42qi$3c2$1@fred.mathworks.com>...
> Thanks for the reply, My data are any sort of X-ray images, its not only for specific body region, I'm using ImageClef05 dataset...
>
>
> ImageAnalyst <imageanalyst@mailinator.com> wrote in message <b7f074e2-c533-4e31-8cc1-593b2a298a84@u10g2000yqk.googlegroups.com>...
> > "Reza Reza" <persianfrien...@yahoo.com>:
> > Here are some good techniques:
> >
> > http://iris.usc.edu/Vision-Notes/bibliography/contentsmedical.html#Medical%20Applications,%20CAT,%20MRI,%20Ultrasound,%20Heart%20Models,%20Brain%20Models
> >
> > Virtually every image analysis technique ever published is listed
> > there. Just pick one that sounds good and try it.
> >
> > Thresholding and region growing are popular - maybe you could try
> > something like that.
> >
> > Seriously though, your approach is way too broad to get any kind of
> > useful results on any real world images. You're going to have to
> > narrow your focus. For example if you want to find nodules on lung
> > images, then look for papers that talk about that specifically.

Subject: Medical Image Feature Extraction

From: ImageAnalyst

Date: 25 Oct, 2010 16:42:44

Message: 6 of 27

On Oct 25, 11:55 am, "Reza Reza" <persianfrien...@yahoo.com> wrote:
> Thanks alot,,,
> then how about region growing? its not suitable for my data?
-------------------------------------------------------------------------------------------
Uh, sure. Yep, that'll work too.
You realize I haven't seen your images, right?

Subject: Medical Image Feature Extraction

From: Reza Reza

Date: 29 Oct, 2010 16:10:05

Message: 7 of 27

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <f884284e-3513-428a-ad34-51f33a0d6e58@k22g2000yqh.googlegroups.com>...
> On Oct 25, 10:05 am, "Reza Reza" <persianfrien...@yahoo.com> wrote:
> > Thanks for the reply, My data are any sort of X-ray images, its not only for specific body region, I'm using ImageClef05 dataset...
> -------------------------------------------------------------------
> Uh, okay. Then just use threshold. All image analysis eventually
> gets to the point where you have to do thresholding. Here's your
> basic algorithm:
> 1. process image in some way
> 2. threshold to get foreground and background (objects you're
> interested in and those you're not)
> 3. bwlabel()
> 4. regionprops()
>
> There - image analysis in 4 easy (or not so easy) steps.
> Good luck.


Hi,
Im alittle bit confused, I really appreciate if you could advise me on that:
I am supposed to extract the features of the X-ray medical images, the features are a vector, so I use this vector as an input to my classifier like SVM for example..
I did follow your steps.
Read an image,,, resize it to [100 100] dimension,
applied function c = EulerMinMax(i,b) for threshold .
then applied bwlabel() followed by regionprops()...
here is what I dont undrestand, that how can I get to the final output which is a vector that I can use it for my classifier???

Subject: Medical Image Feature Extraction

From: ImageAnalyst

Date: 29 Oct, 2010 19:19:00

Message: 8 of 27

I'm a little bit confused too. regionprops returns a bunch of
measurements. Now I don't know what kind of input your classifier
wants, nor what kind of classes it will try to find, but why can't you
just send the results of regionprops into your classifier? You can
always pull the numbers out of the structure and string them along
into one giant numerical array if you want. For example, if your
classifier only looks at areas and intensities, just say
allAreas = [blobMeasurements.Areas];
allIntensities = [blobMeasurements.MeanIntensity];
myFeatureVector = [allAreas allIntensities];

myClasses = ClassifyFeatureVector(myFeatureVector);
Obviously, ClassifyFeatureVector() is a function that you write to do
the classification in a way that makes sense for your situation. (I
hope it's) Needless to say, it's not a built-in MATLAB function.

Subject: Medical Image Feature Extraction

From: Reza Reza

Date: 1 Nov, 2010 14:46:04

Message: 9 of 27

Hi,

The following are what I did:

I=imread('an x-ray image')

BW = EulerMinMax(I,254) ===> ***This function extract a binary image from gray scale image using auto-tuned threshold value obtained from the correlation of Image euler numbers.***

[L,NUM] = BWLABEL(BW,8)

s = REGIONPROPS(L,'all')

AllAreas=[s.Area]


now my question is that the value that I get for "AllAreas" are varies from image to image, so i have to add each features to one vector since i'm reading many images
imageFeature=[imageFeature;AllAreas]

I will not be able to add this value to imageFeature vector if they are different... any suggestion for that?

Subject: Medical Image Feature Extraction

From: Sean

Date: 1 Nov, 2010 15:36:04

Message: 10 of 27


> now my question is that the value that I get for "AllAreas" are varies from image to image, so i have to add each features to one vector since i'm reading many images
> imageFeature=[imageFeature;AllAreas]
>
> I will not be able to add this value to imageFeature vector if they are different... any suggestion for that?

What you did right here is "concatenate" them, which you will be able to do if they are different.

If you do want to "add" them you're going to have to define some criteria of where to add what. If one is a vector 10x1 and the other 100x1, where do you want to add those 10 values to the 100 value vector? None of us can decide that for you.

Overall it would still be best if you showed us your images as ImageAnalyst hinted at multiple times.

Subject: Medical Image Feature Extraction

From: Reza Reza

Date: 1 Nov, 2010 16:10:09

Message: 11 of 27

How can I show the images here?

"Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <iammp4$chn$1@fred.mathworks.com>...
>
> > now my question is that the value that I get for "AllAreas" are varies from image to image, so i have to add each features to one vector since i'm reading many images
> > imageFeature=[imageFeature;AllAreas]
> >
> > I will not be able to add this value to imageFeature vector if they are different... any suggestion for that?
>
> What you did right here is "concatenate" them, which you will be able to do if they are different.
>
> If you do want to "add" them you're going to have to define some criteria of where to add what. If one is a vector 10x1 and the other 100x1, where do you want to add those 10 values to the 100 value vector? None of us can decide that for you.
>
> Overall it would still be best if you showed us your images as ImageAnalyst hinted at multiple times.

Subject: Medical Image Feature Extraction

From: Sean

Date: 1 Nov, 2010 16:24:04

Message: 12 of 27

"Reza Reza" <persianfriend12@yahoo.com> wrote in message <iamop1$pt2$1@fred.mathworks.com>...
> How can I show the images here?

Now that drop.io has been shut down by the evil Facebook; this site seems like a good choice:

http://www.fileconvoy.com/index.php

Subject: Medical Image Feature Extraction

From: ImageAnalyst

Date: 1 Nov, 2010 16:43:57

Message: 13 of 27

Like Sean said, that should work. What I don't understand though is
why you're concatenating areas of blobs from different images
together, unless you want to classify a whole *stack* or groups of
images as a whole rather than classify each image individually. Like
"This set of images contains mostly normal cells" or "This set of
images has a substantial number of sickle cells in them."

Subject: Medical Image Feature Extraction

From: Reza Reza

Date: 2 Nov, 2010 15:43:04

Message: 14 of 27

Yes , the idea is to classify the group of images as a whole rather than classify each image individually,
ImageAnalyst <imageanalyst@mailinator.com> wrote in message <4a3b2a8f-f4f2-4821-8d95-fc9b10ee042e@l8g2000yql.googlegroups.com>...
> Like Sean said, that should work. What I don't understand though is
> why you're concatenating areas of blobs from different images
> together, unless you want to classify a whole *stack* or groups of
> images as a whole rather than classify each image individually. Like
> "This set of images contains mostly normal cells" or "This set of
> images has a substantial number of sickle cells in them."

Subject: Medical Image Feature Extraction

From: ImageAnalyst

Date: 2 Nov, 2010 16:10:08

Message: 15 of 27

On Nov 2, 11:43 am, "Reza Reza" <persianfrien...@yahoo.com> wrote:
> Yes , the idea is to classify the group of images as a whole rather than classify each image individually,
----------------------------------------------------------------------

OK, so then you have no problems anymore, right?

Subject: Medical Image Feature Extraction

From: Reza Reza

Date: 5 Nov, 2010 02:09:04

Message: 16 of 27

as I said before, let say we wana classify 500 images as a whole, first we need to extract the features, and as u have suggested, we use RegionProps to get certain measurement, and put them in a vector,,,
every image are having different blobs, so the number of features will be different.
what I mean is if image A has 10 blobs, and if we are getting 5 values from each bolbs, at the end, we will have a vector [10 X 5 double] for image A. if all the other images have 10 blobs, then there will be no problem, after I read all the images, i will put them all in 1 vector and send it to classifier, but the problem is that the next image may not have 10 blobs, may have more or less?
I was asking if you have any suggestion for this, I do not know, maybe i'm not getting the concept ...

Subject: Medical Image Feature Extraction

From: ImageAnalyst

Date: 5 Nov, 2010 02:18:02

Message: 17 of 27

You have to get a value for that feature that represents the whole
set, for example, the average blob measurement, or the blob
measurement distribution (histogram), so that your feature does not
depend on how many blobs each image has but rather on the features of
the set of images as a whole collection. And it will have the same
size no matter how many blobs or images are in each image set. In
other words, redefine what you are calling the "feature" so that it's
independent on the number of blobs in the images.

Subject: Medical Image Feature Extraction

From: Reza Reza

Date: 5 Nov, 2010 02:31:04

Message: 18 of 27

all right, so you mean no matter how many blobs I will get for an image, I just get the average value for each measurement, if I have 10 blobs, so I have 10 different value for mean intensity, so I just get its average value. right?

how about if I just select the row( mean intensity, perimeter...) which has the highest value for Area?

Subject: Medical Image Feature Extraction

From: ImageAnalyst

Date: 5 Nov, 2010 02:49:14

Message: 19 of 27

Those might work. It just depends on how you want to construct your
feature vector - it's up to you because you're the one that is going
to have to look at that feature vector and make some decisions based
on it.

Subject: Medical Image Feature Extraction

From: Reza Reza

Date: 5 Nov, 2010 03:28:04

Message: 20 of 27

thanks alot

Subject: Medical Image Feature Extraction

From: Dariush

Date: 12 Dec, 2010 10:22:05

Message: 21 of 27

Hi Image Analyst,

Following to our previous Q & A session, I did the following code:

Read the first image (img1)
{
      thresholdValue = 100;
       binaryImage = img1 > thresholdValue;
       binaryImage = imfill(binaryImage, 'holes');
     labeledImage = bwlabel(binaryImage, 8);
     blobMeasurements = regionprops(labeledImage, img1, 'all');
     numberOfBlobs = size(blobMeasurements, 1);

        blobECD = zeros(1, numberOfBlobs);
      SummeanGL=0;
      double SumArea=0;
      SumPerimeter=0;
      sumCentriod=0;
      SmeanGL=[];
      SArea=[];
      SPerimeter=[];
      sECD=[];
      double avg2=0;

     for k = 1 : numberOfBlobs
            thisBlobsPixels = blobMeasurements(k).PixelIdxList; %
            meanGL = mean(img1(thisBlobsPixels)); %
            meanGL2008a = blobMeasurements(k).MeanIntensity; %
 
     blobArea = blobMeasurements(k).Area; % blobPerimeter = blobMeasurements(k).Perimeter;
            blobCentroid = blobMeasurements(k).Centroid;
          
            blobECD(k) = sqrt(4 * blobArea / pi
 
           SmeanGL=[SmeanGL, round(meanGL)];
         SArea=[SArea,round(blobArea)];
         SPerimeter=[SPerimeter,round(blobPerimeter)];
         sECD=[sECD;round(blobECD(k))];
            
     end
     
      SummeanGL=sum(SmeanGL);
      SumArea=sum(SArea);
      SumPerimeter=sum(SPerimeter);
      sumECD=sum(sECD);
      avg1=SummeanGL/numberOfBlobs;
      avg2=SumArea/numberOfBlobs;
      avg3=SumPerimeter/numberOfBlobs;
      avg4=sumECD/numberOfBlobs;
       measurement=[measurement;round(avg1),round(avg2), round(avg3),round(avg4)];
  
 value_4=[value_4;measurement];
   measurement=[];
  end

so “value_4” is my extracted feature vector . I read 500 image from different class, about 4-5 image from each class, and train the SVM, and for testing purpose, I read 120 images from all the classes( almost 1 image per class) and I use the model for classification, only 20% is correct...

please advise me on this...

Subject: Medical Image Feature Extraction

From: Tombo H

Date: 13 Dec, 2010 00:42:04

Message: 22 of 27

On Dec 12, 5:22 am, "Dariush " <persianfrien...@yahoo.com> wrote:
> Hi Image Analyst,
>
> Following to our previous Q & A session, I did the following code:
>
> please advise me on this...
-------------------------------------------
Sorry, but I don't remember the previous Q&A session, and I don't see
it here in this thread that you replied to (the thread of Reza Reze).
So my only advice would be to keep at it and use the debugger. I have
no idea why your classifier is wrong.
-ImageAnalyst

Subject: Medical Image Feature Extraction

From: Dariush

Date: 13 Dec, 2010 12:00:22

Message: 23 of 27

this link is the thread:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/294720#804168


Tombo H <tombo.hayworth@gmail.com> wrote in message <1fd1f89f-9b16-4664-a433-0a0aa0528995@u3g2000vbj.googlegroups.com>...
> On Dec 12, 5:22 am, "Dariush " <persianfrien...@yahoo.com> wrote:
> > Hi Image Analyst,
> >
> > Following to our previous Q & A session, I did the following code:
> >
> > please advise me on this...
> -------------------------------------------
> Sorry, but I don't remember the previous Q&A session, and I don't see
> it here in this thread that you replied to (the thread of Reza Reze).
> So my only advice would be to keep at it and use the debugger. I have
> no idea why your classifier is wrong.
> -ImageAnalyst

Subject: Medical Image Feature Extraction

From: Dariush

Date: 13 Dec, 2010 12:24:05

Message: 24 of 27

The classifier is not wrong, but it does not give me an accurate result and I can guess why?
one of the parameter that I'm getting from RegionProps is Area, just imagine that i have 2 image of hands but from different category, let say one is right hand, one is left hand, for sure the parameter Area extracted from these 2 images will be almost close and similar, thats why I think the classification accuracy won't be correct that much, any advise on this???

Subject: Medical Image Feature Extraction

From: Image Analyst

Date: 13 Dec, 2010 13:09:05

Message: 25 of 27

That's just this very same thread.
I don't know anything about finding specific hand configurations.
But these people do:
http://iris.usc.edu/Vision-Notes/bibliography/people932.html#Sign%20Language,%20ASL%20Recognition
and I suggest you follow up on some of those successful methods.

Subject: Medical Image Feature Extraction

From: David Young

Date: 13 Dec, 2010 13:30:23

Message: 26 of 27

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <f884284e-3513-428a-ad34-51f33a0d6e58@k22g2000yqh.googlegroups.com>...
> ...
> ... All image analysis eventually
> gets to the point where you have to do thresholding. Here's your
> basic algorithm:
> 1. process image in some way
> 2. threshold to get foreground and background (objects you're
> interested in and those you're not)
> 3. bwlabel()
> 4. regionprops()
>
> There - image analysis in 4 easy (or not so easy) steps.
> ...

Well, that's my 10-week course on digital image processing and analysis reduced to 4 lines! I knew I was making it too complicated!

But maybe there's sometimes another step between 2 and 3: morphological operations?

Subject: Medical Image Feature Extraction

From: ImageAnalyst

Date: 13 Dec, 2010 13:50:50

Message: 27 of 27

On Dec 13, 8:30 am, "David Young" <d.s.young.notthis...@sussex.ac.uk>
wrote:
> ImageAnalyst <imageanal...@mailinator.com> wrote in message <f884284e-3513-428a-ad34-51f33a0d6...@k22g2000yqh.googlegroups.com>...
> > ...
> > ...  All image analysis eventually
> > gets to the point where you have to do thresholding.  Here's your
> > basic algorithm:
> > 1. process image in some way
> > 2. threshold to get foreground and background (objects you're
> > interested in and those you're not)
> > 3. bwlabel()
> > 4. regionprops()
>
> > There - image analysis in 4 easy (or not so easy) steps.
> > ...
>
> Well, that's my 10-week course on digital image processing and analysis reduced to 4 lines! I knew I was making it too complicated!
>
> But maybe there's sometimes another step between 2 and 3: morphological operations?

----------------------------------------------------------------------------
Well step 1 is obviously the hardest. But once you have the binary
image, yes you can do other things like imclearborder() to get rid of
blobs touching the edge of the image, or bwareaopen() to get rid of
small blobs, or watershed to split apart blobs, etc.

Tags for this Thread

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.

Contact us