Hi, I want to separate the lung tissue from the CT images taken from the chest, but the code I use removes the lung tumors or other parts of the lung itself, and I want the co
2 ビュー (過去 30 日間)
古いコメントを表示
Hi, I want to separate the lung tissue from the CT images taken from the chest, but the code I use removes the lung tumors or other parts of the lung itself, and I want the complete lung tissue. can you help me
z='D:\payanname\codes\lowerleg_imgs\';
d=dir(fullfile(z,'\*.bmp'));
nfiles = length(d);
for ii=1:nfiles
I = imread(strcat(z,d(ii).name));
BW = I > 40;
BW = imcomplement(BW);
BW = imclearborder(BW);
BW = imfill(BW, 'holes');
radius = 3;
decomposition = 0;
se = strel('disk',radius,decomposition);
BW = imerode(BW, se);
maskedImageXY = I;
maskedImageXY(~BW) = 0;
% figure
% imshow(maskedImageXY)
output_folder='D:\payanname\New folder';
myImage = imresize(maskedImageXY,[500 500]);
outputFileName = fullfile(output_folder,[sprintf('%d.png',ii)]);
imwrite(myImage, outputFileName);
end
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Biomedical Imaging についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!