Skip to content

Commit

Permalink
Set minimum version for NumPy requirement (#532)
Browse files Browse the repository at this point in the history
* Add minimum NumPy version

* Revert "Convert array of axes to list of Python scalars"

This reverts commit e6f8e9c.
  • Loading branch information
fepegar authored May 12, 2021
1 parent c7af603 commit 4b766ea
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ furo
humanize
matplotlib
nibabel
numpy
numpy>=1.15
scipy
sphinx-copybutton
sphinx-gallery
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'Deprecated',
'humanize',
'nibabel',
'numpy',
'numpy>=1.15',
'scipy',
'torch>=1.1',
'tqdm',
Expand Down
2 changes: 1 addition & 1 deletion torchio/transforms/augmentation/spatial/random_flip.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def _ensure_axes_indices(subject, axes):
def _flip_image(image, axes):
spatial_axes = np.array(axes, int) + 1
data = image.numpy()
data = np.flip(data, axis=spatial_axes.tolist())
data = np.flip(data, axis=spatial_axes)
data = data.copy() # remove negative strides
data = torch.as_tensor(data)
image.set_data(data)

0 comments on commit 4b766ea

Please sign in to comment.