def main(): #set some values to be used later sh_order = 6 verts, edges, efaces = create_unit_sphere(4) #read_data from disk data, fa, bvec, bval, voxel_size = sample_hardi_data() data_slice = data[32:76, 32:76, 26:27] fa_slice = fa[32:76, 32:76, 26] #normalize data by dividing by b0, this is needed so we can take log later norm_data = normalize_data(data_slice, bval, min_signal=1) #create an instance of the model model_instance = MonoExpOpdfModel(sh_order, bval, bvec, .006) model_instance.set_sampling_points(verts, edges) #use the model it fit the data opdfs_sampled_at_verts = model_instance.evaluate(norm_data) opdfs_sph_harm_coef = model_instance.fit_data(norm_data) #display the opdf blobs using mayavi faces = edges[efaces, 0] show_blobs(opdfs_sampled_at_verts, verts, faces) mlab.imshow(fa_slice, colormap='gray', interpolate=False) mlab.show()
def main(): """Track example dataset""" data, fa, bvec, bval, voxel_size = sample_hardi_data() seed_mask, target_mask = sample_tracking_seedNtarget() density = [1, 1, 2] start_step = [-0.3, -0.7, -0.7] tracks = simple_tracking_function(data, fa, bval, bvec, seed_mask, start_step, voxel_size, density) tracks = list(tracks) targeted_tracks = target(tracks, target_mask, voxel_size) """