Add type hints to other dicom coords fns.
"""A suite of functions for handling DICOM coordinates"""
-from typing import Sequence
+from typing import Sequence, Tuple
from pymedphys._imports import numpy as np
from pymedphys._imports import pydicom # pylint: disable=unused-import
-def coords_from_xyz_axes(xyz_axes):
+def coords_from_xyz_axes(xyz_axes: Sequence["np.ndarray"]) -> "np.ndarray":
"""Converts a set of x, y and z axes of a regular grid (e.g. a DICOM
pixel array) into an array of three grids whose voxels correspond to
and contain the `x`, `y`, and `z` coordinates of the original grid.
@@ -52,7 +52,9 @@ def _orientation_is_head_first(orientation_vector, is_decubitus):
return np.abs(np.sum(orientation_vector)) == 2
-def xyz_axes_from_dataset(ds, coord_system="DICOM"):
+def xyz_axes_from_dataset(
+ ds: "pydicom.dataset.Dataset", coord_system: str = "DICOM"
+) -> Tuple["np.ndarray", "np.ndarray", "np.ndarray"]:
r"""Returns the x, y and z axes of a DICOM dataset's
pixel array in the specified coordinate system.
