Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design2
/
2016104167
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
조현아
2020-04-15 00:07:13 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
bba51889cfa43bfae9d3867c1b52de083da8f2bd
bba51889
1 parent
f7c76b9c
get valid 10 frames
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
99 additions
and
0 deletions
code/shape_exception_handling.m
code/shape_exception_handling_all.m
code/shape_exception_handling.m
0 → 100644
View file @
bba5188
data_path
=
'..\data\MICCAI_BraTS_2019_Data_Training\HGG_seg_flair\BraTS19_CBICA_AVG_1_seg_flair.nii'
;
data
=
niftiread
(
data_path
);
cp_data
=
flipud
(
rot90
(
mat2gray
(
double
(
data
(:,:,
82
)))));
type
=
'.png'
;
filename
=
strcat
(
'BraTS19_CBICA_AVG_1_seg_flair_8'
,
type
);
% BraTS19_2013_2_1_seg_flair_c.png
outpath
=
strcat
(
'..\data\MICCAI_BraTS_2019_Data_Training\zero to valid\'
,
filename
);
imwrite
(
cp_data
,
outpath
);
% st, end 10
%% (circle 0, ellipse 0)
% BraTS19_CBICA_AOP_1_seg_flair_0
% BraTS19_CBICA_ASF_1_seg_flair_9 -> 8
% BraTS19_CBICA_ASR_1_seg_flair_8
% BraTS19_CBICA_ASR_1_seg_flair_9
% BraTS19_CBICA_AVG_1_seg_flair_9 -> 8
%
%
%
%
%
%
%
%
%
%
%
%
\ No newline at end of file
code/shape_exception_handling_all.m
0 → 100644
View file @
bba5188
getname_path
=
'..\data\MICCAI_BraTS_2019_Data_Training\zero2\'
;
inputheader
=
'..\data\MICCAI_BraTS_2019_Data_Training\HGG_seg_flair\'
;
outfolder
=
'..\data\MICCAI_BraTS_2019_Data_Training\zero to valid2\'
;
files
=
dir
(
getname_path
);
id
=
{
files
.
name
};
% files + dir file
flag
=
~
strcmp
(
id
,
'.'
)
&
~
strcmp
(
id
,
'..'
);
files
=
files
(
flag
);
% get filenames in getname_path folder
for
i
=
1
:
length
(
files
)
%id = split(files(i).name, '.nii');
fname
=
files
(
i
)
.
name
;
id
=
reverse
(
extractBetween
(
reverse
(
fname
),
7
,
strlength
(
fname
)));
data_path
=
convertCharsToStrings
(
strcat
(
inputheader
,
'\'
,
id
,
'.nii'
));
data
=
niftiread
(
data_path
);
fprintf
(
'ID #%d = %s\n'
,
i
,
data_path
);
idx
=
1
;
frames
=
zeros
(
1
,
1
);
for
j
=
1
:
z
n_nonblack
=
numel
(
find
(
data
(:,:,
j
)
>
0
));
if
(
n_nonblack
>
70
)
frames
(
idx
,
1
)
=
j
;
idx
=
idx
+
1
;
end
end
% for j = z : -1 : 1
% n_nonblack = numel(find(data(:,:,j) > 0));
% if(n_nonblack > 50)
% fprintf('%s: %d\n ','number: ', n_nonblack);
% en = j;
% break;
% end
% end
c
=
0
;
[
nrow
,
ncol
]
=
size
(
frames
);
step
=
round
(
nrow
/
11
);
% fprintf('%s: %d \n', 'nrow', nrow);
% fprintf('%s: %d\n ','st: ', frames(1, 1));
% fprintf('%s: %d\n ','end: ', frames(nrow, 1));
%disp(frames);
for
k
=
1
:
step
:
step
*
10
%fprintf('%d ', k);
fprintf
(
'%d '
,
frames
(
k
,
1
));
type
=
'.png'
;
filename
=
strcat
(
id
,
'_'
,
int2str
(
c
),
type
);
% BraTS19_2013_2_1_seg_flair_c.png
outpath
=
convertCharsToStrings
(
strcat
(
outfolder
,
filename
));
% typecase int16 to double, range[0, 1], rotate 90 and filp updown
% range [0, 1]
cp_data
=
flipud
(
rot90
(
mat2gray
(
double
(
data
(:,:,
frames
(
k
,
1
))))));
% M = max(cp_data(:));
% disp(M);
imwrite
(
cp_data
,
outpath
);
c
=
c
+
1
;
end
end
Please
register
or
login
to post a comment