pytomography.io.PET.petsird#

Module Contents#

Functions#

get_detector_ids(petsird_file[, read_tof, ...])

Read all time blocks of a PETSIRD listmode file

get_scanner_LUT_from_header(header)

Obtains the scanner lookup table (relating detector IDs to physical coordinates) from a PETSIRD header.

get_TOF_meta_from_header(header[, n_sigmas])

Obtain time of flight metadata from a PETSIRD header

pytomography.io.PET.petsird.get_detector_ids(petsird_file, read_tof=None, read_energy=None, time_block_ids=None, return_header=False)[source]#

Read all time blocks of a PETSIRD listmode file

Parameters:
  • petsird_file (str) – the PETSIRD listmode file

  • read_tof (bool | None, optional) – read the TOF bin information of every event default None means that is is auto determined based on the scanner information (length of tof bin edges)

  • read_energy (bool | None, optional) – read the energy information of every event default None means that is is auto determined based on the scanner information (length of energy bin edges)

  • time_block_ids (Sequence[int] | None) –

  • return_header (bool) –

Returns:

PRD listmode file header, 2D array containing all event attributes

Return type:

tuple[prd.types.Header, torch.Tensor]

pytomography.io.PET.petsird.get_scanner_LUT_from_header(header)[source]#

Obtains the scanner lookup table (relating detector IDs to physical coordinates) from a PETSIRD header.

Parameters:

header (prd.Header) – PETSIRD header

Returns:

scanner lookup table.

Return type:

torch.Tensor

pytomography.io.PET.petsird.get_TOF_meta_from_header(header, n_sigmas=3.0)[source]#

Obtain time of flight metadata from a PETSIRD header

Parameters:
  • header (prd.Header) – PETSIRD header

  • n_sigmas (float, optional) – Number of sigmas to consider when performing TOF projection. Defaults to 3..

Returns:

Time of flight metadata.

Return type:

PETTOFMeta