petsird 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- petsird-0.2.0/PKG-INFO +35 -0
- petsird-0.2.0/README.md +41 -0
- petsird-0.2.0/README.pypi.md +10 -0
- petsird-0.2.0/petsird/__init__.py +76 -0
- petsird-0.2.0/petsird/_binary.py +1345 -0
- petsird-0.2.0/petsird/_dtypes.py +89 -0
- petsird-0.2.0/petsird/_ndjson.py +1194 -0
- petsird-0.2.0/petsird/binary.py +560 -0
- petsird-0.2.0/petsird/ndjson.py +1464 -0
- petsird-0.2.0/petsird/protocols.py +186 -0
- petsird-0.2.0/petsird/types.py +1186 -0
- petsird-0.2.0/petsird/version.py +16 -0
- petsird-0.2.0/petsird/yardl_types.py +303 -0
- petsird-0.2.0/petsird.egg-info/PKG-INFO +35 -0
- petsird-0.2.0/petsird.egg-info/SOURCES.txt +22 -0
- petsird-0.2.0/petsird.egg-info/dependency_links.txt +1 -0
- petsird-0.2.0/petsird.egg-info/requires.txt +1 -0
- petsird-0.2.0/petsird.egg-info/top_level.txt +1 -0
- petsird-0.2.0/petsird_analysis.py +70 -0
- petsird-0.2.0/petsird_generator.py +264 -0
- petsird-0.2.0/petsird_helpers.py +86 -0
- petsird-0.2.0/petsird_plot_scanner.py +107 -0
- petsird-0.2.0/pyproject.toml +45 -0
- petsird-0.2.0/setup.cfg +4 -0
petsird-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: petsird
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Library and tools for working with PET Emission Tomography Standardization Initiative Raw Data (PETSIRD) data
|
|
5
|
+
Author-email: Kris Thielemans <k.thielemans@ucl.ac.uk>
|
|
6
|
+
Maintainer-email: Casper da Costa-Luis <imaging@cdcl.ml>, Kris Thielemans <k.thielemans@ucl.ac.uk>
|
|
7
|
+
License: Apache-2.0
|
|
8
|
+
Project-URL: Homepage, https://etsinitiative.org
|
|
9
|
+
Project-URL: Repository, https://github.com/ETSInitiative/PETSIRD
|
|
10
|
+
Project-URL: Issues, https://github.com/ETSInitiative/PETSIRD/issues
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
20
|
+
Classifier: Intended Audience :: Science/Research
|
|
21
|
+
Classifier: Topic :: Scientific/Engineering :: Medical Science Apps.
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: numpy>=1.22
|
|
25
|
+
|
|
26
|
+
# PETSIRD Python SDK
|
|
27
|
+
|
|
28
|
+
The [Emission Tomography Standardization Initiative (ETSI)](https://etsinitiative.org/)
|
|
29
|
+
is working towards establishing a standard for PET Raw Data, called PETSIRD ("Positron Emission Tomography Standardization Initiative Raw Data").
|
|
30
|
+
|
|
31
|
+
Read & write PETSIRD data in Python.
|
|
32
|
+
|
|
33
|
+
## Examples
|
|
34
|
+
|
|
35
|
+
See [ETSInitiative/PETSIRD:python](https://github.com/ETSInitiative/PETSIRD/tree/main/python).
|
petsird-0.2.0/README.md
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# PETSIRD basic Python example
|
|
2
|
+
|
|
3
|
+
This directory contains some Python example code to read/write PETSIRD data.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
Some python code is generated by `yardl` and included in the PyPI distribution.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
python3 -m venv ~/petsirdenv
|
|
11
|
+
source ~/petsirdenv/bin/activate
|
|
12
|
+
pip install petsird
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Local Development
|
|
16
|
+
|
|
17
|
+
(This option needs the `yardl` binary, either download it, or use our devcontainer or GitHub CodeSpace.)
|
|
18
|
+
|
|
19
|
+
You need to `yardl generate` in the `model` directory first. This will create the Python package files in a `petsird`
|
|
20
|
+
subfolder.
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
cd ../model
|
|
24
|
+
yardl generate
|
|
25
|
+
pip install --editable ../python
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
The Python code shows piping the compact binary format to standard out and
|
|
31
|
+
reading it from standard in. This can be used as follows:
|
|
32
|
+
|
|
33
|
+
1. From the repo root `cd python`
|
|
34
|
+
1. `python petsird_generator.py | python petsird_analysis.py`
|
|
35
|
+
|
|
36
|
+
There is also a very basic utility to plot the scanner geometry. For instance
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
python petsird_generator.py > test.bin
|
|
40
|
+
python petsird_plot_scanner.py < test.bin
|
|
41
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# PETSIRD Python SDK
|
|
2
|
+
|
|
3
|
+
The [Emission Tomography Standardization Initiative (ETSI)](https://etsinitiative.org/)
|
|
4
|
+
is working towards establishing a standard for PET Raw Data, called PETSIRD ("Positron Emission Tomography Standardization Initiative Raw Data").
|
|
5
|
+
|
|
6
|
+
Read & write PETSIRD data in Python.
|
|
7
|
+
|
|
8
|
+
## Examples
|
|
9
|
+
|
|
10
|
+
See [ETSInitiative/PETSIRD:python](https://github.com/ETSInitiative/PETSIRD/tree/main/python).
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# This file was generated by the "yardl" tool. DO NOT EDIT.
|
|
2
|
+
|
|
3
|
+
# pyright: reportUnusedImport=false
|
|
4
|
+
from typing import Tuple as _Tuple
|
|
5
|
+
import re as _re
|
|
6
|
+
import numpy as _np
|
|
7
|
+
|
|
8
|
+
_MIN_NUMPY_VERSION = (1, 22, 0)
|
|
9
|
+
|
|
10
|
+
def _parse_version(version: str) -> _Tuple[int, ...]:
|
|
11
|
+
try:
|
|
12
|
+
return tuple(map(int, version.split(".")))
|
|
13
|
+
except ValueError:
|
|
14
|
+
# ignore any prerelease suffix
|
|
15
|
+
version = _re.sub(r"[^0-9.]", "", version)
|
|
16
|
+
return tuple(map(int, version.split(".")))
|
|
17
|
+
|
|
18
|
+
if _parse_version(_np.__version__) < _MIN_NUMPY_VERSION:
|
|
19
|
+
raise ImportError(f"Your installed numpy version is {_np.__version__}, but version >= {'.'.join(str(i) for i in _MIN_NUMPY_VERSION)} is required.")
|
|
20
|
+
|
|
21
|
+
from .yardl_types import *
|
|
22
|
+
from .types import (
|
|
23
|
+
AnnulusShape,
|
|
24
|
+
Atom,
|
|
25
|
+
BedMovementTimeBlock,
|
|
26
|
+
BoxShape,
|
|
27
|
+
BoxSolidVolume,
|
|
28
|
+
BulkMaterial,
|
|
29
|
+
CoincidenceEvent,
|
|
30
|
+
CoincidencePolicy,
|
|
31
|
+
Coordinate,
|
|
32
|
+
DetElEfficiencies,
|
|
33
|
+
DetectionEfficiencies,
|
|
34
|
+
DetectorModule,
|
|
35
|
+
Direction,
|
|
36
|
+
DirectionMatrix,
|
|
37
|
+
EventTimeBlock,
|
|
38
|
+
ExamInformation,
|
|
39
|
+
ExternalSignalTimeBlock,
|
|
40
|
+
ExternalSignalType,
|
|
41
|
+
ExternalSignalTypeEnum,
|
|
42
|
+
GantryMovementTimeBlock,
|
|
43
|
+
GenericSolidVolume,
|
|
44
|
+
GeometricShape,
|
|
45
|
+
Header,
|
|
46
|
+
Institution,
|
|
47
|
+
ModulePairEfficiencies,
|
|
48
|
+
ModulePairEfficienciesVector,
|
|
49
|
+
ModulePairSGIDLUT,
|
|
50
|
+
ReplicatedBoxSolidVolume,
|
|
51
|
+
ReplicatedDetectorModule,
|
|
52
|
+
ReplicatedGenericSolidVolume,
|
|
53
|
+
ReplicatedObject,
|
|
54
|
+
RigidTransformation,
|
|
55
|
+
ScannerGeometry,
|
|
56
|
+
ScannerInformation,
|
|
57
|
+
SolidVolume,
|
|
58
|
+
Subject,
|
|
59
|
+
TimeBlock,
|
|
60
|
+
TimeFrameInformation,
|
|
61
|
+
TimeInterval,
|
|
62
|
+
TripleEvent,
|
|
63
|
+
get_dtype,
|
|
64
|
+
)
|
|
65
|
+
from .protocols import (
|
|
66
|
+
PETSIRDReaderBase,
|
|
67
|
+
PETSIRDWriterBase,
|
|
68
|
+
)
|
|
69
|
+
from .binary import (
|
|
70
|
+
BinaryPETSIRDReader,
|
|
71
|
+
BinaryPETSIRDWriter,
|
|
72
|
+
)
|
|
73
|
+
from .ndjson import (
|
|
74
|
+
NDJsonPETSIRDReader,
|
|
75
|
+
NDJsonPETSIRDWriter,
|
|
76
|
+
)
|