現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
Chan Vese Segmentation mask is not working Properly
5 ビュー (過去 30 日間)
古いコメントを表示
I cropped my DICOM image so the active contour be faster and segment between the black area and soft tissue.
Instead, I got a contour that overlaps the edge of the image and goes beyond this. How can this happen? See attached image.
Let me know if you need the m files.
採用された回答
Anton Semechko
2018 年 6 月 26 日
Your image appears to be "padded" on the top and bottom with gray values. The transition between the black background (containing the region of interest; ROI) and these gray regions, has large gradient that will attract the contour during segmentation; because evolution of the contour is guided by the strength of the image intensity gradient. My suggestions to you, (1) remove the padding, (2) initialize contour close to the ROI you want to segment.
28 件のコメント
Stelios Fanourakis
2018 年 6 月 26 日
You are right. But how do I do that? I cropped the image without padding still the padding shows up and I am trying to find a way to initialize the contour close to the dark area. If you have any experience on chan vese methods please help
Image Analyst
2018 年 6 月 26 日
編集済み: Image Analyst
2018 年 6 月 26 日
"I cropped the image without padding still the padding shows up" Huh? How could that be? Attach your m-file and dicom image, zipped up if you have to. And you've Accepted this answer, so can we assume that it's solved, or not? Please clarify.
Stelios Fanourakis
2018 年 6 月 26 日
I accepted the answer because he's right to his comment, I guess. No it hasn't been solved. I attach the two m files I use for the contour and the jpg (cropped) image. You'll see that the contour goes outside the image where I want it to go inside of it and match the black area. It must be a tune in the init_mask of the chvese.m but I cannot find it yet.
Stelios Fanourakis
2018 年 6 月 26 日
The image is already cropped. The original one is much bigger. I only left a thin strip of the dicom image and saved it as jpg
Stelios Fanourakis
2018 年 6 月 26 日
This white padding thing do not exist in the cropped image when opened using imtool
Stelios Fanourakis
2018 年 6 月 26 日
I saved it as png and now no white padding is showing and the contour goes inside the image. But it seems it cannot segment between the soft tissue (gray) and the background. It outlines the whole image
Anton Semechko
2018 年 6 月 26 日
1) Can you post on here the grayscale image you want to process (without the padding) and a separate image showing (approximately) the ROI you want to segment.
2) Is there a reason you chose this particular segmentation algorithm?
Stelios Fanourakis
2018 年 6 月 26 日
@Anton. I just saved it as png (same image). I need an active contour to separate black area (bckgnd) with the soft tissue (foreground). It seems fast enough this algorithm. Do you have any alternative to propose me?
Anton Semechko
2018 年 6 月 26 日
The image background appears relatively uniform and free of noise, so yes, there are simpler and more efficient algorithms that can be used in place of level-set segmentation.
Before we get to that, it seems that you are not getting an important point about the input image you want to process. The image you provided is definitely not an original DICOM image because it contains extraneous padding around the borders:
You should not be using this image as input to a segmentation algorithm, level-set or otherwise, because it contains information that will "confuse" segmentation algorithm and preclude it from finding the ROI you actually want to segment. Do you understand this?
Stelios Fanourakis
2018 年 6 月 26 日
Yes Anton. I understand it. If you see my latest attachment it is the .png format with no padding at all. Still cannot differentiate between black and gray.
Stelios Fanourakis
2018 年 6 月 26 日
Can you please give me using a more efficient segmentation algorithm?
Anton Semechko
2018 年 6 月 26 日
'untitled.png' WAS the image I used to generate the above thumbnail showing the extraneous padding!!!
Stelios Fanourakis
2018 年 6 月 26 日
But I use that image to my pc/Matlab and the contour goes inside the image area. Correctly. Previously with the 'pictoedit.jpg', there was a problem with padding. Are you sure you used the png version? I don't have problem with padding. I have problem that it won't segment correctly
Anton Semechko
2018 年 6 月 26 日
I can't figure out if I am being trolled. Anyone else reading this care to comment?
Stelios Fanourakis
2018 年 6 月 26 日
See my previous attachment. Contour get inside the image. How else to explain it?
Anton Semechko
2018 年 6 月 26 日
Ok, do this:
im=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/122991/untitled.png');
figure('color','w')
imshow(im)
What do you see?
Stelios Fanourakis
2018 年 6 月 26 日
At my first attachment in this post (fig.jpg) contour goes out of image area. That was my problem now I have a different problem. Am I clear or not?
Anton Semechko
2018 年 6 月 27 日
Stelios, does the file 'untitled.png' contain the image you are using as input to the segmentation algorithm?
Stelios Fanourakis
2018 年 6 月 27 日
@Anton. Please, give me an efficient segmentation algorithm. The one I use doesn't seem to be able to differentiate between black and gray values
Anton Semechko
2018 年 6 月 27 日
Since you are completely impervious to everything I said up 'till now, I will just give you a demo.
% Get the image
im=imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/122991/untitled.png');
% Remove extraneous padding and border drawn on the image
im=im(161:280,11:880,:);
im=max(im,[],3);
% Segment into 4 classes using only intensity information
[C,U,LUT,H]=FastFCMeans(im,4);
L=LUT2label(im,LUT);
% Visualize
figure
subtightplot(3,1,1), imshow(im)
subtightplot(3,1,2), imshow(L,[])
subtightplot(3,1,3), imshow(L>1,[])
Stelios Fanourakis
2018 年 6 月 27 日
@Anton. Although I got all the functions you suggested me, here are the results. I didn't manage to get your results. I did only copy paste.
Stelios Fanourakis
2018 年 6 月 27 日
Thanks a lot Anton, I do really appreciate your effort and help. One last thing I might need to ask is how can I have the contour visible on the image. I need to control the active contour so will be slightly modified when applied to several images since the images differ between them
Anton Semechko
2018 年 6 月 27 日
'FastFCMeans' performs image segmentation by clustering of image intensities and is thus fundamentally different from the level-set segmentation algorithm you were using before. There is no initialization involved and the resulting segmentation depends only on the input parameters 'c' and 'q'; 'c' controls the number of intensity clusters and 'q' is a fuzzification parameter. See 'FastFCMeans' documentation for additional info.
Stelios Fanourakis
2018 年 8 月 31 日
Hi Anton.
Thanks for your valuable help so far. What I have not understand yet is how to get what I need. FastFCMeans algorithm indeed segmented the gray soft tissue from the background. What I want now is to get the black area above the soft tissue. Only this region above the tissue. I need to somehow segment it and measure its length, pixel area size, dimensions. Do I have to implement a snake contour like chan vese. How else can I obtain the values of this area? (pixel size, pixels in number, dimensions, length from top of the image to the beginning of the tissue).
Stelios Fanourakis
2018 年 8 月 31 日
編集済み: Stelios Fanourakis
2018 年 8 月 31 日
Moreover, if you notice the soft tissue at the last pic available (untitled.png) you'll notice some black gaps between the soft tissue especially at the lower left side of the image. I need some kind of interpolation method to fill those gaps so the contour will not get messed. So the soft tissue will be a unit of seamless gray or white matter with no black gaps.
I attach an image to see the results so far. See that the contour gets troubled to the points where the soft tissue is not seamless and black gaps occur. Any idea of how to fix it?
その他の回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
- América Latina (Español)
- Canada (English)
- United States (English)
ヨーロッパ
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
アジア太平洋地域
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)