List-mode processing and motion detection¶
The list-mode (LM) data is usually of large size in the order of GB. In NiftyPET, the LM data is hidden within image reconstruction function (see Basic PET image reconstruction) and processed automatically. However, the LM data can be processed separately to obtain histogrammed data (sinograms) as well as other statistics of the PET acquisition, including the head curves and motion detection.
After the following initialisation and input data specification (an example of amyloid brain acquisition is provided at Raw brain PET data [8]):
import sys, os, logging
from niftypet import nipet
# control the logging output
logging.basicConfig(level=logging.INFO)
# get all the scanner parameters (mMR)
mMRpars = nipet.get_mmrparams()
# Enter the path to the input data folder
folderin = '/path/to/input/data/folder/'
# automatically categorise the input data
datain = nipet.classify_input(folderin, mMRpars)
the LM data processing can be performed by running the following line:
hst = nipet.mmrhist(datain, mMRpars)
The direct prompt and delayed sinograms can be viewed by choosing the sinogram index below 127 and from 127 up to 836 for oblique sinograms, i.e.:
# sinogram index (<127 for direct sinograms, >=127 for oblique sinograms)
si = 60
# prompt sinogram
matshow(hst['psino'][si,:,:], cmap='inferno')
colorbar()
xlabel('bins')
ylabel('angles')
# delayed sinogram
matshow(hst['dsino'][si,:,:], cmap='inferno')
colorbar()
xlabel('bins')
ylabel('angles')
The head-curve, which is the total number of counts detected per second across the acquisition time, for the prompt and delayed data can be plotted as follows:
plot(hst['phc'], label='prompt')
plot(hst['dhc'], label='delayed')
legend()
grid('on')
xlabel('time')
ylabel('counts')
Motion detection¶
In order to get a general idea about the potential motion during the acquisition, the LM processing includes the centre of mass of the radiodistribution along the axial direction as one of the main directions of motion. This centre of mass information can be plotted as follows for the available dataset (Raw brain PET data):
plot(hst['cmass'])
grid('on')
xlabel('time')
ylabel('Centre of mas of radiodistribution')
which for the provided one-hour amyloid acquisition will produce:
For another amyloid acquisition with motion, the curve can look like this: