Query in segmenting Nodules in LUNG CT
조회 수: 2 (최근 30일)
이전 댓글 표시
Dear Friends, I am facing problem in segmenting a nodule from Lung CT scan. I segmented lung region from full CT slice using region growing method, but facing problem in segmenting a nodule from the lung region. I attached the full slice and segmented images. I need only the nodule part alone in my result image. I marked the nodule portion in the full slice image below. Please help me out friends :)
댓글 수: 0
채택된 답변
Sean de Wolski
2013년 9월 17일
편집: Sean de Wolski
2013년 9월 17일
Keep the biggest object that's not touching the border in your third image.
Inoborder = imclearborder(Your_Third_Image);
Imx = keepMaxObj(Inoborder);
keepMaxObj is this, though you could use regionprops and linear indexing explicitly.
function Imx = keepMaxObj(X)
%Function to keep only the maximum sized (biggest) object in an image
%SCd 11/30/2010
%
%Updates:
% -02/03/2011: Added ability to handle an image directly
%
%Usage:
% Imx = keepMaxObj(CC);
% Imx = keepMaxObj(V);
%
%Input Arguments:
% -CC: Connected components returned from bwconncomp
% -V: Logical image with parts you want true
%
%Output Arguments:
% -Imx: Logical volume with only the biggest object left true.
%
%See Also: bwconncomp
%
%Error checking:
assert(islogical(X)||isstruct(X),'The first input argument is expected to be a struct or a logical');
if isstruct(X)
CC = X;
parts = {'PixelIdxList','ImageSize'};
assert(all(ismember(parts,fieldnames(CC))),'CC is expected to be the output from bwconncomp');
else
CC = bwconncomp(X);
end
clear X;
%Preallocate and find number of voxels/object
Nvox = zeros(CC.NumObjects,1);
for ii = 1:CC.NumObjects
Nvox(ii) = numel(CC.PixelIdxList{ii});
end
%Find the biggest object's index, warn and save all if there are multiples
[mx,midx] = max(Nvox);
more_than1_max = sum(mx==Nvox);
if more_than1_max > 1
midx = find(mx == Nvox);
warning('Multiple:Maxima', 'There were %i objects with the maximum size.\n They are all left on!',more_than1_max);
end
%Create the final image
Imx = false(CC.ImageSize);
Imx([CC.PixelIdxList{midx}]) = true;
end
댓글 수: 0
추가 답변 (1개)
bimal khatiwada
2020년 8월 9일
Hi
can any one help me with the matlab code to determine the spray length and spray cone angle please. for example: this fig:![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/343603/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/343603/image.jpeg)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 File Operations에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!