Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
sjromuel
Masterarbeit
Commits
d4d9085d
Commit
d4d9085d
authored
Nov 23, 2020
by
sjromuel
Browse files
f
parent
4ba8fda9
Changes
1
Show whitespace changes
Inline
Side-by-side
RobinNet/nets/BaseNetwork.py
View file @
d4d9085d
...
@@ -122,6 +122,8 @@ class BaseNetwork:
...
@@ -122,6 +122,8 @@ class BaseNetwork:
X_img_list
.
append
(
elem
)
X_img_list
.
append
(
elem
)
elif
elem
.
endswith
(
self
.
gt_type
+
".gipl.npy"
):
elif
elem
.
endswith
(
self
.
gt_type
+
".gipl.npy"
):
GT_img_list
.
append
(
elem
)
GT_img_list
.
append
(
elem
)
if
self
.
gt_type
==
"_mr_ctunetpred"
:
X_img_list
.
remove
(
"P17_mr_ctunetpred.gipl.npy"
)
list
.
sort
(
X_img_list
)
list
.
sort
(
X_img_list
)
list
.
sort
(
GT_img_list
)
list
.
sort
(
GT_img_list
)
...
@@ -160,6 +162,7 @@ class BaseNetwork:
...
@@ -160,6 +162,7 @@ class BaseNetwork:
def
train_test_split
(
self
,
number_patients
,
test_patients
=
(
1
,
2
),
X_img_list
=
[],
GT_img_list
=
[]):
def
train_test_split
(
self
,
number_patients
,
test_patients
=
(
1
,
2
),
X_img_list
=
[],
GT_img_list
=
[]):
train_data
=
[]
train_data
=
[]
test_data
=
[]
test_data
=
[]
for
i
in
range
(
len
(
X_img_list
)):
for
i
in
range
(
len
(
X_img_list
)):
if
X_img_list
[
i
].
startswith
(
'P'
+
str
(
test_patients
[
0
]).
zfill
(
2
)):
if
X_img_list
[
i
].
startswith
(
'P'
+
str
(
test_patients
[
0
]).
zfill
(
2
)):
test_data
.
append
([
X_img_list
[
i
],
GT_img_list
[
i
]])
test_data
.
append
([
X_img_list
[
i
],
GT_img_list
[
i
]])
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment