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

Probabilistic Direction Getter gallery example #1779

Closed
araikes opened this issue Mar 15, 2019 · 3 comments

Comments

@araikes
Copy link

commented Mar 15, 2019

Description

The examples given in the example for getting probabilistic streamlines (http://nipy.org/dipy/examples_built/probabilistic_fiber_tracking.html#example-probabilistic-fiber-tracking) demonstrate saving the streamline_generator, not the actual streamlines. The code on the website is:

from dipy.data import default_sphere

prob_dg = ProbabilisticDirectionGetter.from_shcoeff(csd_fit.shm_coeff,
                                                    max_angle=30.,
                                                    sphere=default_sphere)
streamlines_generator = LocalTracking(prob_dg, classifier, seeds, affine, step_size=.5)

save_trk("probabilistic_shm_coeff.trk", streamlines_generator, affine, labels.shape)

This should be (as in the Quick Start Tracking):

from dipy.data import default_sphere
from dipy.tracking.streamline import Streamlines

prob_dg = ProbabilisticDirectionGetter.from_shcoeff(csd_fit.shm_coeff,
                                                    max_angle=30.,
                                                    sphere=default_sphere)
streamlines_generator = LocalTracking(prob_dg, classifier, seeds, affine, step_size=.5)
streamlines = Streamlines(streamlines_generator)
save_trk("probabilistic_shm_coeff.trk", streamlines, affine, labels.shape)

Way to reproduce

[If reporting a bug, please include the following important information:]

  • [x ] Relevant images (if any)
    Streamline generator export (open the image and zoom and you will see several small streamlines):
    3D_View2

Streamlines export as in the revised code:
3D_View2

@gabknight gabknight self-assigned this Apr 10, 2019

@skoudoro

This comment has been minimized.

Copy link
Member

commented Apr 19, 2019

Thanks for pointing that out @araikes! It should normally work with the streamlines_generator too so I will check save_trk function before updating the tutorial.

@gabknight

This comment has been minimized.

Copy link
Contributor

commented Jul 2, 2019

Thanks @araikes. Saving the streamlines_generator works fine on my system. For clarity, we should always add the Streamline(.) in examples. I will go ahead and prepare the PR. @skoudoro do know what could have caused the issue?

@skoudoro

This comment has been minimized.

Copy link
Member

commented Jul 8, 2019

No idea @gabknight. Maybe a memory error, or just a visualization problem.

I tried on Windows and Mac and I can not reproduce the problem, so hard to help...

@gabknight gabknight closed this Jul 24, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.