PtychographyGeometry#

class deepinv.physics.PtychographyGeometry(wavelength, object_detector_distance, detector_shape, detector_pixel_size)[source]#

Bases: ABC

Physical geometry of a ptychography setup.

Parameters:
  • wavelength (float) – Illumination wavelength \(\lambda\), in metres.

  • object_detector_distance (float) – Object-to-detector distance \(z\), in metres.

  • detector_shape (tuple[int, int]) – Number of detector pixels (height, width).

  • detector_pixel_size (tuple[float, float]) – Effective detector pixel size (dy, dx) \(\Delta_d\), in metres.

abstract property object_pixel_size: tuple[float, float]#

Pixel size in the object plane.

positions_to_shifts(positions, origin='center')[source]#

Convert scan positions in metres to integer pixel shifts, by dividing by object_pixel_size and rounding.

Parameters:
  • positions (torch.Tensor) – Scan positions in metres, of shape (N, 2) ordered (row, column).

  • origin (str, torch.Tensor) – Reference position subtracted before conversion, in metres. "center" subtracts the mean position, so shifts are centred on the scan. Pass a (2,) tensor to use another reference point.

Returns:

Integer shifts of shape (N, 2).

Return type:

Tensor

Examples using PtychographyGeometry:#

Ptychography phase retrieval

Ptychography phase retrieval