资源简介
matlab课程设计源代码(肺实质的提取)
专为课程设计打造!!!

代码片段和文件信息
%% Segmentation of the CT image of lung
% This code reads a BMP image extract the part of lung
% and then dispaly the result.
%% Read the image data
im=imread(‘f.bmp‘);
im=rgb2gray(im);
[row column]=size(im);
imshow(im)
title(‘the Original Image‘)
%% Get the threshold for segmentation using iteration process
%get the maximun and minimun value of the vector
Gmax=max(max(im));
Gmin=min(min(im));
%supposing T0 is the threshold
T0=(Gmax+Gmin)/2;
%mean of both partsthen get the new threshold T1
M0=mean(im(find(im M1=mean(im(find(im>=T0)));
T1=(M0+M1)/2;
%get the appropriate threshold
%by no more then 5000 loops
for i=1:5000 %here gives the maximun numbers of trying
if T1~=T0
T0=T1;
M0=mean(im(find(im M1=mean(im(find(im>=T0)));
T1=(M0+M1)/2;
else break
end
end
thresh=T0
%% Segmentation
for index=1:row*column
if im(index)>thresh
im(index)=0;
end
end
figureimshow(im)
title(‘After Segmentation‘)
%make a copyusing to get the position
im0=im;
%% Extract
%divided the image into 2 parts
%foreground with 1background with 0
for index=1:row*column
if im0(index)~=0
im0(index)=1;
end
end
%transform im0 into ‘logical‘then label
%the part of lung has been labelled with 20
im0=logical(im0);
im0=bwlabel(im0);
%display the relational pixel
for i=1:row*column
if im0(i)~=20
im(i)=0;
end
end
figureimshow(im)
title(‘After Extract‘)
%% About
% *Authored* by Xiaol Z.
% Nov.12th2010.
% USST
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 6791 2010-11-13 21:52 肺实质的提取\DataPackage\LungSeg.html
文件 1953 2010-11-13 21:52 肺实质的提取\DataPackage\LungSeg.png
文件 141233 2010-11-13 21:52 肺实质的提取\DataPackage\LungSeg_01.png
文件 111336 2010-11-13 21:52 肺实质的提取\DataPackage\LungSeg_02.png
文件 45978 2010-11-13 21:52 肺实质的提取\DataPackage\LungSeg_03.png
文件 470454 2009-10-13 17:25 肺实质的提取\f.bmp
文件 1634 2010-11-13 21:52 肺实质的提取\LungSeg.m
目录 0 2011-01-17 16:12 肺实质的提取\DataPackage
目录 0 2011-01-17 16:12 肺实质的提取
----------- --------- ---------- ----- ----
779379 9
- 上一篇:matlab实现图像的配准,手动选点
- 下一篇:超分辨率重建的matlab代码
相关资源
- 高灵敏度GPS接收机MATLAB仿真,附捕获
- 基于MATLAB的质点弹道计算与外弹道优
- 阵列天线的matlab仿真
- MATLAB 经典程序源代码大全
- MATLAB小波软阈值去噪代码33473
- 天线阵的波束形成在MATLAB仿真程序及
- 非线性SVM算法-matlab实现
- 《MATLAB 智能算法超级学习手册》-程序
- 组合导航matlab程序
- 读取txt文件内容matlab代码实现
- Matlab实现基于相关的模板匹配程序
- matlab优化工具箱讲解
- 基于MATLAB的快速傅里叶变换
- 光纤传输中的分布傅立叶算法matlab实
- 基于matlab的图像处理源程序
- matlab 椭圆拟合程序
- 算术编码解码matlab源代码
- optical_flow 光流法 matlab 实现程序
- 引导图像滤波器 Matlab实现
- 分形几何中一些经典图形的Matlab画法
- OFDM系统MATLAB仿真代码
- SVM工具箱(matlab中运行)
- 图像小波变换MatLab源代码
- LU分解的MATLAB实现
- 冈萨雷斯数字图像处理matlab版(第三
- 替代数据法的matlab程序
- 用matlab实现的多站定位系统性能仿真
- 通过不同方法进行粗糙集属性约简m
- k近邻算法matlab实现
- matlab识别系统
评论
共有 条评论