Skip to content
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

Applying image-based deformations to streamlines example #2400

Closed
BramshQamar opened this issue May 20, 2021 · 9 comments · Fixed by #2930
Closed

Applying image-based deformations to streamlines example #2400

BramshQamar opened this issue May 20, 2021 · 9 comments · Fixed by #2930

Comments

@BramshQamar
Copy link
Contributor

BramshQamar commented May 20, 2021

Description

In this example on applying image-based deformations to streamlines doc/examples/streamline_registration.py,
I don't understand what this part is doing

if not op.exists('lr-superiorfrontal.trk'):
from streamline_tools import *
vox_size = hardi_img.header.get_zooms()[0]

Also gives me an error when I run it:

ModuleNotFoundError: No module named 'streamline_tools'

And why are we accessing hardi_img variable before it is initialized?

vox_size = hardi_img.header.get_zooms()[0]

@arokem
Copy link
Contributor

arokem commented May 20, 2021 via email

@BramshQamar
Copy link
Contributor Author

Hi @arokem

Thank you for the explanation. Running this tutorial https://github.com/dipy/dipy/blob/541b5b2992e786b5f51d05649a398cb331903456/doc/examples/streamline_tools.py solved the issues.
It would be helpful to add prerequisites to the documentation.

However, I found out that the output generated by https://dipy.org/documentation/1.4.1./examples_built/streamline_registration/#example-streamline-registration is very strange looking.

Screen Shot 2021-05-20 at 12 37 21 PM

Here green is the original bundle and pink after registration.

@arokem
Copy link
Contributor

arokem commented May 20, 2021

Might be worth viewing in the context of the MNI template. It might have moved to the right place with respect to the template?

@BramshQamar
Copy link
Contributor Author

Screen Shot 2021-05-20 at 12 45 32 PM

Visualized with template

@arokem
Copy link
Contributor

arokem commented May 20, 2021

Yeah - that's no good.

@BramshQamar
Copy link
Contributor Author

I think the issue is that moving bundle and image are not in the same space to begin with

Screen Shot 2021-05-20 at 12 53 48 PM

So when static and moving images are aligned and that transformation is applied to the bundle it generates spurious output as that bundle was not in the same space as the moving image. It is assumed that moving image and bundle are in the same space, probably coming from the same subject which doesn't seem to be true in this case.

@BramshQamar
Copy link
Contributor Author

Here's the issue, density map, and the streamlines saved from this example https://github.com/dipy/dipy/blob/541b5b2992e786b5f51d05649a398cb331903456/doc/examples/streamline_tools.py are not in the same space.

Screen Shot 2021-05-20 at 12 58 39 PM

@skoudoro
Copy link
Member

skoudoro commented May 20, 2021

Thank you for pointing that out. it would be good to:

  • separate these 2 tutorials
  • fix the space problem

@arokem
Copy link
Contributor

arokem commented May 21, 2021

Maybe we should make a fetcher for these trk files, just so we can make this example freestanding?

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

Successfully merging a pull request may close this issue.

3 participants