Skip to content

Commit 515b8b7

Browse files
committed
added zoom to mMR recon
1 parent 847ae09 commit 515b8b7

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

niftypet/nipet/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@
7979
from . import sigaux
8080
from .prj_sig import prjsig
8181

82-
from . import lm_sig
83-
from .lm_sig.hst_sig import lminfo_sig
82+
#from . import lm_sig
83+
#from .lm_sig.hst_sig import lminfo_sig
8484

8585
# > SynchroPET
8686
from . import synaux

niftypet/nipet/include/scanner_mmr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ struct Cnst {
117117
// float ICOSSTP;
118118

119119
float ETHRLD;
120+
121+
float ZOOM; // zoom for changing the voxel size and dimensions
120122
};
121123
//<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
122124

niftypet/nipet/prj/src/prj_module.cu

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,8 @@ static PyObject *frwd_prj(PyObject *self, PyObject *args, PyObject *kwargs) {
276276
Cnt.LOG = (char)PyLong_AsLong(pd_log);
277277
PyObject *pd_devid = PyDict_GetItemString(o_mmrcnst, "DEVID");
278278
Cnt.DEVID = (char)PyLong_AsLong(pd_devid);
279+
PyObject *pd_zoom = PyDict_GetItemString(o_mmrcnst, "zoom");
280+
Cnt.ZOOM = (float)PyFloat_AsDouble(pd_zoom);
279281

280282
/* Interpret the input objects as numpy arrays. */
281283
// axial LUTs:
@@ -471,6 +473,8 @@ static PyObject *back_prj(PyObject *self, PyObject *args, PyObject *kwargs) {
471473
Cnt.LOG = (char)PyLong_AsLong(pd_log);
472474
PyObject *pd_devid = PyDict_GetItemString(o_mmrcnst, "DEVID");
473475
Cnt.DEVID = (char)PyLong_AsLong(pd_devid);
476+
PyObject *pd_zoom = PyDict_GetItemString(o_mmrcnst, "zoom");
477+
Cnt.ZOOM = (float)PyFloat_AsDouble(pd_zoom);
474478

475479
/* Interpret the input objects as numpy arrays. */
476480
// axial LUTs:

niftypet/nipet/prj/src/prjb.cu

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,12 @@ void gpu_bprj(float *d_im, float *d_sino, float *li2rng, short *li2sn, char *li2
221221
nrng_c = NRINGS;
222222
nil2r_c = NLI2R;
223223
}
224-
// voxels in axial direction
225-
vz0 = 2 * Cnt.RNG_STRT;
226-
vz1 = 2 * (Cnt.RNG_END - 1);
227-
nvz = 2 * nrng_c - 1;
224+
225+
// voxels in axial direction (to accounting for the variable AFOV)
226+
vz0 = (int)Cnt.ZOOM * (2 * Cnt.RNG_STRT);
227+
vz1 = (int)Cnt.ZOOM * (2 * (Cnt.RNG_END - 1));
228+
nvz = (int)Cnt.ZOOM * (2 * nrng_c - 1);
229+
228230
if (Cnt.LOG <= LOGDEBUG) {
229231
printf("i> detector rings range: [%d, %d) => number of sinos: %d\n", Cnt.RNG_STRT,
230232
Cnt.RNG_END, snno);

niftypet/nipet/prj/src/prjf.cu

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,10 +238,12 @@ void gpu_fprj(float *d_sn, float *d_im, float *li2rng, short *li2sn, char *li2no
238238
nrng_c = NRINGS;
239239
nil2r_c = NLI2R;
240240
}
241+
241242
// voxels in axial direction
242-
vz0 = 2 * Cnt.RNG_STRT;
243-
vz1 = 2 * (Cnt.RNG_END - 1);
244-
nvz = 2 * nrng_c - 1;
243+
vz0 = (int)Cnt.ZOOM * (2 * Cnt.RNG_STRT);
244+
vz1 = (int)Cnt.ZOOM * (2 * (Cnt.RNG_END - 1));
245+
nvz = (int)Cnt.ZOOM * (2 * nrng_c - 1);
246+
245247
if (Cnt.LOG <= LOGDEBUG) {
246248
printf("i> detector rings range: [%d, %d) => number of sinos: %d\n", Cnt.RNG_STRT,
247249
Cnt.RNG_END, snno);

0 commit comments

Comments
 (0)