Skip to content

Commit

Permalink
Add interpolation order to widget
Browse files Browse the repository at this point in the history
  • Loading branch information
jni committed Oct 30, 2023
1 parent 3f80361 commit 99eb2b7
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/affinder/apply_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ def _apply_affine_image(image, affine, order, reference_shape):
@magic_factory
def apply_affine(
reference_layer: 'napari.layers.Layer',
moving_layer: 'napari.layers.Layer'
moving_layer: 'napari.layers.Layer',
order: int = 0,
) -> 'napari.types.LayerDataTuple':
"""Apply current affine transformation to selected layer.
Expand All @@ -48,6 +49,8 @@ def apply_affine(
Layer to use as reference for affine transformation.
moving_layer : napari.layers.Layer
Layer to apply affine to.
order : int in {0, 1, 2, 3, 4, 5}
The order of the interpolation.
Returns
-------
Expand All @@ -64,7 +67,7 @@ def apply_affine(

# Apply the transformation
transformed = _apply_affine_image(
moving_layer.data, affine, 0, reference_layer.data.shape
moving_layer.data, affine, order, reference_layer.data.shape
)

# Set the metadata
Expand Down

0 comments on commit 99eb2b7

Please sign in to comment.