Commit b235e4ad authored by Sean Fitzgibbon's avatar Sean Fitzgibbon
Browse files

Added alignment plot to slide_reg

parent c51b8c53
......@@ -363,6 +363,31 @@ def initialise_transformations(fixed, p):
# Return the full transformation chain
return Chain(*linear_chain, tx_nonlinear)
#TODO: This will fail if one of the registration steps was skipped. FIX it
def _plot_alignment(d):
fixed = plt.imread(f'{d}/fixed.png')
moving = ['rotation', 'rigid', 'affine', 'nonlinear']
N = len(moving)
fig, ax = plt.subplots(1, N, figsize=(N*5, 5))
for idx, (m0, ax0) in enumerate(zip(moving, ax)):
img = plt.imread(f'{d}/moving{idx+1}_{m0}.png')
ax0.imshow(fixed, cmap='Greys_r')
ax0.imshow(img, alpha=0.5, cmap='Reds_r')
fig.savefig(f'{d}/alignment.png', dpi=150)
def register(fixed, moving, cnf):
......@@ -464,6 +489,8 @@ def register(fixed, moving, cnf):
else:"Non-linear registration was skipped.")
def rotation_search2d(fixed, moving, cnf):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment