|
| 1 | +from __future__ import annotations |
| 2 | + |
1 | 3 | import logging |
2 | 4 | from dataclasses import dataclass, field |
3 | | -from typing import Optional, Tuple |
| 5 | +from typing import Tuple |
4 | 6 |
|
5 | 7 | import numpy as np |
6 | 8 | import scipy.interpolate |
@@ -68,8 +70,8 @@ def extract_skin_surface( |
68 | 70 | self, |
69 | 71 | volume: xa.Dataset, |
70 | 72 | quantile: float = 0.05, |
71 | | - scene_origin: Optional[Tuple[float, float, float]] = None, |
72 | | - scene_matrix: Optional[np.ndarray] = None): |
| 73 | + scene_origin: Tuple[float, float, float] | None = None, |
| 74 | + scene_matrix: np.ndarray | None = None): |
73 | 75 | """ |
74 | 76 | Extract skin surface from MRI volume in LPS coordinates |
75 | 77 |
|
@@ -131,8 +133,8 @@ def lps2pyr(self, l: float, p:float, s:float, origin: Tuple[float, float, float] |
131 | 133 | def get_transducer_pose( |
132 | 134 | self, |
133 | 135 | sph_coords: Tuple[float, float], |
134 | | - skin_origin: Optional[Tuple[float, float, float]] = None, |
135 | | - skin_interpolator: Optional[scipy.interpolate.LinearNDInterpolator] = None, |
| 136 | + skin_origin: Tuple[float, float, float] | None = None, |
| 137 | + skin_interpolator: scipy.interpolate.LinearNDInterpolator | None = None, |
136 | 138 | z_offset: float = 13.55, |
137 | 139 | dzdy: float = 0.15, |
138 | 140 | search_x: float = 20, |
@@ -249,8 +251,8 @@ def analyse_target_position( |
249 | 251 | self, |
250 | 252 | target: Point, |
251 | 253 | transducer_pose: np.ndarray, |
252 | | - radius_in_mm: Optional[float] = None, |
253 | | - steering_limits: Optional[Tuple[TargetConstraints, TargetConstraints, TargetConstraints]] = None): |
| 254 | + radius_in_mm: float | None = None, |
| 255 | + steering_limits: Tuple[TargetConstraints, TargetConstraints, TargetConstraints] | None = None): |
254 | 256 | """ |
255 | 257 | Analyzes the pose of a transducer relative to a specific target point. |
256 | 258 | Determines whether or not the target is within the transducer's steering limits and |
@@ -298,13 +300,13 @@ def analyse_target_position( |
298 | 300 | def run( |
299 | 301 | self, |
300 | 302 | target: Point, |
301 | | - pitch_range: Optional[Tuple[int, int]] = None, |
302 | | - pitch_step: Optional[int] = None, |
303 | | - yaw_range: Optional[Tuple[int, int]] = None, |
304 | | - yaw_step: Optional[int] = None, |
305 | | - radius_in_mm: Optional[float] = None, |
306 | | - steering_limits: Optional[Tuple[TargetConstraints]] = None, |
307 | | - blocked_elems_threshold: Optional[float] = None |
| 303 | + pitch_range: Tuple[int, int] | None = None, |
| 304 | + pitch_step: int | None = None, |
| 305 | + yaw_range: Tuple[int, int] | None = None, |
| 306 | + yaw_step: int | None = None, |
| 307 | + radius_in_mm: float | None = None, |
| 308 | + steering_limits: Tuple[TargetConstraints] | None = None, |
| 309 | + blocked_elems_threshold: float | None = None |
308 | 310 | ) -> ArrayTransform: |
309 | 311 | """ |
310 | 312 | VirtualFit main process. |
|
0 commit comments