pytomography.io.PET.prd.binary#

Module Contents#

Classes#

BinaryPrdExperimentWriter

Binary writer for the PrdExperiment protocol.

BinaryPrdExperimentReader

Binary writer for the PrdExperiment protocol.

_CoincidenceEventSerializer

Abstract base class for generic types.

_SubjectSerializer

Abstract base class for generic types.

_InstitutionSerializer

Abstract base class for generic types.

_ExamInformationSerializer

Abstract base class for generic types.

_DetectorSerializer

Abstract base class for generic types.

_ScannerInformationSerializer

Abstract base class for generic types.

_HeaderSerializer

Abstract base class for generic types.

_TimeBlockSerializer

Abstract base class for generic types.

_TimeIntervalSerializer

Abstract base class for generic types.

_TimeFrameInformationSerializer

Abstract base class for generic types.

class pytomography.io.PET.prd.binary.BinaryPrdExperimentWriter(stream)[source]#

Bases: pytomography.io.PET.prd._binary.BinaryProtocolWriter, pytomography.io.PET.prd.protocols.PrdExperimentWriterBase

Binary writer for the PrdExperiment protocol.

Parameters:

stream (pytomography.io.PET.prd.protocols.typing.Union[pytomography.io.PET.prd.protocols.typing.BinaryIO, str]) –

_write_header(value)[source]#
Parameters:

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

Return type:

None

_write_time_blocks(value)[source]#
Parameters:

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

Return type:

None

class pytomography.io.PET.prd.binary.BinaryPrdExperimentReader(stream)[source]#

Bases: pytomography.io.PET.prd._binary.BinaryProtocolReader, pytomography.io.PET.prd.protocols.PrdExperimentReaderBase

Binary writer for the PrdExperiment protocol.

Parameters:

stream (pytomography.io.PET.prd.protocols.typing.Union[io.BufferedReader, io.BytesIO, pytomography.io.PET.prd.protocols.typing.BinaryIO, str]) –

_read_header()[source]#
Return type:

pytomography.io.PET.prd.protocols.Header

_read_time_blocks()[source]#
Return type:

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

class pytomography.io.PET.prd.binary._CoincidenceEventSerializer[source]#

Bases: pytomography.io.PET.prd._binary.RecordSerializer[pytomography.io.PET.prd.protocols.CoincidenceEvent]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
write(stream, value)[source]#
Parameters:
Return type:

None

write_numpy(stream, value)[source]#
Parameters:
Return type:

None

read(stream)[source]#
Parameters:

stream (pytomography.io.PET.prd._binary.CodedInputStream) –

Return type:

pytomography.io.PET.prd.protocols.CoincidenceEvent

class pytomography.io.PET.prd.binary._SubjectSerializer[source]#

Bases: pytomography.io.PET.prd._binary.RecordSerializer[pytomography.io.PET.prd.protocols.Subject]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
write(stream, value)[source]#
Parameters:
Return type:

None

write_numpy(stream, value)[source]#
Parameters:
Return type:

None

read(stream)[source]#
Parameters:

stream (pytomography.io.PET.prd._binary.CodedInputStream) –

Return type:

pytomography.io.PET.prd.protocols.Subject

class pytomography.io.PET.prd.binary._InstitutionSerializer[source]#

Bases: pytomography.io.PET.prd._binary.RecordSerializer[pytomography.io.PET.prd.protocols.Institution]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
write(stream, value)[source]#
Parameters:
Return type:

None

write_numpy(stream, value)[source]#
Parameters:
Return type:

None

read(stream)[source]#
Parameters:

stream (pytomography.io.PET.prd._binary.CodedInputStream) –

Return type:

pytomography.io.PET.prd.protocols.Institution

class pytomography.io.PET.prd.binary._ExamInformationSerializer[source]#

Bases: pytomography.io.PET.prd._binary.RecordSerializer[pytomography.io.PET.prd.protocols.ExamInformation]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
write(stream, value)[source]#
Parameters:
Return type:

None

write_numpy(stream, value)[source]#
Parameters:
Return type:

None

read(stream)[source]#
Parameters:

stream (pytomography.io.PET.prd._binary.CodedInputStream) –

Return type:

pytomography.io.PET.prd.protocols.ExamInformation

class pytomography.io.PET.prd.binary._DetectorSerializer[source]#

Bases: pytomography.io.PET.prd._binary.RecordSerializer[pytomography.io.PET.prd.protocols.Detector]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
write(stream, value)[source]#
Parameters:
Return type:

None

write_numpy(stream, value)[source]#
Parameters:
Return type:

None

read(stream)[source]#
Parameters:

stream (pytomography.io.PET.prd._binary.CodedInputStream) –

Return type:

pytomography.io.PET.prd.protocols.Detector

class pytomography.io.PET.prd.binary._ScannerInformationSerializer[source]#

Bases: pytomography.io.PET.prd._binary.RecordSerializer[pytomography.io.PET.prd.protocols.ScannerInformation]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
write(stream, value)[source]#
Parameters:
Return type:

None

write_numpy(stream, value)[source]#
Parameters:
Return type:

None

read(stream)[source]#
Parameters:

stream (pytomography.io.PET.prd._binary.CodedInputStream) –

Return type:

pytomography.io.PET.prd.protocols.ScannerInformation

class pytomography.io.PET.prd.binary._HeaderSerializer[source]#

Bases: pytomography.io.PET.prd._binary.RecordSerializer[pytomography.io.PET.prd.protocols.Header]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
write(stream, value)[source]#
Parameters:
Return type:

None

write_numpy(stream, value)[source]#
Parameters:
Return type:

None

read(stream)[source]#
Parameters:

stream (pytomography.io.PET.prd._binary.CodedInputStream) –

Return type:

pytomography.io.PET.prd.protocols.Header

class pytomography.io.PET.prd.binary._TimeBlockSerializer[source]#

Bases: pytomography.io.PET.prd._binary.RecordSerializer[pytomography.io.PET.prd.protocols.TimeBlock]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
write(stream, value)[source]#
Parameters:
Return type:

None

write_numpy(stream, value)[source]#
Parameters:
Return type:

None

read(stream)[source]#
Parameters:

stream (pytomography.io.PET.prd._binary.CodedInputStream) –

Return type:

pytomography.io.PET.prd.protocols.TimeBlock

class pytomography.io.PET.prd.binary._TimeIntervalSerializer[source]#

Bases: pytomography.io.PET.prd._binary.RecordSerializer[pytomography.io.PET.prd.protocols.TimeInterval]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
write(stream, value)[source]#
Parameters:
Return type:

None

write_numpy(stream, value)[source]#
Parameters:
Return type:

None

read(stream)[source]#
Parameters:

stream (pytomography.io.PET.prd._binary.CodedInputStream) –

Return type:

pytomography.io.PET.prd.protocols.TimeInterval

class pytomography.io.PET.prd.binary._TimeFrameInformationSerializer[source]#

Bases: pytomography.io.PET.prd._binary.RecordSerializer[pytomography.io.PET.prd.protocols.TimeFrameInformation]

Abstract base class for generic types.

A generic type is typically declared by inheriting from this class parameterized with one or more type variables. For example, a generic mapping type might be defined as:

class Mapping(Generic[KT, VT]):
    def __getitem__(self, key: KT) -> VT:
        ...
    # Etc.

This class can then be used as follows:

def lookup_name(mapping: Mapping[KT, VT], key: KT, default: VT) -> VT:
    try:
        return mapping[key]
    except KeyError:
        return default
write(stream, value)[source]#
Parameters:
Return type:

None

write_numpy(stream, value)[source]#
Parameters:
Return type:

None

read(stream)[source]#
Parameters:

stream (pytomography.io.PET.prd._binary.CodedInputStream) –

Return type:

pytomography.io.PET.prd.protocols.TimeFrameInformation