Permalink
Browse files

Updated the functions for producing the mosaic and animations with ge…

…neral parameters.

1) Removed the hard coded values (from earlier testing).
2) Made the code more generalized to accept the parameters from the user.
3) Slightly, modified the overlay_slices routine (from regtools.py) to return the
apprpriate slice to be used in the animation.
  • Loading branch information...
Parichit Sharma
Parichit Sharma committed Jul 18, 2018
1 parent 9c3e7cd commit 73d19cbc67271aea232b99c0dc4964d5b064ab67
Showing with 101 additions and 243 deletions.
  1. +7 −5 dipy/viz/regtools.py
  2. +94 −238 dipy/workflows/align.py
@@ -312,7 +312,7 @@ def plot_slices(V, slice_indices=None, fname=None):


def overlay_slices(L, R, slice_index=None, slice_type=1, ltitle='Left',
rtitle='Right', fname=None, ret_met=False):
rtitle='Right', fname=None, ret_slice=False):
r"""Plot three overlaid slices from the given volumes.
Creates a figure containing three images: the gray scale k-th slice of
@@ -344,9 +344,11 @@ def overlay_slices(L, R, slice_index=None, slice_type=1, ltitle='Left',
fname : string (optional)
the name of the file to write the image to. If None (default), the
figure is not saved to disk.
ret_slice_data : array, shape(S, R, C) (optional)
the k-th slice data after overlapping the k-th slice from the
L volume and the R volumne (default 'False')
ret_slice : boolean, (optional)
if true, the slice obtained by overlapping the k-th slice from the
L volume and the R volume will be returned (default 'False'). The
purpose of this is to visually assess the quality of registered
images.
"""

# Normalize the intensities to [0,255]
@@ -387,7 +389,7 @@ def overlay_slices(L, R, slice_index=None, slice_type=1, ltitle='Left',
colorImage[..., 0] = ll * (ll > ll[0, 0])
colorImage[..., 1] = rr * (rr > rr[0, 0])

if ret_met:
if ret_slice:
return colorImage

fig = _tile_plot([ll, colorImage, rr],
Oops, something went wrong.

0 comments on commit 73d19cb

Please sign in to comment.