pytomography.io.PET.prd.protocols#

Module Contents#

Classes#

PrdExperimentWriterBase

Abstract writer for the PrdExperiment protocol.

PrdExperimentReaderBase

Abstract reader for the PrdExperiment protocol.

class pytomography.io.PET.prd.protocols.PrdExperimentWriterBase[source]#

Bases: abc.ABC

Abstract writer for the PrdExperiment protocol.

schema = '{"protocol":{"name":"PrdExperiment","sequence":[{"name":"header","type":"Prd.Header"},{"name":"ti...'[source]#
__enter__()[source]#
__exit__(exc_type, exc, traceback)[source]#
Parameters:
  • exc_type (pytomography.io.PET.prd.types.typing.Optional[type[BaseException]]) –

  • exc (pytomography.io.PET.prd.types.typing.Optional[BaseException]) –

  • traceback (object) –

Return type:

None

write_header(value)[source]#

Ordinal 0

Parameters:

value (pytomography.io.PET.prd.types.Header) –

Return type:

None

write_time_blocks(value)[source]#

Ordinal 1

Parameters:

value (collections.abc.Iterable[pytomography.io.PET.prd.types.TimeBlock]) –

Return type:

None

abstract _write_header(value)[source]#
Parameters:

value (pytomography.io.PET.prd.types.Header) –

Return type:

None

abstract _write_time_blocks(value)[source]#
Parameters:

value (collections.abc.Iterable[pytomography.io.PET.prd.types.TimeBlock]) –

Return type:

None

abstract close()[source]#
Return type:

None

abstract _end_stream()[source]#
Return type:

None

_raise_unexpected_state(actual)[source]#
Parameters:

actual (int) –

Return type:

None

_state_to_method_name(state)[source]#
Parameters:

state (int) –

Return type:

str

class pytomography.io.PET.prd.protocols.PrdExperimentReaderBase[source]#

Bases: abc.ABC

Abstract reader for the PrdExperiment protocol.

schema[source]#
T[source]#
__enter__()[source]#
__exit__(exc_type, exc, traceback)[source]#
Parameters:
  • exc_type (pytomography.io.PET.prd.types.typing.Optional[type[BaseException]]) –

  • exc (pytomography.io.PET.prd.types.typing.Optional[BaseException]) –

  • traceback (object) –

Return type:

None

abstract close()[source]#
Return type:

None

read_header()[source]#

Ordinal 0

Return type:

pytomography.io.PET.prd.types.Header

read_time_blocks()[source]#

Ordinal 1

Return type:

collections.abc.Iterable[pytomography.io.PET.prd.types.TimeBlock]

copy_to(writer)[source]#
Parameters:

writer (PrdExperimentWriterBase) –

Return type:

None

abstract _read_header()[source]#
Return type:

pytomography.io.PET.prd.types.Header

abstract _read_time_blocks()[source]#
Return type:

collections.abc.Iterable[pytomography.io.PET.prd.types.TimeBlock]

_wrap_iterable(iterable, final_state)[source]#
Parameters:
  • iterable (collections.abc.Iterable[T]) –

  • final_state (int) –

Return type:

collections.abc.Iterable[T]

_raise_unexpected_state(actual)[source]#
Parameters:

actual (int) –

Return type:

None

_state_to_method_name(state)[source]#
Parameters:

state (int) –

Return type:

str