Skip to content

Commit

Permalink
Suppress Scipy warning (#71)
Browse files Browse the repository at this point in the history
no more UserWarning: The behavior of affine_transform with a 1-D array
supplied for the matrix parameter has changed in SciPy 0.18.0.
  • Loading branch information
rhoadesScholar authored Feb 14, 2024
2 parents 453ce45 + 7577a4b commit 692c491
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dacapo/gp/elastic_augment_fuse.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,10 +486,15 @@ def _affine(self, array, scale, offset, target_roi, dtype=np.float32, order=1):
"""
ndim = array.shape[0]
output = np.empty((ndim,) + target_roi.get_shape(), dtype=dtype)
# Create a diagonal matrix if scale is a 1-D array
if np.isscalar(scale) or np.ndim(scale) == 1:
transform_matrix = np.diag(scale)
else:
transform_matrix = scale
for d in range(ndim):
scipy.ndimage.affine_transform(
input=array[d],
matrix=scale,
matrix=transform_matrix,
offset=offset,
output=output[d],
output_shape=output[d].shape,
Expand Down

0 comments on commit 692c491

Please sign in to comment.