Skip to content

Commit 207461a

Browse files
committed
changed the docstring of misc.morph.data_resampler and recon.rotation.find_center_pcmethods to matches the pattern of other methods docstrings
1 parent 66ce152 commit 207461a

File tree

2 files changed

+38
-22
lines changed

2 files changed

+38
-22
lines changed

httomolibgpu/misc/morph.py

Lines changed: 21 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,29 @@ def sino_360_to_180(
104104
def data_resampler(
105105
data: cp.ndarray, newshape: list, axis: int = 1, interpolation: str = "linear"
106106
) -> cp.ndarray:
107-
"""Down/Up-resampler of the input data implemented through interpn function.
108-
Please note that the method will leave the specified axis
109-
dimension unchanged, e.g. (128,128,128) -> (128,256,256) for axis = 0 and
110-
newshape = [256,256].
111-
112-
Args:
113-
data (cp.ndarray): 3d cupy array.
114-
newshape (list): 2d list that defines the 2D slice shape of new shape data.
115-
axis (int, optional): Axis along which the scaling is applied. Defaults to 1.
116-
interpolation (str, optional): Selection of interpolation method. Defaults to 'linear'.
117-
118-
Raises:
107+
"""
108+
Down/Up-resampler of the input data implemented through interpn function.
109+
Please note that the method will leave the specified axis
110+
dimension unchanged, e.g. (128,128,128) -> (128,256,256) for axis = 0 and
111+
newshape = [256,256].
112+
113+
Parameters
114+
----------
115+
data : cp.ndarray
116+
3d cupy array.
117+
newshape : list
118+
2d list that defines the 2D slice shape of new shape data.
119+
axis : int, optional
120+
Axis along which the scaling is applied. Defaults to 1.
121+
interpolation : str, optional
122+
Selection of interpolation method. Defaults to 'linear'.
123+
124+
Raises
125+
----------
119126
ValueError: When data is not 3D
120127
121-
Returns:
128+
Returns
129+
----------
122130
cp.ndarray: Up/Down-scaled 3D cupy array
123131
"""
124132
expanded = False

httomolibgpu/recon/rotation.py

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -821,21 +821,29 @@ def find_center_pc(
821821
tol: float = 0.5,
822822
rotc_guess: Union[float, Optional[str]] = None,
823823
) -> float:
824-
"""Find rotation axis location by finding the offset between the first
824+
"""
825+
Find rotation axis location by finding the offset between the first
825826
projection and a mirrored projection 180 degrees apart using
826827
phase correlation in Fourier space.
827828
The `phase_cross_correlation` function uses cross-correlation in Fourier
828829
space, optionally employing an upsampled matrix-multiplication DFT to
829830
achieve arbitrary subpixel precision. See :cite:`guizar2008efficient`.
830831
831-
Args:
832-
proj1 (cp.ndarray): Projection from the 0th degree angle.
833-
proj2 (cp.ndarray): Projection from the 180th degree angle.
834-
tol (float, optional): Subpixel accuracy. Defaults to 0.5.
835-
rotc_guess (float, optional): Initial guess value for the rotation center. Defaults to None.
836-
837-
Returns:
838-
float: Rotation axis location.
832+
Parameters
833+
----------
834+
proj1 : cp.ndarray
835+
Projection from the 0th degree angle.
836+
proj2 : cp.ndarray
837+
Projection from the 180th degree angle.
838+
tol : float, optional
839+
Subpixel accuracy. Defaults to 0.5.
840+
rotc_guess : float, optional
841+
Initial guess value for the rotation center. Defaults to None.
842+
843+
Returns
844+
----------
845+
float
846+
Rotation axis location.
839847
"""
840848
imgshift = 0.0 if rotc_guess is None else rotc_guess - (proj1.shape[1] - 1.0) / 2.0
841849

0 commit comments

Comments
 (0)