From a86a23118e13b617f9cb6c1b63b95309a84ff297 Mon Sep 17 00:00:00 2001
From: Pawel Markiewicz
Date: Wed, 8 May 2024 03:20:20 +0100
Subject: [PATCH] fixed span-3 histogramming
---
niftypet/nipet/lm_inv/hist_inv.py | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/niftypet/nipet/lm_inv/hist_inv.py b/niftypet/nipet/lm_inv/hist_inv.py
index 1f1f1abc..c09cbd8e 100644
--- a/niftypet/nipet/lm_inv/hist_inv.py
+++ b/niftypet/nipet/lm_inv/hist_inv.py
@@ -40,8 +40,14 @@ def hist_inv(datain, scanner_params, t0=0, t1=0, outpath='', frms=None, use_stor
txLUT = scanner_params['txLUT']
axLUT = scanner_params['axLUT']
- if Cnt['SPN'] == 1: nsinos = Cnt['NSN1']
- elif Cnt['SPN'] == 0: nsinos = Cnt['NSEG0']
+ if Cnt['SPN'] == 1:
+ nsinos = Cnt['NSN1']
+ elif Cnt['SPN'] == 3:
+ nsinos = Cnt['NSN3']
+ elif Cnt['SPN'] == 0:
+ nsinos = Cnt['NSEG0']
+ else:
+ raise ValueError('Unrecognised span.')
log.debug('histogramming with span {}.'.format(Cnt['SPN']))