my_sphere = Sphere(xyz=gtab.bvecs[~gtab.b0s_mask])
voxel2streamline
to see which streamlines pass through which voxels. I feed in the streamlines and the inverse of the DWI affine to map from streamline to voxel. I am having trouble interpreting the output, as I do not know how to map voxel index to location. Any guidance would be appreciated, thanks!
Hi Everyone! We are very happy to announce that a new educational course is available online: https://youtube.com/playlist?list=PLRZ9VSqV-6soOC0rUEAOV-QiSa_Qxk8JM :rocket: This is a complete course on Diffusion MRI with Theory and Practice :snake: This is your chance to go from zero-to-hero in using :star: DIPY :star: Topics include -
:white_check_mark: dMRI Basics
:white_check_mark: Microstructure Modeling
:white_check_mark: Denoising
:white_check_mark: Tractometry
:white_check_mark: Dictionary Learning
:white_check_mark: Advanced Multidimensional Diffusion Encodings
:white_check_mark: Registration
:white_check_mark: Tissue Classification
:white_check_mark: Deep Learning methodologies in MRI
:white_check_mark: High Field MRI
:white_check_mark: GPU Acceleration
:white_check_mark: Data Harmonization
:white_check_mark: ML in the Clinic and much more.....
Do not miss out on this golden opportunity! If you do like and use DIPY please do give us a star and cite the piece of software that you are using! It encourages us to keep going! May your data live a new life!!
data, affine, img = load_nifti(file2_path, return_img=True)
bvals, bvecs = read_bvals_bvecs(fbval, fbvec)
print(bvals)
gtab = gradient_table(bvals, bvecs)
print(gtab)
tenmodel = TensorModel(gtab)
print(len(bvals))
new_img = img.get_fdata()
tenfit = tenmodel.fit(new_img)
dipy.align._public.SymmetricDiffeomorphicRegistration
. Using the .update()
method, I have interpolated the displacement to a new 3D shape of (S,R,C,3). I would now like to split this 3D array into a list of 2D arrays and then apply each deformation field on a new 2D image. Is there a way of doing that?
# these are your original bvals and bvecs
bvals = gtab.bvals
bvecs = gtab.bvecs
# here we select only 0 and 1000 bvals
selelected_bvals = np.logical_or(bvals == 0, bvals == 1000)
# here we pick only the 3D volumes from the 4D dMRI data pertaining to 0 and 1000 that we did above.
data_selected = data[:, :, :, selelected_bvals]
# now we also take only the bvals and bvecs of the same 0 and 1000 shells.
gtab_selected = gradient_table(bvals[selelected_bvals], bvecs[selelected_bvals])
# now you can use these to fit the DTI model
tenmodel = dti.TensorModel(gtab_selected)
tenfit = tenmodel.fit(data_selected)