Skip to content

Commit

Permalink
fixing errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ashmeigh committed Jul 18, 2024
1 parent 74e59c4 commit 75e17d4
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions mantidimaging/core/gpu/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def _create_block_and_grid_args(data: cp.ndarray):
return block_size, grid_size


def _create_padded_array(data: np.ndarray, filter_size: int, scipy_mode: str) -> np.ndarray:
def _create_padded_array(data, filter_size, scipy_mode):
"""
Creates the padded array on the CPU for the median filter.
:param data: The data array to be padded.
Expand All @@ -168,9 +168,7 @@ def _create_padded_array(data: np.ndarray, filter_size: int, scipy_mode: str) ->
"""
# Use the 'mode' argument that is ordinarily given to 'scipy' and determine its numpy.pad equivalent.
pad_size = _get_padding_value(filter_size)
pad_width = ((pad_size, pad_size), (pad_size, pad_size))
mode = EQUIVALENT_PAD_MODE.get(scipy_mode, 'constant')
return np.pad(data, pad_width=pad_width, mode=mode)
return np.pad(data, pad_width=((pad_size, pad_size), (pad_size, pad_size)), mode=EQUIVALENT_PAD_MODE[scipy_mode])


def _replace_gpu_array_contents(gpu_array: cp.ndarray, cpu_array: np.ndarray, stream: cp.cuda.Stream) -> None:
Expand Down

0 comments on commit 75e17d4

Please sign in to comment.