Commit 6ca494d0 authored by Stephan Kuschel's avatar Stephan Kuschel
Browse files

fixing map_coordinates

Scipy intoduced another paramter for padding, which apparently was zero
before. Fixing this.

The scipy change is:
https://github.com/scipy/scipy/commit/9c299da04b9c419786a56c8e657aaabeb35f9069

Alex noted, that on his implementation, using the normal
`map_coordinates` function was really slow. (I am guessing due to extra
memory allocation), which is why he called the C-Function directly and
did all the checks within postpic. So keep it as is for really fast
coordinate mapping :)

Fix #261
parent 8f846920
......@@ -35,8 +35,10 @@ import warnings
import functools
import math
import numexpr as ne
import scipy
from scipy.ndimage import _ni_support, _nd_image, spline_filter
if sys.version_info[0:2] >= (3, 5):
from concurrent.futures import ThreadPoolExecutor
have_concurrent_futures = True
......@@ -284,8 +286,14 @@ def map_coordinates_parallel(input, coordinates, output=None, order=3, mode='con
def map_coordinates_chunk(arg):
sub_filtered, sub_coordinates, sub_output = arg
_nd_image.geometric_transform(sub_filtered, None, sub_coordinates, None, None,
sub_output, order, mode, cval, None, None)
if scipy.__version__ < '1.6.0':
_nd_image.geometric_transform(sub_filtered, None, sub_coordinates, None, None,
sub_output, order, mode, cval, None, None)
else:
# changed in scipy v1.6.0
# https://github.com/scipy/scipy/commit/9c299da04b9c419786a56c8e657aaabeb35f9069
_nd_image.geometric_transform(sub_filtered, None, sub_coordinates, None, None,
sub_output, order, mode, cval, 0, None, None)
if chunklen > 0:
list_of_chunk_args = list(chunk_arguments(filtered, coordinates, output))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment