Skip to content

Singles and dead-time correction in ECAT8 and PETSIRD - #1770

Open
AlanOsys wants to merge 8 commits into
UCL:masterfrom
AlanOsys:homeComp
Open

AlanOsys wants to merge 8 commits into
UCL:masterfrom
AlanOsys:homeComp

Conversation

@AlanOsys

@AlanOsys AlanOsys commented Oct 1, 2026

Copy link
Copy Markdown
Contributor

Changes in this pull request

  • Added ListSingles base class following ListTime/ListEvent pattern
  • Added is_singles()/singles() to CListRecord with default implementations
  • Decoded PETLINK singles words in CListRecordECAT8_32bit (type=1, subtype=1)
  • Added accumulating per-bucket singles in LmToProjData, write to JSON file
  • Added SinglesRatesFromJSON to read per-bucket singles rates
  • Added reading dtp/dtnp dead time parameters from ECAT8 norm binary file
  • Implemented combined paralysable/non-paralysable dead time formula in BinNormalisationFromECAT8 using real per-frame singles rates
  • Added storing pre-computed alive fractions in PETSIRD DeadTimeTimeBlock entries during STIR2PETSIRD conversion (Will create a pull request for dead-time in STIR2PETSIRD next)
  • Added reading DeadTimeTimeBlock entries in BinNormalisationFromPETSIRD with time-windowed selection for per-frame dead time correction
  • Added singles accumulation to CListModeDataPETSIRD for PETSIRD pipeline
  • I might have missed some debugging lines as this PR is not finalised

Testing performed

Performed full quantitative reconstruction on this: https://zenodo-rdm.web.cern.ch/records/4751233
It looks good, but ideally e7 tools can be used to compare the normalisation sinogram which I do not have access to at the moment.

Related issues

Checklist before requesting a review

  • I have performed a self-review of my code
  • The code builds and runs on my machine

Contribution Notes

Please tick the following:

- Add ListSingles base class following ListTime/ListEvent pattern
- Add is_singles()/singles() to CListRecord with default implementations
- Decode PETLINK singles words in CListRecordECAT8_32bit (type=1, subtype=1)
- Accumulate per-bucket singles in LmToProjData, write to JSON file
- Add SinglesRatesFromJSON to read per-bucket singles rates
- Read dtp/dtnp dead time parameters from ECAT8 norm binary file
- Implement combined paralysable/non-paralysable dead time formula
  in BinNormalisationFromECAT8 using real per-frame singles rates
- Store pre-computed alive fractions in PETSIRD DeadTimeTimeBlock entries
  during STIR2PETSIRD conversion (scanner-agnostic at reconstruction time)
- Read DeadTimeTimeBlock entries in BinNormalisationFromPETSIRD with
  time-windowed selection for per-frame dead time correction
- Release PETSIRD file reader after read_norm_data() to reduce memory usage
- Add singles accumulation to CListModeDataPETSIRD for PETSIRD pipeline
@codacy-production

codacy-production Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 70 complexity · 5 duplication

Metric Results
Complexity 70
Duplication 5

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

AlanOsys and others added 6 commits October 6, 2026 09:03
More accurate singles distribution, it is done properly per bucket now
Fixed the dead-time, turns out the scaling was incorrect
changed the file to resemble ECAT8 normalisation more
Updated with the new dead-time write to norm sino that works with per module singles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant