# add normal direction #file_name = "brain_mesh/lh_sim_tri_tau20_l3l10.ply" file_name = "brain_mesh/lhwhitet.vtk" mesh = TriMesh_Vtk(file_name, None) vertices = mesh.get_vertices() nb_step = 10 saved_flow = "testflow.dat" trk_filename = "testtract_lhwhite2.trk" lines = np.memmap(saved_flow, dtype=np.float64, mode='r', shape=(nb_step, vertices.shape[0], vertices.shape[1])) # mesh.update() mesh.update_normals() normals = mesh.get_normals() # load nifti for trk info #subject_nii_file = "brain_mesh/s31_T1.nii.gz" subject_nii_file = "brain_mesh/S1-A2_fa.nii.gz" fa_file = nib.load(subject_nii_file) img = fa_file.get_data() img_affine = fa_file.get_affine() img_zoom = fa_file.get_header().get_zooms()[:3] # transform lines #transfo = (np.array(img.shape[:3]) / 2.0).reshape((1, 1, -1)) #lines = lines + transfo