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
e4fa4640
Commit
e4fa4640
authored
Nov 27, 2020
by
sjromuel
Browse files
d
parent
6fe371a1
Changes
1
Hide whitespace changes
Inline
Side-by-side
RobinNet/dice_gt_seg.py
View file @
e4fa4640
...
...
@@ -80,7 +80,7 @@ def main():
seg
=
onehotencode
(
seg
,
autoencoder
=
True
)
slice_dsc
=
dice_loss
(
noisygt
,
seg
)
patient_dsc
.
append
(
slice_dsc
)
patient_dsc
.
append
(
slice_dsc
.
numpy
()
)
try
:
y_true_np
=
np
.
squeeze
(
seg
[
0
,
:,
:,
0
].
numpy
()
>
0.5
)
...
...
@@ -100,11 +100,9 @@ def main():
y_true3d
=
np
.
append
(
np
.
reshape
(
y_true_np
,
newshape
=
(
1
,
512
,
512
)),
y_true3d
,
axis
=
0
)
except
:
pass
print
(
"Dice Score for patient"
,
patientnumber
,
":"
,
np
.
mean
(
patient_dsc
))
dice_Score16
.
append
(
patient_dsc
)
try
:
hausdorff_distance_filter
=
sitk
.
HausdorffDistanceIm
gi
ageFilter
()
hausdorff_distance_filter
=
sitk
.
HausdorffDistanceImageFilter
()
hausdorff_distance_filter
.
Execute
(
sitk
.
GetImageFromArray
(
y_true3d
),
sitk
.
GetImageFromArray
(
y_pred3d
))
hdd3d
=
hausdorff_distance_filter
.
GetHausdorffDistance
()
...
...
@@ -113,7 +111,10 @@ def main():
except
:
pass
dice_Score16
.
append
(
np
.
mean
(
patient_dsc
))
print
(
"Dice Score for patient"
,
patientnumber
,
np
.
mean
(
patient_dsc
))
print
(
"All Dice-Scores for"
,
gt_type
,
":"
,
dice_Score16
)
print
(
"All 3d-HDDs for"
,
gt_type
,
": "
,
all3dhdds
)
print
(
"Dice-Score mean: "
,
np
.
mean
(
dice_Score16
))
print
(
"Dice-Score std: "
,
np
.
std
(
dice_Score16
))
...
...
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