pytomography.io.PET.prd.ndjson#

Module Contents#

Classes#

_CoincidenceEventConverter

Abstract base class for generic types.

_SubjectConverter

Abstract base class for generic types.

_InstitutionConverter

Abstract base class for generic types.

_ExamInformationConverter

Abstract base class for generic types.

_DetectorConverter

Abstract base class for generic types.

_ScannerInformationConverter

Abstract base class for generic types.

_HeaderConverter

Abstract base class for generic types.

_TimeBlockConverter

Abstract base class for generic types.

_TimeIntervalConverter

Abstract base class for generic types.

_TimeFrameInformationConverter

Abstract base class for generic types.

NDJsonPrdExperimentWriter

NDJson writer for the PrdExperiment protocol.

NDJsonPrdExperimentReader

NDJson writer for the PrdExperiment protocol.

class pytomography.io.PET.prd.ndjson._CoincidenceEventConverter[source]#

Bases: pytomography.io.PET.prd._ndjson.JsonConverter[pytomography.io.PET.prd.protocols.CoincidenceEvent, pytomography.io.PET.prd.protocols.np.void]

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
to_json(value)[source]#
Parameters:

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

Return type:

object

numpy_to_json(value)[source]#
Parameters:

value (pytomography.io.PET.prd.protocols.np.void) –

Return type:

object

from_json(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.CoincidenceEvent

from_json_to_numpy(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.np.void

class pytomography.io.PET.prd.ndjson._SubjectConverter[source]#

Bases: pytomography.io.PET.prd._ndjson.JsonConverter[pytomography.io.PET.prd.protocols.Subject, pytomography.io.PET.prd.protocols.np.void]

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
to_json(value)[source]#
Parameters:

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

Return type:

object

numpy_to_json(value)[source]#
Parameters:

value (pytomography.io.PET.prd.protocols.np.void) –

Return type:

object

from_json(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.Subject

from_json_to_numpy(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.np.void

class pytomography.io.PET.prd.ndjson._InstitutionConverter[source]#

Bases: pytomography.io.PET.prd._ndjson.JsonConverter[pytomography.io.PET.prd.protocols.Institution, pytomography.io.PET.prd.protocols.np.void]

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
to_json(value)[source]#
Parameters:

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

Return type:

object

numpy_to_json(value)[source]#
Parameters:

value (pytomography.io.PET.prd.protocols.np.void) –

Return type:

object

from_json(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.Institution

from_json_to_numpy(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.np.void

class pytomography.io.PET.prd.ndjson._ExamInformationConverter[source]#

Bases: pytomography.io.PET.prd._ndjson.JsonConverter[pytomography.io.PET.prd.protocols.ExamInformation, pytomography.io.PET.prd.protocols.np.void]

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
to_json(value)[source]#
Parameters:

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

Return type:

object

numpy_to_json(value)[source]#
Parameters:

value (pytomography.io.PET.prd.protocols.np.void) –

Return type:

object

from_json(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.ExamInformation

from_json_to_numpy(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.np.void

class pytomography.io.PET.prd.ndjson._DetectorConverter[source]#

Bases: pytomography.io.PET.prd._ndjson.JsonConverter[pytomography.io.PET.prd.protocols.Detector, pytomography.io.PET.prd.protocols.np.void]

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
to_json(value)[source]#
Parameters:

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

Return type:

object

numpy_to_json(value)[source]#
Parameters:

value (pytomography.io.PET.prd.protocols.np.void) –

Return type:

object

from_json(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.Detector

from_json_to_numpy(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.np.void

class pytomography.io.PET.prd.ndjson._ScannerInformationConverter[source]#

Bases: pytomography.io.PET.prd._ndjson.JsonConverter[pytomography.io.PET.prd.protocols.ScannerInformation, pytomography.io.PET.prd.protocols.np.void]

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
to_json(value)[source]#
Parameters:

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

Return type:

object

numpy_to_json(value)[source]#
Parameters:

value (pytomography.io.PET.prd.protocols.np.void) –

Return type:

object

from_json(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.ScannerInformation

from_json_to_numpy(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.np.void

class pytomography.io.PET.prd.ndjson._HeaderConverter[source]#

Bases: pytomography.io.PET.prd._ndjson.JsonConverter[pytomography.io.PET.prd.protocols.Header, pytomography.io.PET.prd.protocols.np.void]

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
to_json(value)[source]#
Parameters:

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

Return type:

object

numpy_to_json(value)[source]#
Parameters:

value (pytomography.io.PET.prd.protocols.np.void) –

Return type:

object

from_json(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.Header

from_json_to_numpy(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.np.void

class pytomography.io.PET.prd.ndjson._TimeBlockConverter[source]#

Bases: pytomography.io.PET.prd._ndjson.JsonConverter[pytomography.io.PET.prd.protocols.TimeBlock, pytomography.io.PET.prd.protocols.np.void]

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
to_json(value)[source]#
Parameters:

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

Return type:

object

numpy_to_json(value)[source]#
Parameters:

value (pytomography.io.PET.prd.protocols.np.void) –

Return type:

object

from_json(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.TimeBlock

from_json_to_numpy(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.np.void

class pytomography.io.PET.prd.ndjson._TimeIntervalConverter[source]#

Bases: pytomography.io.PET.prd._ndjson.JsonConverter[pytomography.io.PET.prd.protocols.TimeInterval, pytomography.io.PET.prd.protocols.np.void]

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
to_json(value)[source]#
Parameters:

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

Return type:

object

numpy_to_json(value)[source]#
Parameters:

value (pytomography.io.PET.prd.protocols.np.void) –

Return type:

object

from_json(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.TimeInterval

from_json_to_numpy(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.np.void

class pytomography.io.PET.prd.ndjson._TimeFrameInformationConverter[source]#

Bases: pytomography.io.PET.prd._ndjson.JsonConverter[pytomography.io.PET.prd.protocols.TimeFrameInformation, pytomography.io.PET.prd.protocols.np.void]

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
to_json(value)[source]#
Parameters:

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

Return type:

object

numpy_to_json(value)[source]#
Parameters:

value (pytomography.io.PET.prd.protocols.np.void) –

Return type:

object

from_json(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.TimeFrameInformation

from_json_to_numpy(json_object)[source]#
Parameters:

json_object (object) –

Return type:

pytomography.io.PET.prd.protocols.np.void

class pytomography.io.PET.prd.ndjson.NDJsonPrdExperimentWriter(stream)[source]#

Bases: pytomography.io.PET.prd._ndjson.NDJsonProtocolWriter, pytomography.io.PET.prd.protocols.PrdExperimentWriterBase

NDJson writer for the PrdExperiment protocol.

Parameters:

stream (pytomography.io.PET.prd.protocols.typing.Union[pytomography.io.PET.prd.protocols.typing.TextIO, 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.ndjson.NDJsonPrdExperimentReader(stream)[source]#

Bases: pytomography.io.PET.prd._ndjson.NDJsonProtocolReader, pytomography.io.PET.prd.protocols.PrdExperimentReaderBase

NDJson writer for the PrdExperiment protocol.

Parameters:

stream (pytomography.io.PET.prd.protocols.typing.Union[io.BufferedReader, pytomography.io.PET.prd.protocols.typing.TextIO, 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]