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:
Correction of Lung Boundary

Subject: Correction of Lung Boundary

From: Mandeep

Date: 1 Jan, 2012 13:29:08

Message: 1 of 20

I am working on CT images of Lung.I have extracted the lungs using Region Growing.
My Problem is that for Images in which nodules(abnormal area) is present along the boundary it is not included in lung but treated as background.
How can I correct these boundaries?

I have already extracted these boundaries.

Subject: Correction of Lung Boundary

From: ImageAnalyst

Date: 1 Jan, 2012 15:06:05

Message: 2 of 20

On Jan 1, 8:29 am, "Mandeep " <sa...@yahoo.com> wrote:
> I am working on CT images of Lung.I have extracted the lungs using Region Growing.
> My Problem is that  for Images in which nodules(abnormal area) is present along the boundary it is not included in lung but treated as background.
> How can I correct these boundaries?
>
> I have already extracted these boundaries.

------------------------------------------------------------------------------------------
What does "correct" mean to you? Do you want the lung boundary to
bulge out to capture the nodule as part of the lung boundary? This is
more of an algorithm development question rather than a MATLAB
programming question. So I'm just going to refer you to this site
which has all the medical image processing articles:

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

Subject: Correction of Lung Boundary

From: Matt J

Date: 1 Jan, 2012 23:38:07

Message: 3 of 20

"Mandeep " <samra@yahoo.com> wrote in message <jdpn34$93g$1@newscl01ah.mathworks.com>...
> I am working on CT images of Lung.I have extracted the lungs using Region Growing.
> My Problem is that for Images in which nodules(abnormal area) is present along the boundary it is not included in lung but treated as background.
> How can I correct these boundaries?
===========

One possibility might be to use TriScatteredInterp to paint over the gaps.

Subject: Correction of Lung Boundary

From: Matt J

Date: 2 Jan, 2012 01:08:08

Message: 4 of 20

"Matt J" wrote in message <jdqqov$jbj$1@newscl01ah.mathworks.com>...
> "Mandeep " <samra@yahoo.com> wrote in message <jdpn34$93g$1@newscl01ah.mathworks.com>...
> > I am working on CT images of Lung.I have extracted the lungs using Region Growing.
> > My Problem is that for Images in which nodules(abnormal area) is present along the boundary it is not included in lung but treated as background.
> > How can I correct these boundaries?
> ===========
>
> One possibility might be to use TriScatteredInterp to paint over the gaps.
===============

Another idea. Use IMFILL to fill in the lungs, including the gaps left by the nodules. Then apply bwboundaries slice-by-slice to extract just the boundary voxels.

Subject: Correction of Lung Boundary

From: Mandeep

Date: 2 Jan, 2012 11:17:08

Message: 5 of 20

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <2631ac65-0dcf-41a6-9f26-b379f4d7dd52@f33g2000yqh.googlegroups.com>...
> On Jan 1, 8:29 am, "Mandeep " <sa...@yahoo.com> wrote:
> > I am working on CT images of Lung.I have extracted the lungs using Region Growing.
> > My Problem is that  for Images in which nodules(abnormal area) is present along the boundary it is not included in lung but treated as background.
> > How can I correct these boundaries?
> >
> > I have already extracted these boundaries.
>
> ------------------------------------------------------------------------------------------
> What does "correct" mean to you? Do you want the lung boundary to
> bulge out to capture the nodule as part of the lung boundary? This is
> more of an algorithm development question rather than a MATLAB
> programming question. So I'm just going to refer you to this site
> which has all the medical image processing articles:
>
> http://iris.usc.edu/Vision-Notes/bibliography/contentsmedical.html#Medical%20Applications,%20CAT,%20MRI,%20Ultrasound,%20Heart%20Models,%20Brain%20Models

ImageAnalyst :
Thanks for responding.actually I have extracted lungs like i had already said.all nodules within the lung are included in lung but only nodules that are present along boundary are not.In these cases there is great change in direction of lung boundary.I ask is there any method which will correct boundary based on this information(change in direction)???

Subject: Correction of Lung Boundary

From: Mandeep

Date: 2 Jan, 2012 11:17:08

Message: 6 of 20

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <2631ac65-0dcf-41a6-9f26-b379f4d7dd52@f33g2000yqh.googlegroups.com>...
> On Jan 1, 8:29 am, "Mandeep " <sa...@yahoo.com> wrote:
> > I am working on CT images of Lung.I have extracted the lungs using Region Growing.
> > My Problem is that  for Images in which nodules(abnormal area) is present along the boundary it is not included in lung but treated as background.
> > How can I correct these boundaries?
> >
> > I have already extracted these boundaries.
>
> ------------------------------------------------------------------------------------------
> What does "correct" mean to you? Do you want the lung boundary to
> bulge out to capture the nodule as part of the lung boundary? This is
> more of an algorithm development question rather than a MATLAB
> programming question. So I'm just going to refer you to this site
> which has all the medical image processing articles:
>
> http://iris.usc.edu/Vision-Notes/bibliography/contentsmedical.html#Medical%20Applications,%20CAT,%20MRI,%20Ultrasound,%20Heart%20Models,%20Brain%20Models

ImageAnalyst :
Thanks for responding.actually I have extracted lungs like i had already said.all nodules within the lung are included in lung but only nodules that are present along boundary are not.In these cases there is great change in direction of lung boundary.I ask is there any method which will correct boundary based on this information(change in direction)???

Subject: Correction of Lung Boundary

From: Mandeep

Date: 2 Jan, 2012 12:26:07

Message: 7 of 20

"Matt J" wrote in message <jdr01o$4fv$1@newscl01ah.mathworks.com>...
> "Matt J" wrote in message <jdqqov$jbj$1@newscl01ah.mathworks.com>...
> > "Mandeep " <samra@yahoo.com> wrote in message <jdpn34$93g$1@newscl01ah.mathworks.com>...
> > > I am working on CT images of Lung.I have extracted the lungs using Region Growing.
> > > My Problem is that for Images in which nodules(abnormal area) is present along the boundary it is not included in lung but treated as background.
> > > How can I correct these boundaries?
> > ===========
> >
> > One possibility might be to use TriScatteredInterp to paint over the gaps.
> ===============
>
> Another idea. Use IMFILL to fill in the lungs, including the gaps left by the nodules. Then apply bwboundaries slice-by-slice to extract just the boundary voxels.

Thanks for responding.actually I have extracted lungs like i had already said.all nodules within the lung are included in lung but only nodules that are present along boundary are not.In these cases there is great change in direction of lung boundary.I ask is there any method which will correct boundary based on this information(change in direction)???

Imfill can be possible if there were holes in lungs.but there are no holes.

Subject: Correction of Lung Boundary

From: ImageAnalyst

Date: 2 Jan, 2012 15:54:19

Message: 8 of 20

On Jan 2, 6:17 am, "Mandeep " <sa...@yahoo.com> wrote:
> ImageAnalyst :
> Thanks for responding.actually I have extracted lungs like i had already said.all nodules within the lung are included in lung but only nodules that are present along boundary are not.In these cases there is great change in direction of lung boundary.I ask is there any method which will correct boundary based on this  information(change in direction)???

---------------------------------------------------------------------------
Mandeep:
Have you extracted the nodules that lie on the boundary? If so, then
just AND the nodule mask with the lung mask.

OK, since your description has not made your situation clear to either
Matt or me, it's time for you to upload your original gray scale
image, and your extracted lung mask to tinypic.com and show us what
you mean. It's hard to give image processing advice without an image
- hope you understand.
ImageAnalyst

Subject: Correction of Lung Boundary

From: Mandeep

Date: 3 Jan, 2012 12:43:08

Message: 9 of 20

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <b3c65246-6490-405f-afc3-94483d45a6fb@p13g2000yqd.googlegroups.com>...
> On Jan 2, 6:17 am, "Mandeep " <sa...@yahoo.com> wrote:
> > ImageAnalyst :
> > Thanks for responding.actually I have extracted lungs like i had already said.all nodules within the lung are included in lung but only nodules that are present along boundary are not.In these cases there is great change in direction of lung boundary.I ask is there any method which will correct boundary based on this  information(change in direction)???
>
> ---------------------------------------------------------------------------
> Mandeep:
> Have you extracted the nodules that lie on the boundary? If so, then
> just AND the nodule mask with the lung mask.
>
> OK, since your description has not made your situation clear to either
> Matt or me, it's time for you to upload your original gray scale
> image, and your extracted lung mask to tinypic.com and show us what
> you mean. It's hard to give image processing advice without an image
> - hope you understand.
> ImageAnalyst

ImageAnalyst,Matt:
  No I don't have extracted boundary nodule.I am providing three images
Original image:
http://i43.tinypic.com/2yua9z9.jpg
 Lung Mask:
http://i44.tinypic.com/wak6ir.png

extracted ROI:
http://i41.tinypic.com/jz87ww.jpg

 You can see in mask image that it does not include boundary nodules.I want to correct the lung boundary so that After correcting the boundary it will include boundary nodules.Then I will apply some algorithm to find such nodules from Lung.
 
Want to ask some method to correct boundary so that it will include nodules and some other portions of lung that were not included by Region growing.based on direction change or concavity of boundary or some other possible criteria .

I have traced the boundary pixels of mask by bwboundaries.

Thanks

Subject: Correction of Lung Boundary

From: Mandeep

Date: 5 Jan, 2012 03:27:07

Message: 10 of 20

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <b3c65246-6490-405f-afc3-94483d45a6fb@p13g2000yqd.googlegroups.com>...
> On Jan 2, 6:17 am, "Mandeep " <sa...@yahoo.com> wrote:
> > ImageAnalyst :
> > Thanks for responding.actually I have extracted lungs like i had already said.all nodules within the lung are included in lung but only nodules that are present along boundary are not.In these cases there is great change in direction of lung boundary.I ask is there any method which will correct boundary based on this  information(change in direction)???
>
> ---------------------------------------------------------------------------
> Mandeep:
> Have you extracted the nodules that lie on the boundary? If so, then
> just AND the nodule mask with the lung mask.
>
> OK, since your description has not made your situation clear to either
> Matt or me, it's time for you to upload your original gray scale
> image, and your extracted lung mask to tinypic.com and show us what
> you mean. It's hard to give image processing advice without an image
> - hope you understand.
> ImageAnalyst


Matt,ImageAnalyst:
 Please help me.I have provided the images.

Subject: Correction of Lung Boundary

From: ImageAnalyst

Date: 5 Jan, 2012 03:48:02

Message: 11 of 20

On Jan 4, 10:27 pm, "Mandeep " <sa...@yahoo.com> wrote:
> Matt,ImageAnalyst:
>  Please help me.I have provided the images.
----------------------------------------------------
Not sure what to do. You extracted the lungs. If you want the bright
spots, why not extract them and OR it with your lung mask to get a new
"lung+nodule" mask. Is that what you want?

Subject: Correction of Lung Boundary

From: mandeep

Date: 5 Jan, 2012 07:37:56

Message: 12 of 20

On Jan 5, 8:48 am, ImageAnalyst <imageanal...@mailinator.com> wrote:
> On Jan 4, 10:27 pm, "Mandeep " <sa...@yahoo.com> wrote:> Matt,ImageAnalyst:
> >  Please help me.I have provided the images.
>
> ----------------------------------------------------
> Not sure what to do.  You extracted the lungs.  If you want the bright
> spots, why not extract them and OR it with your lung mask to get a new
> "lung+nodule" mask.  Is that what you want?

Thanks again for responding

Actually it is not possible to find bright spots from original image
because they match with background.thats why I want to extract first
lung then from within lung the nodules.So some way to correct boundary

Subject: Correction of Lung Boundary

From: mandeep

Date: 5 Jan, 2012 09:00:56

Message: 13 of 20

On Jan 5, 12:37 pm, mandeep <er.mandeepsa...@gmail.com> wrote:
> On Jan 5, 8:48 am, ImageAnalyst <imageanal...@mailinator.com> wrote:
>
> > On Jan 4, 10:27 pm, "Mandeep " <sa...@yahoo.com> wrote:> Matt,ImageAnalyst:
> > >  Please help me.I have provided the images.
>
> > ----------------------------------------------------
> > Not sure what to do.  You extracted the lungs.  If you want the bright
> > spots, why not extract them and OR it with your lung mask to get a new
> > "lung+nodule" mask.  Is that what you want?
>
> Thanks again for responding
>
> Actually it is not possible to find bright spots from  original image
> because they match with background.thats why I want to extract first
> lung then from within lung the nodules.So some way to correct boundary

actually the prolblem is with boundary nodules only.for nodules that
lie within the lung can be very easily found.thats why concern is
about boundary correction

Subject: Correction of Lung Boundary

From: Matt J

Date: 5 Jan, 2012 09:44:08

Message: 14 of 20

mandeep <er.mandeepsamra@gmail.com> wrote in message <ed686e05-2265-431d-a20c-c9bdd39a18df@q7g2000yqn.googlegroups.com>...
>
> > Actually it is not possible to find bright spots from  original image
> > because they match with background.thats why I want to extract first
> > lung then from within lung the nodules.So some way to correct boundary
>
> actually the prolblem is with boundary nodules only.for nodules that
> lie within the lung can be very easily found.thats why concern is
> about boundary correction
================

How about the following steps:

1. Do an IMDILATE operation to fill in the boundary gaps, possibly enlarging the lungs as a side effect.

2. IMFILL the dilated lung to get rid of all the holes

3. IMERODE the result of step 2 to get back to the original (approximately) lung boundaries.




You might also look into using alpha shapes to paint over the gaps in the boundary left by the nodules, e.g., using this

http://www.mathworks.com/matlabcentral/fileexchange/6760-ashape-a-pedestrian-alpha-shape-extractor

You would choose the diameter of the alpha shape to be greater than the nodule size.

Subject: Correction of Lung Boundary

From: ImageAnalyst

Date: 5 Jan, 2012 11:06:38

Message: 15 of 20

On Jan 5, 4:00 am, mandeep <er.mandeepsa...@gmail.com> wrote:
> actually the prolblem is with boundary nodules only.for nodules that
> lie within the lung can be very easily found.thats why concern is
> about boundary correction
----------------------------------------------------------------------
Why don't you put up anohter image with the nodules outlined or
pointed to with arrows, because I'm not sure what's a nodule and
what's rib or other stuff that you don't want?

Subject: Correction of Lung Boundary

From: Matt J

Date: 5 Jan, 2012 16:33:08

Message: 16 of 20

"Matt J" wrote in message <je3rd8$ipq$1@newscl01ah.mathworks.com>...
>
> How about the following steps:
>
> 1. Do an IMDILATE operation to fill in the boundary gaps, possibly enlarging the lungs as a side effect.
>
> 2. IMFILL the dilated lung to get rid of all the holes
>
> 3. IMERODE the result of step 2 to get back to the original (approximately) lung boundaries.
================

I did these steps and I got the following.

http://i42.tinypic.com/25k7vxv.png

If it isn't good enough, you should explain why


bw=imread('wak6ir.png');
bw2=imdilate(bw,ones(10));
bw3=imfill(bw2,'holes');
bw4=imerode(bw3,ones(10));

Subject: Correction of Lung Boundary

From: Mandeep

Date: 5 Jan, 2012 19:11:08

Message: 17 of 20

ImageAnalyst <imageanalyst@mailinator.com> wrote in message <59b2b10d-6c25-4461-99d2-42645b318e55@t13g2000yqg.googlegroups.com>...
> On Jan 5, 4:00 am, mandeep <er.mandeepsa...@gmail.com> wrote:
> > actually the prolblem is with boundary nodules only.for nodules that
> > lie within the lung can be very easily found.thats why concern is
> > about boundary correction
> ----------------------------------------------------------------------
> Why don't you put up anohter image with the nodules outlined or
> pointed to with arrows, because I'm not sure what's a nodule and
> what's rib or other stuff that you don't want?


ImageAnalyst:

Thanks a lot.I tried 3 steps provided by u.They help me a lot.Now I trying to optimize structuring element for all slices.


Once again thank you very much.
I will ask for your help if needed in future.Please be alive

Thanks

Subject: Correction of Lung Boundary

From: Mandeep

Date: 6 Jan, 2012 13:10:08

Message: 18 of 20

"Matt J" wrote in message <je4jc4$7be$1@newscl01ah.mathworks.com>...
> "Matt J" wrote in message <je3rd8$ipq$1@newscl01ah.mathworks.com>...
> >
> > How about the following steps:
> >
> > 1. Do an IMDILATE operation to fill in the boundary gaps, possibly enlarging the lungs as a side effect.
> >
> > 2. IMFILL the dilated lung to get rid of all the holes
> >
> > 3. IMERODE the result of step 2 to get back to the original (approximately) lung boundaries.
> ================
>
> I did these steps and I got the following.
>
> http://i42.tinypic.com/25k7vxv.png
>
> If it isn't good enough, you should explain why
>
>
> bw=imread('wak6ir.png');
> bw2=imdilate(bw,ones(10));
> bw3=imfill(bw2,'holes');
> bw4=imerode(bw3,ones(10));


Thanks MattJ It works.

Thanks a lot for giving your time to me.
I will ask from you in future if some problem.

Subject: Correction of Lung Boundary

From: Karthik

Date: 18 Sep, 2012 04:24:08

Message: 19 of 20

Hello sir,

I tried these steps and got the boundary of lung perfectly..
But nodules couldn be retained..
I want the nodules to be present in the image too sir.
So how can i retain nodules in the image???


"Matt J" wrote in message <je4jc4$7be$1@newscl01ah.mathworks.com>...
> "Matt J" wrote in message <je3rd8$ipq$1@newscl01ah.mathworks.com>...
> >
> > How about the following steps:
> >
> > 1. Do an IMDILATE operation to fill in the boundary gaps, possibly enlarging the lungs as a side effect.
> >
> > 2. IMFILL the dilated lung to get rid of all the holes
> >
> > 3. IMERODE the result of step 2 to get back to the original (approximately) lung boundaries.
> ================
>
> I did these steps and I got the following.
>
> http://i42.tinypic.com/25k7vxv.png
>
> If it isn't good enough, you should explain why
>
>
> bw=imread('wak6ir.png');
> bw2=imdilate(bw,ones(10));
> bw3=imfill(bw2,'holes');
> bw4=imerode(bw3,ones(10));

Subject: Correction of Lung Boundary

From: Matt J

Date: 18 Sep, 2012 10:20:08

Message: 20 of 20

"Karthik " <karthi24mar@gmail.com> wrote in message <k38t18$otr$1@newscl01ah.mathworks.com>...
> Hello sir,
>
> I tried these steps and got the boundary of lung perfectly..
> But nodules couldn be retained..
> I want the nodules to be present in the image too sir.
> So how can i retain nodules in the image???
==========

If you have the boundaries of the lung, you can use IMFILL to get a logical mask of whatever's inside them.

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