Skip to content

Commit

Permalink
affine_transform: increased shape of required input array slices. Mod…
Browse files Browse the repository at this point in the history
…ified tests to reflect this requirement. (#216)
  • Loading branch information
m-albert committed May 14, 2021
1 parent eedd1b8 commit b931f7e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dask_image/ndinterp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def affine_transform(
rel_image_f[dim] = np.clip(rel_image_f[dim], 0, s - 1)

rel_image_slice = tuple([slice(int(rel_image_i[dim]),
int(rel_image_f[dim]) + 1)
int(rel_image_f[dim]) + 2)
for dim in range(n)])

rel_image = image[rel_image_slice]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ def validate_affine_transform(n=2,

# define (random) transformation
if matrix is None:
matrix = np.eye(n) + (np.random.random((n, n)) - 0.5) / 5.
# make sure to substantially deviate from unity matrix
matrix = np.eye(n) + (np.random.random((n, n)) - 0.5) * 5.
if offset is None:
offset = (np.random.random(n) - 0.5) / 5. * np.array(image.shape)

Expand Down

0 comments on commit b931f7e

Please sign in to comment.