circular_trajectory_3d#

diffct.geometry.circular_trajectory_3d(n_views, sid, sdd, start_angle=0.0, end_angle=None, device='cuda', dtype=torch.float32)[source]#

Generate circular trajectory geometry for cone-beam CT.

Creates source and detector position matrices for a standard circular orbit around the z-axis, commonly used in cone-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, 3).

  • det_center (torch.Tensor) – Detector center positions, shape (n_views, 3).

  • det_u_vec (torch.Tensor) – Detector u-direction unit vectors, shape (n_views, 3).

  • det_v_vec (torch.Tensor) – Detector v-direction unit vectors, shape (n_views, 3).

Examples

>>> src_pos, det_center, det_u_vec, det_v_vec = circular_trajectory_3d(
...     n_views=360, sid=1000.0, sdd=1500.0, device='cuda'
... )
>>> print(src_pos.shape)  # (360, 3)