New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROI seeds not placed at the center of the voxels #649

Closed
mick-d opened this Issue May 13, 2015 · 5 comments

Comments

Projects
None yet
3 participants
@mick-d

mick-d commented May 13, 2015

I am trying to perform tractography from a ROI and create seeds at the center of each voxel of this ROI.

The ROI includes 8 voxels: 9 voxels forming a square (in a single sagittal slice), less one corner voxel. To create seeds at the center of each voxel, do the tractography and display the results, I run the following commands:

tenmodel = dti.TensorModel(my_gradient_table)
tenfit = tenmodel.fit(my_dmri_data)
seeds = seeds_from_mask(my_ROI_data, density=[1, 1, 1])
sphere = get_sphere('symmetric724')
ind = quantize_evecs(tenfit.evecs, sphere.vertices)
eu = EuDX(a=tenfit.fa, ind=ind, seeds=seeds, odf_vertices=sphere.vertices, a_low=.15)
streamlines = list(eu)
r = fvtk.ren()
fvtk.add(r, fvtk.line(streamlines, line_colors(streamlines)))
fvtk.add(r, fvtk.slicer(my_ROI_data, plane_i=[49], plane_j=None, plane_k=None, outline=False))
fvtk.show(r)

The seeds still do not seem at the center of the voxels as shown by the streamlines object seed_list attribute:

> streamlines.seed_list
array([[ 49.,  38.,  24.],
       [ 49.,  38.,  25.],
       [ 49.,  38.,  26.],
       [ 49.,  39.,  24.],
       [ 49.,  39.,  25.],
       [ 49.,  39.,  26.],
       [ 49.,  40.,  25.],
       [ 49.,  40.,  26.]])

And as seen on the image below. Then is there a solution to generate the streamlines at the voxels centre?
toy_seed2

@MrBago

This comment has been minimized.

Contributor

MrBago commented May 13, 2015

This is a problem with fvtk not with the seeds. Dipy uses the convention as the nifti standard for real world coordinates which means that, assuming a diagonal affine, the center of each voxel is at an integer multiple of the voxel size. Based on your seed_list array it seems like you have (1, 1, 1) voxels and the seeds are in the centers of those voxels.

Unfortunatly the current fvtk has some issues, but @Garyfallidis is already on the case :) see #587.

@mick-d

This comment has been minimized.

mick-d commented May 13, 2015

Thanks for your answer Bago. If the voxel size are integers (i did not use
the real size due to other issues with fvtk), the voxel centers should be
half-integers, so why is it not the case?
On May 13, 2015 2:47 PM, "Bago Amirbekian" notifications@github.com
wrote:

This is a problem with fvtk not with the seeds. Dipy uses the convention
as the nifti standard for real world coordinates which means that, assuming
a diagonal affine, the center of each voxel is at an integer multiple of
the voxel size. Based on your seed_list array it seems like you have (1, 1,

  1. voxels and the seeds are in the centers of those voxels.

Unfortunatly the current fvtk has some issues, but @Garyfallidis
https://github.com/Garyfallidis is already on the case :) see #587
#587.


Reply to this email directly or view it on GitHub
#649 (comment).

@MrBago

This comment has been minimized.

Contributor

MrBago commented May 14, 2015

@mick-d

This comment has been minimized.

mick-d commented May 14, 2015

Thanks a lot for your feedback Bago. It looks like I will just have to double-check the streamlines in another way for now.

@arokem

This comment has been minimized.

Member

arokem commented Sep 1, 2015

It seems that this discussion has been resolved. I am closing it.

@arokem arokem closed this Sep 1, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment