# 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)
Is there a project outline for dipy such as a module connections graph?
Such as these I created for fmriprep and qsiprep: https://github.com/nipreps/fmriprep/discussions/2517 and https://github.com/PennLINC/qsiprep/discussions/289
nodes
and therefore does not need a dataflow graph. However, I do know it is trivial to build these pipelines with DIPY and would like to know what exactly you need. Are you using vanilla DIPY to build pipelines?
@kodiweera ! That is a great question. The graph that you are mentioning typically comes from NiPype -- which I believe is how the nodes are connected for a dataflow style of computation. DIPY on the other hand is a package that provides tools for what happens inside those
nodes
and therefore does not need a dataflow graph. However, I do know it is trivial to build these pipelines with DIPY and would like to know what exactly you need. Are you using vanilla DIPY to build pipelines?
Not a nipype node grape. I was mentioning a modules connection graph. I alrady created them for fmri and qsiprep. they simply show the dependancy on the packages etc.
@bgolshaei, Deforming a grid is a helpful way to visualize a displacement field. we have a function for this:
from dipy.viz import
regtools;regtools.plot_2d_diffeomorphic_map(mapping, 10, 'diffeomorphic_map.png')
if you need quiver to draw the displacement field, we do not have it yet but it would be a nice small project/contribution to do during DIPY workshop or Brainhack. You can look inside the function above to adapt it.
I hope it helps