资源简介
训练神经网络需要大量数据,目标检测中需要先进行标记。肺结节的检测非常普遍。现分享一个自己在胸部CT肺质标记的方法。

代码片段和文件信息
% (图像分割)MATLAB胸部CT肺质提取
% demo
% by HPC_ZY 20190718
clear; close all; clc
load imset % 数据集
showflag = 0; % 是否显示中间图像
imidx = 1; % 测试图像序号
im = im2double(imset{imidx});
%% 1.阈值分割
% 全局分割
imbi0 = imbinarize(im);
% 基于轮廓像素分割
Eidx = edge(im‘log‘); % 拉普拉斯获取边缘
E1 = im(Eidx); % 获取边缘像素
E1 = E1(E1>0);
imbi1 = imbinarize(imgraythresh(E1));
% 基于有效像素分割
E2 = im(im>0.02); % 获取非0像素
imbi2 = imbinarize(imgraythresh(E2));
if showflag
figure
subplot(221)imshow(im)title(‘\fontsize{16}原图‘)
subplot(222)imshow(imbi0)title(‘\fontsize{16}全局分割‘)
subplot(223)imshow(imbi1)title(‘\fontsize{16}基于轮廓像素分割‘)
subplot(224)imshow(imbi2)title(‘\fontsize{16}基于有效像素分割‘)
end
%% 2.提取人体部分
% 计算连通分量
[labelnum] = bwlabel(imbi0);
% 计算最大连通分量
MAX = 0;
for k = 1:num
maxtmp = sum(find(label==k));
if maxtmp>MAX
IDX = k;
MAX = maxtmp;
end
end
imbi = label==IDX;
if showflag
figure
subplot(121)imshow(imbi0)title(‘\fontsize{16}二值图‘)
subplot(122)imshow(imbi)title(‘\fontsize{16}胸腔‘)
end
%% 3.提取疑似肺质
imbiFull = imfill(imbi‘hole‘); % 填充
objtmp = imbiFull-imbi;
if showflag
figure
subplot(131)imshow(imbi)title(‘\fontsize{16}胸腔‘)
subplot(132)imshow(imbiFull)title(‘\fontsize{16}填充‘)
subplot(133)imshow(objtmp)title(‘\fontsize{16}疑似肺质‘)
end
%% 4.去除非肺质
P = 2000;
MASK = bwareaopen(objtmpP4); % 删除面积小于P的连通分量
if showflag
figure
subplot(131)imshow(objtmp)title(‘\fontsize{16}疑似肺质‘)
subplot(132)imshow(MASK)title(‘\fontsize{16}肺质MASK‘)
subplot(133)imshow(im)title(‘\fontsize{16}原图‘)
end
%% 5.其他优化操作
% 略
figure
subplot(221)imshow(im)title(‘\fontsize{16}原图‘)
subplot(222)imshow(imbi)title(‘\fontsize{16}胸腔‘)
subplot(223)imshow(objtmp)title(‘\fontsize{16}疑似肺质‘)
subplot(224)imshow(MASK)title(‘\fontsize{16}肺质MASK‘)
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 320835 2019-07-18 11:11 imset.mat
文件 2072 2019-07-18 11:18 demo.m
----------- --------- ---------- ----- ----
322907 2
- 上一篇:医学三维重建MATLAB体绘制算法:多层面重建MPR
- 下一篇:博弈对策matlab
相关资源
- Matlab路面裂缝识别69319
- 高灵敏度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实现
评论
共有 条评论