Пример #1
0
            '118_32':['/home/ian/Data/PROC_MR10032/118_32',\
                      '131221107523235119201012131413348979887031ep2dadvdiffDTI25x25x25STEAMs011a001','.bval','.bvec','.nii'],
            '64_32':['/home/ian/Data/PROC_MR10032/64_32',\
                     '1312211075232351192010121314035338138564502CBUDTI64InLea2x2x2s005a001','.bval','.bvec','.nii']}
       

def get_data(name='101_32'):    
    bvals=np.loadtxt(parameters[name][0]+'/'+parameters[name][1]+parameters[name][2])
    bvecs=np.loadtxt(parameters[name][0]+'/'+parameters[name][1]+parameters[name][3]).T
    img=nib.load(parameters[name][0]+'/'+parameters[name][1]+parameters[name][4])     
    return img.get_data(),bvals,bvecs


#siem64 =  nipy.load_image('/home/ian/Devel/dipy/dipy/core/tests/data/small_64D.gradients.npy')

data102,affine102,bvals102,dsi102=dcm.read_mosaic_dir('/home/ian/Data/Frank_Eleftherios/frank/20100511_m030y_cbu100624/08_ep2d_advdiff_101dir_DSI')

bvals102=bvals102.real
dsi102=dsi102.real

v362,f362 = sphere_vf_from('symmetric362')
v642,f642 = sphere_vf_from('symmetric642')

d = 0.0015
S0 = 100
f = [.33,.33,.33]
#f = [1.,0.]

b = 1200

#needles = np.array([-np.pi/4,np.pi/4])
Пример #2
0
dname_118='/home/eg01/Data/dipy_data/MR10032/CBU101205_MR10032/20100914_194720/Series_004_ep2d_advdiff_DTI_25x25x25_STEAM_118dir_b1000'

dname_64='/home/eg01/Data/dipy_data/MR10032/CBU101205_MR10032/20100914_194720/Series_003_CBU_DTI_64InLea_2x2x2'


series=[dname_101,dname_118,dname_64]

ALL_T=[]

for dname in series:
    
    
    t1=time()

    data,affine,bvals,gradients=dcm.read_mosaic_dir(dname)

    t2=time()
    print ('load data in %d secs' %(t2-t1))

    x,y,z,g = data.shape

    print('data shape is ',data.shape)

    #calculate QA
    gqs=gq.GeneralizedQSampling(data,bvals,gradients)
    print('gqs.QA.shape ',gqs.QA.shape)


    t3=time()
    print ('Generate QA in %d secs' %(t3-t2))
Пример #3
0
#dname ='/home/eg309/Data/Eleftherios/Series_003_CBU_DTI_64D_iso_1000'

S0name = '/tmp/S0.nii'

#smallname='/tmp/small_volume2.5_steam_4000.nii'

smallname = '/tmp/small_64D.nii'

smallname_grad = '/tmp/small_64D.gradients'

smallname_bvals = '/tmp/small_64D.bvals'

#read diffusion dicoms

data, affine, bvals, gradients = dcm.read_mosaic_dir(dname)

print data.shape

#calculate QA
#gqs = gq.GeneralizedQSampling(data,bvals,gradients)

#gqs.QA[0]

#S0 = data[:,:,:,0]
"""

#save the structural volume

#img=ni.Nifti1Image(S0,affine)