def test_srtm_zhou2003_voxelwise(self):
     results_img = SRTM_Zhou2003.volume_wrapper(
         ti=self.ti,
         refRegionMaskFile=self.refRegionMaskFile,
         startActivity=self.startActivity,
         weights=self.weights,
         fwhm=self.fwhm)
     '''
axes[1].set_ylabel('R1')
axes[1].legend()

# In[12]:

import temporalimage
ti = temporalimage.TemporalImage(TAC_img,
                                 np.eye(4),
                                 t - dt / 2,
                                 t + dt / 2,
                                 time_unit='min')

# In[13]:

results_img = SRTM_Zhou2003.volume_wrapper(ti=ti,
                                           refTAC=refTAC,
                                           fwhm=(2 * np.sqrt(2 * np.log(2))) *
                                           5)

# In[14]:

results_img.keys()

# In[15]:

results_img['BP']

# In[16]:

fig, axes = plt.subplots(1, 2, figsize=(10, 4))

axes[0].plot(results_img['BP'].flatten(), '.', label='Zhou 2003')
Esempio n. 3
0
local_install_path = 'H:\gitrepos\kineticmodel'
data_path = local_install_path + '/data/nru/'
# loading real volumetric data
inputTac_filename = os.path.join(data_path, 'input.mni305.2mm.sm6.nii.gz')
cerebMask_filename = os.path.join(data_path, 'cereb.mni305.2mm.nii.gz')
tim_filename = os.path.join(data_path, 'info_tim.csv')

inputTac = nib.load(inputTac_filename)
cerebMask = nib.load(cerebMask_filename)

# using Zhou's algorithm to run it
# Note: The srtm Lammertsmaa implementation is very slow in the volume and hence not shown here
results_img = SRTM_Zhou2003.volume_wrapper(
    timeSeriesImgFile=inputTac_filename,
    frameTimingCsvFile=tim_filename,
    refRegionMaskFile=cerebMask_filename,
    time_unit='s',
    startActivity='flat',
    fwhm=(2 * np.sqrt(2 * np.log(2))) * 5)

# In[2]:

results_img.keys()
BP_img = results_img['BP']

import matplotlib.pyplot as plt
get_ipython().magic('matplotlib inline')
plt.imshow(BP_img[:, :, 20])

# In[3]: