-
Notifications
You must be signed in to change notification settings - Fork 15
/
main_merge_nodule_info.m
144 lines (121 loc) · 3.02 KB
/
main_merge_nodule_info.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
%% main function
clc;
clear;
%% selected patients who have ground truth
%% selected patients who have ground truth
selected = {'LIDC-IDRI-0072'
'LIDC-IDRI-0090'
'LIDC-IDRI-0138'
'LIDC-IDRI-0149'
'LIDC-IDRI-0162'
'LIDC-IDRI-0163'
'LIDC-IDRI-0166'
'LIDC-IDRI-0167'
'LIDC-IDRI-0168'
'LIDC-IDRI-0171'
'LIDC-IDRI-0178'
'LIDC-IDRI-0180'
'LIDC-IDRI-0183'
'LIDC-IDRI-0185'
'LIDC-IDRI-0186'
'LIDC-IDRI-0187'
'LIDC-IDRI-0191'
'LIDC-IDRI-0203'
'LIDC-IDRI-0211'
'LIDC-IDRI-0212'
'LIDC-IDRI-0233'
'LIDC-IDRI-0234'
'LIDC-IDRI-0242'
'LIDC-IDRI-0246'
'LIDC-IDRI-0247'
'LIDC-IDRI-0249'
'LIDC-IDRI-0256'
'LIDC-IDRI-0257'
'LIDC-IDRI-0265'
'LIDC-IDRI-0267'
'LIDC-IDRI-0268'
'LIDC-IDRI-0270'
'LIDC-IDRI-0271'
'LIDC-IDRI-0273'
'LIDC-IDRI-0275'
'LIDC-IDRI-0276'
'LIDC-IDRI-0277'
'LIDC-IDRI-0283'
'LIDC-IDRI-0286'
'LIDC-IDRI-0289'
'LIDC-IDRI-0290'
'LIDC-IDRI-0314'
'LIDC-IDRI-0325'
'LIDC-IDRI-0332'
'LIDC-IDRI-0377'
'LIDC-IDRI-0385'
'LIDC-IDRI-0399'
'LIDC-IDRI-0405'
'LIDC-IDRI-0454'
'LIDC-IDRI-0470'
'LIDC-IDRI-0493'
'LIDC-IDRI-0510'
'LIDC-IDRI-0522'
'LIDC-IDRI-0543'
'LIDC-IDRI-0559'
'LIDC-IDRI-0562'
'LIDC-IDRI-0568'
'LIDC-IDRI-0580'
'LIDC-IDRI-0610'
'LIDC-IDRI-0624'
'LIDC-IDRI-0766'
'LIDC-IDRI-0771'
'LIDC-IDRI-0811'
'LIDC-IDRI-0875'
'LIDC-IDRI-0905'
'LIDC-IDRI-0921'
'LIDC-IDRI-0924'
'LIDC-IDRI-0939'
'LIDC-IDRI-0965'
'LIDC-IDRI-0994'
'LIDC-IDRI-1002'
'LIDC-IDRI-1004'};
%% toolbox
addpath(genpath([pwd '/toolbox']))
%% module path values
util_path=[pwd '/util'];
input_path=[pwd '/io'];
%% module addpath
addpath(genpath(util_path));
addpath(genpath(input_path));
%% set global values
global path_nodule;
global path_data;
path_nodule = ['D:/works_lu_group/Projects/LungScreening/DATA/']; %pwd : returns the current directory
path_data = [pwd '/../../LIDC-IDRI/']; %dcm files directory
%% set values
iso_px_size=1; % a standard unit ('mm-unit')
%% directory paths
ct_img_path=[path_nodule '/CT_Images/'];
nrrd_img_path=[path_nodule '/LIDC-radiomics/'];
%% make directory
if ~isdir(ct_img_path); mkdir(ct_img_path); end
merged_nodule_info = [];
%% main process
for idx = 1:numel(selected)
pid = selected{idx};
if strcmp(pid, 'LIDC-IDRI-0405') == 0 || sum(strcmp(selected, pid)) == 0
continue
end
tic % tic starts a stopwatch timer
fprintf('%d %s\n', idx, pid);
%% input part
filename_input = [ct_img_path pid '_input.mat'];
load(filename_input);
if numel(nodule_info) == 0
continue
end
%% merge nodule info
merged_nodule_info = [merged_nodule_info; nodule_info(:,[1:3 5:6 10:12 15:17]) nodule_info.Characteristics];
end
writetable(merged_nodule_info, [nrrd_img_path 'nodule_info.csv'])
% module rmpath
% rmpath('./io');
% rmpath('./interpolation');
% rmpath('./segmentation');
% rmpath('./nodule_candidate_detection');