资源简介
可以一次批量读取多个患者放射治疗计划Dicom RTstructure,dose,plan文件并格式化输出DVH数据到excel的matlab代码;该代码文件内描述了需要输入的患者dicom文件的命名格式
代码片段和文件信息
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%
%% Code writer : Song Wei from jiangsu province hospital of t.c.m.
%% Reference : Anil Pyakuryal Northwestern Memorial Hospital / University of Illinois at ChicagoHART
%% Purpose: 格式化输出一批患者多种计划的DVH数据到excel文件,以便后续使用spss等统计软件比较 %%
function h =OuputDVHtoExcel()
%display(‘Customized Format of the cDVH analysis of DICOMRT plan.‘); fprintf(‘\n‘);
clc;
clear;
% Select Input / Output Patient Folders
folder = uigetdir(‘C:\‘‘SELECT PATIENT FOLDER‘);%open standard dialog box for selecting directory
%checkin = strcmp(folder‘C:\NWRR DIR\‘);
checkout = strcmp(folder‘0‘);
if (~isempty(folder) && checkout==0 )%not empmtynot‘C:\NWRR DIR\‘ and not ‘0‘
if(isdir(‘C:\INPUT‘))%if input exists then delete
rmdir(‘C:\INPUT‘‘s‘);%without s only empty folder can be deleted or error
end
mkdir(‘C:\INPUT‘);fprintf(‘\n‘);%creates a folder
copyfile(folder‘C:\INPUT‘);%copy files from folder to INPUT
[FileNamePathName] = uiputfile(‘.xlsx‘‘SELECT OUTPUT FOLDER‘‘C:\‘);%Open standard dialog box for saving files
end
% Counting the number of files in the Input Data folder and assigning files x (structure) and z (dose)
list=dir(‘C:\INPUT\*.dcm‘);
[a b] =size(list);
%the format of DICOM RT doseplan structure file names for each patient
%每个病人的DICOM 文件命名方式
%RD.2017007_p1.dcm
%RD.2017007_p2.dcm
%RP.2017007_p1.dcm
%RP.2017007_p2.dcm
%RS.2017007_.dcm
%RD.2017009_p1.dcm
%RD.2017009_p2.dcm
%RP.2017009_p1.dcm
%RP.2017009_p2.dcm
%RS.2017009_.dcm
%...
plantypes= 2;
patientnum= a/ (1+ 2* plantypes);%a/3; plantypes 个 RD RP file 1 个RS file per patient
ID=zeros(patientnum1);%interger %save the index in file list
RD=zeros(patientnumplantypes);
RS=zeros(patientnum1);
planname={‘p1‘‘p2‘};%可以超过两种计划,自行修改
Targets={‘PTV‘};
Structures={‘Lungs‘‘Cord_PRV‘‘Heart‘‘Body-P‘‘Brachial Plexus‘};
RP= zeros(patientnumplantypes);
% TdSet= PrescriptionDose*[0.95 1];%D Gyto get V95% V100% prescription dose 60 Gy for Targets.
% TdSetNameOutput= [95 100];%output name in the form of percent dose ie V95%
%
% TvSet= volt*[0.02 0.98 0.5];%V absolute volume cm3 to get D2% D98% D50%
% TvSetNameOutput= [2 98 50];%V% output name in the form of percent volume ie D2%
%
% SdSet=[51015203040505760];%V5 V10...Gy output name in the form of abs dose ie V5(Gy)
%
% SvSet= volt*[0.010.05];%V absolute volume cm3 to get D1%
% SvSetNameOutput= [1 5];%V% output name in the form of percent volume ie D2%
%%%%%%%%%%%%%%%%%%%%%%Initialize output variable array
%需要输出的靶区DVH参数,可自行修改
% Calculation of Target Volume Vd
TdSetNameOutput= [95 100];% V95% V100%
% Calculation of Target Dv
TvSetNameOutput= [2 98 50];% D2% D98% D50%
%%%%%%%%%%%%%%%%%%%%%%%Initialize output variable array
%需要输出的OARDVH参数,可自行修改
% Calculation of OA
- 上一篇:Matlab模拟三体系统
- 下一篇:TDOA/AOA定位的扩展卡尔曼滤波定位算法
相关资源
- MATLAB读取excel,循环读取每一行
- 多个TXt文件导入到Excel表格中内含Ex
- 如何将Excel中的数据导入MATLAB并在MA
-
MATLAB excelli
nk - 使用VC实现EXCEL的函数库
- matlab计算DH矩阵源码.7z
- DVHOP的MATLAB仿真代码
- 裸数据转成dicom图像格式
- DVHOP定位算法源程序MATLAB
- 无线传感器网络节点定位DVHOP算法在
- 利用matlab脚本将Excel文件can协议转换成
- matlab和excel接口技术-matlab和excel接口技
- 利用MATLAB生成Word和Excel文档
- 遗传算法求解excel多数据分析
- oct 处理代码
- 在Matlab GUI下实现CT切片序列(DICOM)的
- 谢中华_利用MATLAB生成Word和Excel文档
评论
共有 条评论