Skip to content

Commit

Permalink
tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
ncullen93 committed May 31, 2018
1 parent 227cf9d commit 7a09752
Show file tree
Hide file tree
Showing 3 changed files with 459 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ants/registration/create_warped_grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def create_warped_grid(image, grid_step=10, grid_width=2, grid_directions=(True,
gimage = image.new_image_like(garr)

if (transform is not None) and (fixed_reference_image is not None):
apply_transforms( fixed=fixed_reference_image, moving=gimage,
return apply_transforms( fixed=fixed_reference_image, moving=gimage,
transformlist=transform )
else:
return gimage
7 changes: 5 additions & 2 deletions ants/viz/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ def plot_grid(images, slices=None, axes=2,
... [mni3, mni4]])
>>> slices = np.asarray([[100, 100],
... [100, 100]])
>>> #axes = np.asarray([[2,2],[2,2]])
>>> # standard plotting
>>> ants.plot_grid(images=images, slices=slices, title='2x2 Grid')
>>> ants.plot_grid(images.reshape(1,4), slices.reshape(1,4), title='1x4 Grid')
Expand Down Expand Up @@ -324,7 +324,10 @@ def slice_image(img, axis, idx):
ax.add_patch(rect)

tmpimg = images[rowidx][colidx]
tmpaxis = axes[rowidx][colidx]
if isinstance(axes, int):
tmpaxis = axes
else:
tmpaxis = axes[rowidx][colidx]
sliceidx = slices[rowidx][colidx] if not one_slice else slices
tmpslice = slice_image(tmpimg, tmpaxis, sliceidx)
tmpslice = reorient_slice(tmpslice, tmpaxis)
Expand Down

0 comments on commit 7a09752

Please sign in to comment.