circular_trajectory_2d_fan#
- diffct.geometry.circular_trajectory_2d_fan(n_views, sid, sdd, start_angle=0.0, end_angle=None, device='cuda', dtype=torch.float32)[source]#
Generate circular trajectory geometry for 2D fan-beam CT.
Creates source and detector position matrices for a standard circular orbit around the origin, commonly used in 2D fan-beam CT imaging.
- Parameters:
n_views (int or torch.Tensor) – Number of projection views, or a nonempty finite floating angle vector in radians. Angle tensors preserve their dtype, device and autograd graph.
sid (float) – Source-to-Isocenter Distance (SID), in physical units.
sdd (float) – Source-to-Detector Distance (SDD), in physical units.
start_angle (float, optional) – Starting angle in radians (default: 0.0).
end_angle (float, optional) – Ending angle in radians (default: 2*pi, full rotation).
device (str or torch.device, optional) – Device for tensors (default: ‘cuda’).
dtype (torch.dtype, optional) – Data type for tensors (default: torch.float32).
- Returns:
src_pos (torch.Tensor) – Source positions, shape (n_views, 2).
det_center (torch.Tensor) – Detector center positions, shape (n_views, 2).
det_u_vec (torch.Tensor) – Detector u-direction unit vectors, shape (n_views, 2).
Examples
>>> src_pos, det_center, det_u_vec = circular_trajectory_2d_fan( ... n_views=360, sid=1000.0, sdd=1500.0, device='cuda' ... ) >>> print(src_pos.shape) # (360, 2)