Besler / ITKGraphCutSegmentation

An ITK implementation of the GraphCut framework. See 'Graph cuts and efficient ND image segmentation' by Boykov and Funka-Lea and 'Interactive graph cuts for optimal boundary & region segmentation of objects in ND images' by Boykov and Jolly.
GNU General Public License v3.0
13 stars 5 forks source link

A question about segmentation result #1

Open zhang-qiang-github opened 3 years ago

zhang-qiang-github commented 3 years ago

Thank you very much for sharing code for this project.

My fore- and background mask is:

image

The cyan color indicates foreground, and red color indicates background. I want to segment the arota.

The segmentation result is:

image

The red rectangle includes the arota that I needed. But, the segmentation result also includes what I don't need, for example the air pointed by the red arrow. The final arota surface is:

image

Why the graph cut resulted in two region that do not connected?

How to remove the air?

Besler commented 3 years ago

Cool results and I'm glad you're making use of this method!

If I guessed, the background is actually connected to the aorta through some noise voxels. I believe there is a connectivity filter that would have removed them if they are not connected. You can load it into SimpleITK and run a connectivity filter to be sure.

The sure-fire way to get around this is to put hard background labels in the oval you want to reject. This is actually caused by cropping in the CT scanner and is difficult to treat otherwise. Add a few broad strokes in the background and run it again.

zhang-qiang-github commented 3 years ago

The ITKGraphCutSegmentation really give a good result for arota. But, it fail to segment left ventricle.

image

Like the above figure, the yellow point is the foreground, and the red point is the background. I want to segment left ventricle. And the final result is:

image

The left picture is the final result of graph cut. We can see that it do not segment any ventricle except the seed point. The setting is:

    GraphCutFilterType::Pointer graphCutFilter = GraphCutFilterType::New();
    graphCutFilter->SetInputImage(reader->GetOutput());
    graphCutFilter->SetForegroundImage(foregroundMaskReader->GetOutput());
    graphCutFilter->SetBackgroundImage(backgroundMaskReader->GetOutput());
    graphCutFilter->SetVerboseOutput(true);
    graphCutFilter->SetSigma(50);
    graphCutFilter->SetBoundaryDirectionTypeToNoDirection();
    graphCutFilter->SetForegroundPixelValue(255);
    graphCutFilter->SetBackgroundPixelValue(0);
    graphCutFilter->Update();

I think the reason of failed segmentation is that the contrast between left ventricle and other organ is very low.

Do you have any suggestion?