Skip to content

Commit

Permalink
Added title and additional plots
Browse files Browse the repository at this point in the history
  • Loading branch information
nesh committed Dec 1, 2020
1 parent 1d7b844 commit d1744a6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions utils/tps_algo_visualizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ def pathology_with_tps_points(self):
moved = tps.warp()

img = moved.change_landmarks_reference(Origin.BOTTOM_LEFT)
print(img)

pathology = img()
h, w = pathology.shape[0:2]
Expand Down Expand Up @@ -103,6 +102,8 @@ def mri_with_affine_overlay(self):
size=POINT_SIZE,
# alpha=.25,
tools=['hover'])
).opts(
title="Mri and Pathology with affine landmarks"
)

def mri_with_affine_and_tps_overlay(self):
Expand Down Expand Up @@ -130,7 +131,7 @@ def mri_with_affine_and_tps_overlay(self):

return (
hv.Image(mri, bounds=(0, 0, fw, fh)).opts(cmap='gray')
* hv.RGB(pathology, bounds=(0, 0, pw, ph)).opts(alpha=.5)
* hv.RGB(tps, bounds=(0, 0, pw, ph)).opts(alpha=.5)
* hv.Points(fixed_points, label="mri points").opts(color='red',
size=POINT_SIZE,
alpha=.25,
Expand All @@ -143,6 +144,8 @@ def mri_with_affine_and_tps_overlay(self):
size=POINT_SIZE,
alpha=.25,
tools=['hover'])
).opts(
title="Mri and Pathology with affine and tps landmarks"
)

def mri_with_tps_overlay(self):
Expand Down Expand Up @@ -171,6 +174,8 @@ def mri_with_tps_overlay(self):
size=POINT_SIZE,
# alpha=.25,
tools=['hover'])
).opts(
title="Mri and Pathology with tps landmarks"
)

def panel(self):
Expand All @@ -179,12 +184,14 @@ def panel(self):
tps = self.pathology_with_tps_points()
overlay_affine = self.mri_with_affine_overlay()
overlay_tps = self.mri_with_tps_overlay()
overlay_affine_tps = self.mri_with_affine_and_tps_overlay()
return (
(mri
+ affined
+ tps
+ overlay_affine
+ overlay_tps
+ overlay_affine_tps
).opts(
width=VISUAL_WIDTH,
height=VISUAL_HEIGHT
Expand Down

0 comments on commit d1744a6

Please sign in to comment.