Skip to content

Commit

Permalink
Merge pull request #49 from KrisThielemans/README_update
Browse files Browse the repository at this point in the history
README updates
  • Loading branch information
KrisThielemans authored Nov 1, 2024
2 parents 8f0531d + b8adf4a commit ae3a048
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
cppVersion: [17]
environment: pypi
permissions: {id-token: write}
name: Validate Python and C++${{ matrix.cppVersion }}
name: Validate Python and C++${{ matrix.cppVersion }} and deploy to PyPI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
/cpp/build/
/python/petsird/
__pycache__/
/python/build/
/python/petsird.egg*

# Common editor backups
/.vscode/
Expand Down
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PETSIRD draft data model and examples

The purpose of this repo is to have a simple working example of a data model for PET imaging (list mode data). This is **not complete**, and aspects do not follow the actual proposal of PETSIRD yet.
The purpose of this repo is to have a working example of a data model for PET imaging (list mode data). This is **not complete**, and aspects do not follow the actual proposal of PETSIRD yet.

## Background

Expand All @@ -9,9 +9,13 @@ is working towards establishing a standard for PET Raw Data, called PETSIRD ("PE

The specification uses the [yardl](https://aka.ms/yardl) tool to define the model.
`yardl` can be used to read the specification (in the `model` directory) and
generate an SDK for both C++ and API to read/write PETSIRD data.
generate an SDK for both C++ and Python to read/write PETSIRD data.

## To get started quickly:
## To get started as a Python user:

If you don't want to modify the yardl model, clone this repository and follow instructions in the [`python/README.md`](python/README.md).

## To get started quickly as a developer:

1. Open this repo in [GitHub Codespaces](https://code.visualstudio.com/docs/remote/codespaces) or
in a [VS Code devcontainer](https://code.visualstudio.com/docs/devcontainers/containers).
Expand All @@ -26,3 +30,5 @@ This codespace/container will contain all necessary tools, including `yardl` its

4. Have a look at (and try!) the examples in the [`cpp`](cpp/README.md) and/or
[`python`](python/README.md) directories.


27 changes: 26 additions & 1 deletion python/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,31 @@
# PETSIRD basic Python example

This directory contains some Python example code to read/write PETSIRD data. You need to `yardl generate` in the `model` directory first.
This directory contains some Python example code to read/write PETSIRD data.

## Install

Some python code is generated by `yardl` and included in the PyPI distribution.

```sh
python3 -m venv ~/petsirdenv
source ~/petsirdenv/bin/activate
pip install petsird
```

## Local Development

(This option needs the `yardl` binary, either download it, or use our devcontainer or GitHub CodeSpace.)

You need to `yardl generate` in the `model` directory first. This will create the Python package files in a `petsird`
subfolder.

```sh
cd ../model
yardl generate
pip install --editable ../python
```

## Usage

The Python code shows piping the compact binary format to standard out and
reading it from standard in. This can be used as follows:
Expand Down
10 changes: 10 additions & 0 deletions python/README.pypi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# PETSIRD Python SDK

The [Emission Tomography Standardization Initiative (ETSI)](https://etsinitiative.org/)
is working towards establishing a standard for PET Raw Data, called PETSIRD ("Positron Emission Tomography Standardization Initiative Raw Data").

Read & write PETSIRD data in Python.

## Examples

See [ETSInitiative/PETSIRD:python](https://github.com/ETSInitiative/PETSIRD/tree/main/python).
6 changes: 4 additions & 2 deletions python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
name = "petsird"
dynamic = ["version"]
description = "Library and tools for working with PET Emission Tomography Standardization Initiative Raw Data (PETSIRD) data"
readme = "README.md"
readme = "README.pypi.md"
authors = [
# TODO
{name = "Kris Thielemans", email = "[email protected]"},
Expand All @@ -28,7 +28,9 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3 :: Only"]
"Programming Language :: Python :: 3 :: Only",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering :: Medical Science Apps."]

[tool.setuptools.packages.find]
include = ["petsird", "petsird.*"]
Expand Down

0 comments on commit ae3a048

Please sign in to comment.