Skip to content

Commit

Permalink
adapt NEMA PET fitting example to new submodule structure
Browse files Browse the repository at this point in the history
  • Loading branch information
gschramm committed Feb 13, 2020
1 parent 3f263cd commit 1c818e7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
4 changes: 2 additions & 2 deletions examples/pet/nema_pet.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import pylab as py
import matplotlib.patches as patches

import pymirc.registration as pymr
import pymirc.metrics as pymr

from pymirc.image_operations import kul_aff, aff_transform

Expand Down Expand Up @@ -1210,7 +1210,7 @@ def fit_WB_NEMA_sphere_profiles(vol,
bgCOVs = np.array([x.bgcov for x in fitres])

retvals = {'fitres':fitres, 'fwhms':fwhms, 'Rs':Rs, 'Bs': Bs, 'Ss':Ss, 'a50RCs':a50RCs,
'meanRCs':meanRCs, 'maxRCs':maxRCs, 'bgCOVs':bgCOVs, 'subvols':subvols}
'meanRCs':meanRCs, 'maxRCs':maxRCs, 'bgCOVs':bgCOVs, 'subvols':subvols, 'vol':vol}

if showprofiles:
retvals['fig'] = fig
Expand Down
13 changes: 11 additions & 2 deletions examples/pet/wb_nema.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,20 @@
from scipy.io import readsav

import pymirc.fileio as pmf
import pymirc.viewer as pv

from nema_pet import fit_WB_NEMA_sphere_profiles

dcm = pmf.DicomVolume('mydcm_dir*.dcm')
dcm = pmf.DicomVolume('my_dcm_dir/*.dcm')
vol = dcm.get_data()
voxsize = dcm.voxsize

res = fit_WB_NEMA_sphere_profiles(vol, voxsize, Sfix = 16800, sm_fwhm = 4.5)
#res = fit_WB_NEMA_sphere_profiles(vol, voxsize, sm_fwhm = 4.5)
#res = fit_WB_NEMA_sphere_profiles(vol, voxsize, sm_fwhm = 4.5, Rfix = [18.5, 14., 11., 8.5, 6.5, 5.])
res = fit_WB_NEMA_sphere_profiles(vol, voxsize, sm_fwhm = 4.5, Rfix = [18.5, 14., 11., 8.5, 6.5, 5.], Sfix = 16914)

# show the n-th sphere sub volume
#pv.ThreeAxisViewer(res['subvols'][5], voxsize = voxsize, imshow_kwargs = {'vmin': 0, 'vmax': res['Ss'][0]})

# show the whole volume
#pv.ThreeAxisViewer(res['vol'], voxsize = voxsize, imshow_kwargs = {'vmin': 0, 'vmax': res['Ss'][0]})

0 comments on commit 1c818e7

Please sign in to comment.