Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 12 additions & 8 deletions dask_image/ndinterp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
dispatch_spline_filter,
dispatch_spline_filter1d,
)
from ..ndfilters._utils import _get_depth_boundary
from ..ndfilters._utils import _get_depth_boundary, _update_wrapper

__all__ = [
"affine_transform",
Expand All @@ -37,22 +37,23 @@ def affine_transform(
output_chunks=None,
**kwargs
):
"""Apply an affine transform using Dask. For every
output chunk, only the slice containing the relevant part
"""Apply an affine transform using Dask.

For every output chunk, only the slice containing the relevant part
of the image is processed. Chunkwise processing is performed
either using `ndimage.affine_transform` or
`cupyx.scipy.ndimage.affine_transform`, depending on the input type.

Notes
-----
Differences to `ndimage.affine_transformation`:
Differences to `ndimage.affine_transformation`:
- currently, prefiltering is not supported
(affecting the output in case of interpolation `order > 1`)
- default order is 1
- modes 'reflect', 'mirror' and 'wrap' are not supported

Arguments equal to `ndimage.affine_transformation`,
except for `output_chunks`.
Arguments equal to `ndimage.affine_transformation`,
except for `output_chunks`.

Parameters
----------
Expand Down Expand Up @@ -266,7 +267,7 @@ def rotate(

Notes
-----
Differences to `ndimage.rotate`:
Differences to `ndimage.rotate`:
- currently, prefiltering is not supported
(affecting the output in case of interpolation `order > 1`)
- default order is 1
Expand Down Expand Up @@ -323,8 +324,8 @@ def rotate(
(512, 512)
>>> print(full_img_45.shape)
(724, 724)

"""

if not isinstance(input_arr, da.core.Array):
input_arr = da.from_array(input_arr)

Expand Down Expand Up @@ -418,9 +419,11 @@ def _get_default_depth(order, tol=1e-8):
Here depth is chosen as the smallest integer such that ``|p| ** n < tol``
where `|p|` is the magnitude of the largest pole in the IIR filter.
"""

return math.ceil(np.log(tol) / np.log(_maximum_pole[order]))


@_update_wrapper(scipy.ndimage.spline_filter)
def spline_filter(
image,
order=3,
Expand Down Expand Up @@ -478,6 +481,7 @@ def spline_filter(
return result


@_update_wrapper(scipy.ndimage.spline_filter1d)
def spline_filter1d(
image,
order=3,
Expand Down
3 changes: 1 addition & 2 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ can guide you through the process.
.. _conda: https://conda.io/en/latest/
.. _Miniforge: https://conda-forge.org/download/
.. _pip: https://pip.pypa.io
.. _Python installation guide:
http://docs.python-guide.org/en/latest/starting/installation/
.. _Python installation guide: http://docs.python-guide.org/en/latest/starting/installation/


From sources
Expand Down
6 changes: 3 additions & 3 deletions docs/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,11 @@ Here are some talks and slides that you can watch to learn dask-image:

- 2020, Genevieve Buckley's talk at PyConAU and SciPy Japan

- `Watch the talk in PyConAU <https://www.youtube.com/watch?v=MpjgzNeISeI&list=PLs4CJRBY5F1IEFq-wumrBDRCu2EqkpY-R&index=2>`_
- `Watch the talk <https://www.youtube.com/watch?v=MpjgzNeISeI&list=PLs4CJRBY5F1IEFq-wumrBDRCu2EqkpY-R&index=2>`_
- `Scipy Japanのトークを見る(プレゼンテーション:英語, 字幕:日本語) <https://www.youtube.com/watch?v=dP0m2iZX0PU>`_ Watch the talk at SciPy Japan (presentation in English, captions in Japanese)
- `See the slides <https://genevievebuckley.github.io/dask-image-talk-2020>`_

- 2019, John Kirkham's SciPy talk

- `Watch the talk <https://www.youtube.com/watch?v=XGUS174vvLs>`_
- `See the slides <https://nbviewer.ipython.org/format/slides/github/jakirkham/scipy2019/blob/master/slides.ipynb#/>`_
- `Watch the talk here <https://www.youtube.com/watch?v=XGUS174vvLs>`_
- `See the slides here <https://nbviewer.ipython.org/format/slides/github/jakirkham/scipy2019/blob/master/slides.ipynb#/>`_
Loading