pytomography.io.PET.prd.types#

Module Contents#

Classes#

CoincidenceEvent

All information about a coincidence event specified as identifiers or indices (i.e. discretized).

Subject

Institution

ExamInformation

Items describing the exam (incomplete)

Detector

Detector ID and location. Units are in mm

ScannerInformation

Header

TimeBlock

TimeInterval

Time interval in milliseconds since start of acquisition

TimeFrameInformation

A sequence of time intervals (could be consecutive)

Functions#

_mk_get_dtype()

Attributes#

get_dtype

class pytomography.io.PET.prd.types.CoincidenceEvent(*, detector_1_id=0, detector_2_id=0, tof_idx=0, energy_1_idx=0, energy_2_idx=0)[source]#

All information about a coincidence event specified as identifiers or indices (i.e. discretized). TODO: this might take up too much space, so some/all of these could be combined in a single index if necessary.

Parameters:
  • detector_1_id (pytomography.io.PET.prd.yardl_types.UInt32) –

  • detector_2_id (pytomography.io.PET.prd.yardl_types.UInt32) –

  • tof_idx (pytomography.io.PET.prd.yardl_types.UInt32) –

  • energy_1_idx (pytomography.io.PET.prd.yardl_types.UInt32) –

  • energy_2_idx (pytomography.io.PET.prd.yardl_types.UInt32) –

detector_1_id: pytomography.io.PET.prd.yardl_types.UInt32[source]#
detector_2_id: pytomography.io.PET.prd.yardl_types.UInt32[source]#
tof_idx: pytomography.io.PET.prd.yardl_types.UInt32[source]#
energy_1_idx: pytomography.io.PET.prd.yardl_types.UInt32[source]#
energy_2_idx: pytomography.io.PET.prd.yardl_types.UInt32[source]#
__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

class pytomography.io.PET.prd.types.Subject(*, name=None, id='')[source]#
Parameters:
  • name (Optional[str]) –

  • id (str) –

name: str | None[source]#
id: str[source]#
__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

class pytomography.io.PET.prd.types.Institution(*, name='', address='')[source]#
Parameters:
  • name (str) –

  • address (str) –

name: str[source]#
address: str[source]#
__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

class pytomography.io.PET.prd.types.ExamInformation(*, subject=None, institution=None, protocol=None, start_of_acquisition=None)[source]#

Items describing the exam (incomplete)

Parameters:
subject: Subject[source]#
institution: Institution[source]#
protocol: str | None[source]#
start_of_acquisition: pytomography.io.PET.prd.yardl_types.DateTime | None[source]#
__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

class pytomography.io.PET.prd.types.Detector(*, id=0, x=0.0, y=0.0, z=0.0)[source]#

Detector ID and location. Units are in mm TODO: this is currently just a sample implementation with “point” detectors. We plan to have full shape information here.

Parameters:
  • id (pytomography.io.PET.prd.yardl_types.UInt32) –

  • x (pytomography.io.PET.prd.yardl_types.Float32) –

  • y (pytomography.io.PET.prd.yardl_types.Float32) –

  • z (pytomography.io.PET.prd.yardl_types.Float32) –

id: pytomography.io.PET.prd.yardl_types.UInt32[source]#
x: pytomography.io.PET.prd.yardl_types.Float32[source]#
y: pytomography.io.PET.prd.yardl_types.Float32[source]#
z: pytomography.io.PET.prd.yardl_types.Float32[source]#
__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

class pytomography.io.PET.prd.types.ScannerInformation(*, model_name=None, detectors=None, tof_bin_edges=None, tof_resolution=0.0, energy_bin_edges=None, energy_resolution_at_511=0.0, listmode_time_block_duration=0)[source]#
Parameters:
  • model_name (Optional[str]) –

  • detectors (Optional[list[Detector]]) –

  • tof_bin_edges (Optional[numpy.typing.NDArray[numpy.float32]]) –

  • tof_resolution (pytomography.io.PET.prd.yardl_types.Float32) –

  • energy_bin_edges (Optional[numpy.typing.NDArray[numpy.float32]]) –

  • energy_resolution_at_511 (pytomography.io.PET.prd.yardl_types.Float32) –

  • listmode_time_block_duration (pytomography.io.PET.prd.yardl_types.UInt32) –

model_name: str | None[source]#
detectors: list[Detector][source]#
tof_bin_edges: numpy.typing.NDArray[numpy.float32][source]#

edge information for TOF bins in mm (given as from first to last edge, so there is one more edge than the number of bins) TODO: this currently assumes equal size for each TOF bin, but some scanners “stretch” TOF bins depending on length of LOR

tof_resolution: pytomography.io.PET.prd.yardl_types.Float32[source]#

TOF resolution in mm

energy_bin_edges: numpy.typing.NDArray[numpy.float32][source]#

edge information for energy windows in keV (given as from first to last edge, so there is one more edge than the number of bins)

energy_resolution_at_511: pytomography.io.PET.prd.yardl_types.Float32[source]#

FWHM of photopeak for incoming gamma of 511 keV, expressed as a ratio w.r.t. 511

listmode_time_block_duration: pytomography.io.PET.prd.yardl_types.UInt32[source]#

duration of each time block in ms

number_of_detectors()[source]#
Return type:

pytomography.io.PET.prd.yardl_types.Size

number_of_tof_bins()[source]#
Return type:

pytomography.io.PET.prd.yardl_types.Size

number_of_energy_bins()[source]#
Return type:

pytomography.io.PET.prd.yardl_types.Size

__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

class pytomography.io.PET.prd.types.Header(*, scanner=None, exam=None)[source]#
Parameters:
scanner: ScannerInformation[source]#
exam: ExamInformation | None[source]#
__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

class pytomography.io.PET.prd.types.TimeBlock(*, id=0, prompt_events=None, delayed_events=None)[source]#
Parameters:
  • id (pytomography.io.PET.prd.yardl_types.UInt32) –

  • prompt_events (Optional[list[CoincidenceEvent]]) –

  • delayed_events (Optional[list[CoincidenceEvent]]) –

id: pytomography.io.PET.prd.yardl_types.UInt32[source]#

number of the block. Multiply with listmodeTimeBlockDuration to get time since startOfAcquisition

prompt_events: list[CoincidenceEvent][source]#

list of prompts in this time block TODO might be better to use !array

delayed_events: list[CoincidenceEvent] | None[source]#

list of delayed coincidences in this time block

__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

class pytomography.io.PET.prd.types.TimeInterval(*, start=0, stop=0)[source]#

Time interval in milliseconds since start of acquisition

Parameters:
  • start (pytomography.io.PET.prd.yardl_types.UInt32) –

  • stop (pytomography.io.PET.prd.yardl_types.UInt32) –

start: pytomography.io.PET.prd.yardl_types.UInt32[source]#
stop: pytomography.io.PET.prd.yardl_types.UInt32[source]#
__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

class pytomography.io.PET.prd.types.TimeFrameInformation(*, time_frames=None)[source]#

A sequence of time intervals (could be consecutive)

Parameters:

time_frames (Optional[list[TimeInterval]]) –

time_frames: list[TimeInterval][source]#
number_of_time_frames()[source]#
Return type:

pytomography.io.PET.prd.yardl_types.Size

__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

pytomography.io.PET.prd.types._mk_get_dtype()[source]#
pytomography.io.PET.prd.types.get_dtype[source]#