Skip to content

Commit

Permalink
Merge pull request #33 from nipreps/maint/housekeeping
Browse files Browse the repository at this point in the history
FIX: Bad argument mapping in the new plot_gradients
Former-commit-id: b04ad89 [formerly c003d07]
Former-commit-id: bac0fde
Former-commit-id: 56aafcf
  • Loading branch information
oesteban committed Apr 12, 2021
2 parents f354f11 + 0124201 commit 1e134b6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 2 additions & 0 deletions eddymotion/dmri.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def logo_split(self, index, with_b0=False):
----------
index : :obj:`int`
Index of the DWI orientation to be left out in this fold.
with_b0 : :obj:`bool`
Insert the *b=0* reference at the beginning of the training dataset.
Return
------
Expand Down
8 changes: 5 additions & 3 deletions eddymotion/viz.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def draw_circles(positions, radius, n_samples=20):
return circles


def draw_points(gradients, ax, rad_min=0.3, rad_max=0.7, colormap="viridis"):
def draw_points(gradients, ax, rad_min=0.3, rad_max=0.7, cmap="viridis"):
"""
Draw the vectors on a shell.
Expand Down Expand Up @@ -168,7 +168,7 @@ def draw_points(gradients, ax, rad_min=0.3, rad_max=0.7, colormap="viridis"):
Minimum radius of the circle that renders a gradient direction
rad_max : :obj:`float` between 0 and 1
Maximum radius of the circle that renders a gradient direction
colormap : :obj:`matplotlib.pyplot.cm.ColorMap`
cmap : :obj:`matplotlib.pyplot.cm.ColorMap`
matplotlib colormap name
"""
Expand All @@ -184,8 +184,10 @@ def draw_points(gradients, ax, rad_min=0.3, rad_max=0.7, colormap="viridis"):
bvals = np.copy(gradients[3, :])
bvals = bvals / bvals.max()

if isinstance(cmap, (str, bytes)):
cmap = cm.get_cmap(cmap)

# Color map depending on bvalue (for visualization)
cmap = cm.get_cmap(colormap)
colors = cmap(bvals)

# Relative shell radii proportional to the inverse of bvalue (for visualization)
Expand Down

0 comments on commit 1e134b6

Please sign in to comment.