Skip to content

Commit 99cb996

Browse files
committed
reverting to tuple, changes to default values
1 parent 4b7def4 commit 99cb996

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

httomolibgpu/prep/alignment.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
else:
3434
map_coordinates = Mock()
3535

36-
from typing import Dict, List, Tuple, Union
36+
from typing import Dict, List, Tuple
3737

3838
__all__ = [
3939
"distortion_correction_proj_discorpy",
@@ -48,10 +48,10 @@
4848
def distortion_correction_proj_discorpy(
4949
data: cp.ndarray,
5050
metadata_path: str,
51-
shift: List[Union[int, int]] = [0, 0],
52-
step: List[Union[int, int]] = [1, 1],
53-
order: int = 1,
54-
mode: str = "reflect",
51+
shift_xy: List[int] = [0, 0],
52+
step_xy: List[int] = [1, 1],
53+
order: int = 3,
54+
mode: str = "constant",
5555
):
5656
"""Unwarp a stack of images using a backward model. See :cite:`vo2015radial`.
5757
@@ -64,18 +64,18 @@ def distortion_correction_proj_discorpy(
6464
The path to the file containing the distortion coefficients for the
6565
data.
6666
67-
shift: List, optional
67+
shift_xy: List[int]
6868
Centers of distortion in x (from the left of the image) and y directions (from the top of the image).
6969
70-
step: List, optional
70+
step_xy: List[int]
7171
Steps in x and y directions respectively. They need to be not larger than one.
7272
73-
order : int, optional.
74-
The order of the spline interpolation.
73+
order : int, optional
74+
The order of the spline interpolation, default is 3. Must be in the range 0-5.
7575
76-
mode : {'reflect', 'grid-mirror', 'constant', 'grid-constant', 'nearest',
77-
'mirror', 'grid-wrap', 'wrap'}, optional
78-
To determine how to handle image boundaries.
76+
mode : str, optional
77+
Points outside the boundaries of the input are filled according to the given mode
78+
('constant', 'nearest', 'mirror', 'reflect', 'wrap', 'grid-mirror', 'grid-wrap', 'grid-constant' or 'opencv').
7979
8080
Returns
8181
-------
@@ -91,8 +91,8 @@ def distortion_correction_proj_discorpy(
9191

9292
# Use preview information to offset the x and y coords of the center of
9393
# distortion
94-
det_x_step = step[0]
95-
det_y_step = step[1]
94+
det_x_step = step_xy[0]
95+
det_y_step = step_xy[1]
9696

9797
if det_y_step > 1 or det_x_step > 1:
9898
msg = (
@@ -103,8 +103,8 @@ def distortion_correction_proj_discorpy(
103103
)
104104
raise ValueError(msg)
105105

106-
det_x_shift = shift[0]
107-
det_y_shift = shift[1]
106+
det_x_shift = shift_xy[0]
107+
det_y_shift = shift_xy[1]
108108

109109
xcenter = xcenter - det_x_shift
110110
ycenter = ycenter - det_y_shift

0 commit comments

Comments
 (0)