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 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (0)
Vedere anche
Categorie
Scopri di più su Biomedical Imaging in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!