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 :)

采纳的回答

Sean de Wolski
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

更多回答(1 个)

bimal khatiwada
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:

类别

Help CenterFile Exchange 中查找有关 File Operations 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by