From f67e6c071316d1fa5fbd97d1afed8f4c5bd37e66 Mon Sep 17 00:00:00 2001 From: Marvin Albert Date: Thu, 8 Oct 2020 22:03:17 +0200 Subject: [PATCH] small fix --- mvregfus/multiview.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/mvregfus/multiview.py b/mvregfus/multiview.py index 197585d..1be6a48 100644 --- a/mvregfus/multiview.py +++ b/mvregfus/multiview.py @@ -1672,7 +1672,7 @@ def affine_transform_dask( ): try: - from cupy import asarray + from cupy import asarray, asnumpy import cupyx.scipy.ndimage as curr_ndimage gpu = True print('GPU acceleration for transformation') @@ -1717,6 +1717,9 @@ def transform_chunk(x, matrix, offset, input, kwargs, block_info=None): input_relevant = input[input_relevant_slice] + if not np.min(input_relevant.shape): + return np.zeros(x.shape, dtype=x.dtype) + # print('input_relevant_slice', input_relevant_slice) # modify offset due to cropped input @@ -1746,7 +1749,7 @@ def transform_chunk(x, matrix, offset, input, kwargs, block_info=None): # **kwargs) if gpu: - transformed_chunk = cp.asnumpy(transformed_chunk) + transformed_chunk = asnumpy(transformed_chunk) return transformed_chunk