circular_trajectory_2d_parallel#

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

Generate circular trajectory geometry for 2D parallel-beam CT.

Creates ray direction and detector position matrices for a standard circular scanning geometry, commonly used in 2D parallel-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.

  • detector_distance (float, optional) – Transverse detector-origin offset along det_u (default: 0.0).

  • start_angle (float, optional) – Starting angle in radians (default: 0.0).

  • end_angle (float, optional) – Ending angle in radians (default: pi, half rotation for parallel beam).

  • device (str or torch.device, optional) – Device for tensors (default: ‘cuda’).

  • dtype (torch.dtype, optional) – Data type for tensors (default: torch.float32).

Returns:

  • ray_dir (torch.Tensor) – Ray direction unit vectors for each view, shape (n_views, 2).

  • det_origin (torch.Tensor) – Detector origin positions for each view, shape (n_views, 2).

  • det_u_vec (torch.Tensor) – Detector u-direction unit vectors for each view, shape (n_views, 2).

Examples

>>> ray_dir, det_origin, det_u_vec = circular_trajectory_2d_parallel(
...     n_views=180, device='cuda'
... )
>>> print(ray_dir.shape)  # (180, 2)