#Load needed libraries import numpy as np, nibabel as nib, nagini, sys, scipy.optimize as opt import scipy.interpolate as interp, matplotlib.pyplot as plt, matplotlib.gridspec as grid import scipy.ndimage.filters as filt, scipy.spatial as spat from tqdm import tqdm #Ignore invalid and overflow warnings np.seterr(invalid='ignore', over='ignore') ######################### ###Data Pre-Processing### ######################### print('Loading images...') #Load in the dta file dta = nagini.loadDta(args.dta[0]) #Load in the info file info = nagini.loadInfo(args.info[0]) #Load image headers pet = nagini.loadHeader(args.pet[0]) roi = nagini.loadHeader(args.roi[0]) cbf = nagini.loadHeader(args.cbf[0]) cbv = nagini.loadHeader(args.cbv[0]) #Check to make sure dimensions match if pet.shape[3] != info.shape[0] or pet.shape[0:3] != roi.shape[ 0:3] or pet.shape[0:3] != cbf.shape[0:3] or pet.shape[ 0:3] != cbv.shape[0:3]: print 'ERROR: Data dimensions do not match. Please check...'
#Load needed libraries import numpy as np, nibabel as nib, nagini, sys, scipy.optimize as opt import scipy.interpolate as interp, matplotlib.pyplot as plt, matplotlib.gridspec as grid import scipy.ndimage.filters as filt from tqdm import tqdm #Ignore invalid and overflow warnings np.seterr(invalid='ignore',over='ignore') ######################### ###Data Pre-Processing### ######################### print ('Loading images...') #Load in the dta file dta = nagini.loadDta(args.dta[0]) #Load in the info file info = nagini.loadInfo(args.info[0]) #Load image headers pet = nagini.loadHeader(args.pet[0]) cbf = nagini.loadHeader(args.cbf[0]) cbv = nagini.loadHeader(args.cbv[0]) #Check to make sure dimensions match if pet.shape[3] != info.shape[0] or pet.shape[0:3] != cbf.shape[0:3] or pet.shape[0:3] != cbv.shape[0:3] : print 'ERROR: Data dimensions do not match. Please check...' sys.exit() #Brain mask logic