You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I generated a tractogram using MRTrix, and saved it in tck format. I also generated a tract density image using MRTrix's tckmap -template DWI.nii.gz tractogram.tck tdi.nii.gz where DWI.nii.gz is the input diffusion volume.
Issue
When I load the tractogram using nibabel and compute the tdi image using dipy, I get a map that has quite less fiber count per voxel (between a few to more than 200 for some regions, with a mean around 50 streamlines less). Is this expected ? I imagine MRTrix and Dipy might compute differently how voxels are "visited" or not by the streamlines, but I wondered if someone knew about another explanation, and which map is more accurate ?
Code
Here is the code I use to compute the map using dipy:
import nibabel as nib
from dipy.tracking import utils
DWI_img = nib.load('DWI.nii.gz')
tractogram = nib.streamlines.load('tractogram.tck')
tdi = utils.density_map(tractogram.streamlines,DWI_img.affine,DWI_img.shape[:3])
nib.save(nib.Nifti1Image(tdi,DWI_img.affine),'/tmp/tdi_dipy.nii.gz')
I'm using dipy v1.0.0, python 3.7.4 on a mac (Darwin-17.5.0-x86_64-i386-64bit)
Thanks in advance for any feedback !
Cheers,
David
The text was updated successfully, but these errors were encountered:
Hi David (@davidrs06) ! As far as I know the method implemented in DIPY was not made to replicate the behavior of the mrtrix command. The algorithms used are possibly different. I think you should look inside the code to understand how things are calculated. There is another function that you could look into called track_counts. @jchoude has contributed an extension of this command that also accounts for the case were the streamlines may have points with variable step size.
Hi Ele :). Indeed, it's not so much of an issue, I was more wondering if the difference was intended or not. Thanks for the answer, I'll have a look at the code.
Take care !
David
Description
I generated a tractogram using MRTrix, and saved it in tck format. I also generated a tract density image using MRTrix's
tckmap -template DWI.nii.gz tractogram.tck tdi.nii.gz
where DWI.nii.gz is the input diffusion volume.Issue
When I load the tractogram using nibabel and compute the tdi image using dipy, I get a map that has quite less fiber count per voxel (between a few to more than 200 for some regions, with a mean around 50 streamlines less). Is this expected ? I imagine MRTrix and Dipy might compute differently how voxels are "visited" or not by the streamlines, but I wondered if someone knew about another explanation, and which map is more accurate ?
Code
Here is the code I use to compute the map using dipy:
I'm using dipy v1.0.0, python 3.7.4 on a mac (Darwin-17.5.0-x86_64-i386-64bit)
Thanks in advance for any feedback !
Cheers,
David
The text was updated successfully, but these errors were encountered: