ddsfit = dds.fit(SS) ddsodf = ddsfit.odf(sphere) ddsdir, _, _ = peak_directions(ddsodf, sphere, .35, 15) print angular_similarity(sticks, ddsdir) grid_size = 35 ds = DiffusionSpectrumModel(gtab_full, qgrid_size=grid_size, r_start=0.2 * (grid_size // 2), r_end=0.7 * (grid_size // 2), r_step=0.02 * (grid_size // 2), filter_width=np.inf, normalize_peaks=False) dsfit = ds.fit(SS) dsodf = dsfit.odf(sphere) dsdir, _, _ = peak_directions(dsodf, sphere, .35, 15) print angular_similarity(sticks, dsdir) show_odfs(gqodf[None, None, None, :], sphere) show_odfs(dsodf[None, None, None, :], sphere) show_odfs(ddsodf[None, None, None, :], sphere)
bvals, bvecs = read_bvals_bvecs(fdsi_bvals, fdsi_bvecs) gtab = gradient_table(bvals, bvecs) #sb = sticks_and_ball_dummies(gtab) S, sticks = SticksAndBall(gtab, d=0.0015, S0=100, angles=[(0, 0), (30, 0)], fractions=[50, 50], snr=30.0) sphere = get_sphere('symmetric724') sphere = sphere.subdivide(n=1) r=np.zeros(sphere.vertices.shape[0]) sampling_lengths=[1.25,1.5,2.,2.5,3.,3.5,4.] for ss in sampling_lengths: gqi_model = GeneralizedQSamplingModel(gtab, method='gqi2', sampling_length=ss, normalize_peaks=False) gqi_fit = gqi_model.fit(S) gqi_odf = gqi_fit.odf(sphere) r=np.vstack((r,gqi_odf)) show_odfs(r[:,None,None], sphere)