Skip to content

Commit

Permalink
Merge pull request #7 from gschramm/main
Browse files Browse the repository at this point in the history
update README and clean up
  • Loading branch information
gschramm authored Nov 16, 2023
2 parents 72bbf60 + 2f07cc5 commit 9cc443d
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 458 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ jobs:
run: |
cd python
python start.py
python 00_simulate_lm_data.py
python 01_reconstruct_lm_data.py
- name: Cpp
run: |
Expand Down
2 changes: 1 addition & 1 deletion cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.12.0) # older would work, but could give warnings on policy CMP0074
project(PETSIRDUseCaseTemplate VERSION 0.1.0)
project(LMSimRecon VERSION 0.1.0)

set(CMAKE_CXX_STANDARD 17)

Expand Down
6 changes: 3 additions & 3 deletions python/00_simulate_lm_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import prd
import parallelproj
import utils
import parallelproj_utils
import array_api_compat.numpy as np
import matplotlib.pyplot as plt
from array_api_compat import to_device
Expand Down Expand Up @@ -41,7 +41,7 @@

# setup a line of response descriptor that describes the LOR start / endpoints of
# a "narrow" clinical PET scanner with 9 rings
lor_descriptor = utils.DemoPETScannerLORDescriptor(
lor_descriptor = parallelproj_utils.DemoPETScannerLORDescriptor(
xp, dev, num_rings=4, radial_trim=141
)

Expand Down Expand Up @@ -79,7 +79,7 @@
res_model = parallelproj.GaussianFilterOperator(
img_shape, sigma=4.5 / (2.355 * xp.asarray(voxel_size))
)
projector = utils.RegularPolygonPETProjector(
projector = parallelproj_utils.RegularPolygonPETProjector(
lor_descriptor, img_shape, voxel_size, resolution_model=res_model
)
projector.tof = True # set this to True to get a time of flight projector
Expand Down
8 changes: 4 additions & 4 deletions python/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PETSIRD basic Python example
# Simulation and Reconstruction of PETSIRD listmode data

This directory contains some instructions to wrote Python code to read/write PETSIRD data. You need to `yardl generate` in the `model` directory first.
This repository contains minimal python examples that simulate and reconstruct
PETSIRD listmode data using the [parallelproj](https://github.com/gschramm/parallelproj) projectors.

As we currently do not have a `set_up.py` for PETSIRD yet, the example file hard-codes the path to the generated files.
Alternatives would be to use the `PYTHONPATH` environment variable or symbolic links.
Before running the example python scripts, make sure to generate the PETSIRD yardl model.
216 changes: 0 additions & 216 deletions python/parallelproj_sim.py

This file was deleted.

Loading

0 comments on commit 9cc443d

Please sign in to comment.