✅作者简介:热爱科研的Matlab仿真开发者,修心和技术同步精进,matlab项目合作可私信。
🍎个人主页:Matlab科研工作室
🍊个人信条:格物致知。
更多Matlab仿真内容点击👇
⛄ 内容介绍
肺癌是世界范围内发病率及致死率最高的恶性肿瘤之一,每年造成上百万人死亡。如能在肺癌早期及早发现病灶并进行治疗,可极大提高患者的生存率。肺癌早期的表现形式是肺结节,肺结节一般是指肺内的高密度类圆形病灶。传统医学通过医生肉眼阅读肺部CT扫描图像来检测肺结节,进而进行病情诊断。随着CT扫描技术的提高,单一CT层片越来越薄,一次扫描的CT层数越来越多,这给诊断医生带来了巨大的工作压力,因人为因素导致的误诊也越来越多,甚至影响到患者疾病的准确诊断。为了辅助医生提高诊断的准确性、提高阅片的效率,科研人员开始研制肺部CAD(computer assist diagnose)即计算机辅助诊断系统来辅助医生进行自动或半自动的病情诊断。 由于肺结节形态复杂,且易与肺部其他组织粘连,即使是有丰富经验的医生也需要通过观察病史及进行穿刺等医学手段进行确诊。因此,我们辅助检测的目的仅是将疑似肺结节区域在肺部图像中标记出来,辅助医生判断。肺结节检测的第一步是实现肺实质分割,只有首先分割出肺实质,才能对肺部CT图像进行针对性的处理。
⛄ 部分代码
%%% This code is written by Heewon Chung, a member of BAMI LAB %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Load Lung Data and Setting Parameters
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
load('lungData.mat'); % Sample Lung Data
THec = 38; % Threshold about Ellipse & Circle percent
THiop = 50; % Threshold about in & out percent
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Chanvese Code
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
getLung = FindGlobalLung(lungData); % Input the Dicom lung image
getContour = FindContour(getLung); % Get Contour from get Lung
figure; imshow(getLung);
hold on; plot(getContour{1}(:, 1), getContour{1}(:, 2), 'r', 'LineWidth', 2); % Left Lung
hold on; plot(getContour{2}(:, 1), getContour{2}(:, 2), 'r', 'LineWidth', 2); % Right Lung
close all;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Filtering using Chanvese result lung
%%% juxta-pleural nodule segmentation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
anglePoint = FindAngle(getLung, getContour); % Find concave point in binary lung image
[erContour, erLung] = ExpandReduceCorrLung(preData, preContour, getContour); % get Expand and Reduce Model(erModel) from n-1 final Lung
diffArea = DifferenceArea(erLung, getLung); % difference Area of erModel Lung and Current Lung
angleArea = RemainAngleArea(diffArea, anglePoint); % Find angle Points for difference Area
sharpenArea = FunctionSharpen(lungData, angleArea, getContour); % Sharpness
ecArea = EllipseAndCircularCorrelation(sharpenArea, THec); % get Ellipse and Circular Correlation
inoutArea = FunctionInoutLungArea(ecArea, getLung, THiop); % get In & Out calculation
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% Final Lung
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
addFinalLung = logical(imadd(inoutArea, getLung));
fillFinalLung = imfill(addFinalLung, 'hole');
finalLung = fillFinalLung;
finalContour = FindContour(finalLung);
clearvars -except preData getLung getContour lungData finalLung finalContour
figure;
subplot(2, 2, 1); imshow(preData); title('n-1 Final Lung');
subplot(2, 2, 2); imshow(getLung); title('n Chanvese Lung');
subplot(2, 2, 3); imshow(lungData); title('n Chanvese Lung');
hold on; plot(getContour{1}(:, 1), getContour{1}(:, 2), 'b', 'LineWidth', 2);
hold on; plot(getContour{2}(:, 1), getContour{2}(:, 2), 'b', 'LineWidth', 2);
subplot(2, 2, 4); imshow(lungData); title('n Final Lung');
hold on; plot(finalContour{1}(:, 1), finalContour{1}(:, 2), 'r', 'LineWidth', 2);
hold on; plot(finalContour{2}(:, 1), finalContour{2}(:, 2), 'r', 'LineWidth', 2);
figure
ROC_data = roc_curve(getLung(:), preData(:));
⛄ 运行结果
⛄ 参考文献
[1]杨谊, 喻德旷, 申洪. 用基于主动轮廓模型的方法分割肺部病理CT图像病灶[C]// 中国计算机学会. 中国计算机学会, 2005.
[2]石国良. 基于肺实质分割的肺结节检测系统研究与实现[D]. 重庆大学.