@@ -63,8 +63,8 @@ def _crop_patch(
6363 index_ini , index_fin = location [:3 ], location [3 :]
6464
6565 # If the patch is not at the border, we crop half the overlap
66- crop_ini = half_overlap .copy ()
67- crop_fin = half_overlap .copy ()
66+ crop_ini : np . ndarray = half_overlap .copy ()
67+ crop_fin : np . ndarray = half_overlap .copy ()
6868
6969 # If the volume has been padded, we don't need to worry about cropping
7070 if self .volume_padded :
@@ -78,9 +78,17 @@ def _crop_patch(
7878 new_index_fin = index_fin - crop_fin
7979 new_location = np .hstack ((new_index_ini , new_index_fin ))
8080
81- patch_size = patch .shape [- 3 :]
81+ patch_size = np .asarray (patch .shape [- 3 :], dtype = int )
82+ crop_fin = crop_fin .astype (int )
8283 i_ini , j_ini , k_ini = crop_ini
8384 i_fin , j_fin , k_fin = patch_size - crop_fin
85+ # Make type checkers happy
86+ i_ini = int (i_ini )
87+ j_ini = int (j_ini )
88+ k_ini = int (k_ini )
89+ i_fin = int (i_fin )
90+ j_fin = int (j_fin )
91+ k_fin = int (k_fin )
8492 cropped_patch = patch [:, i_ini :i_fin , j_ini :j_fin , k_ini :k_fin ]
8593 return cropped_patch , new_location
8694
0 commit comments