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

Fury visualizing bug - plane only visible for XY-slice of FODs #1825

Closed
rutgerfick opened this issue May 5, 2019 · 2 comments

Comments

@rutgerfick
Copy link
Contributor

commented May 5, 2019

Description

The new Dipy visualization tool using fury doesn't work correctly.
It only shows slices when the FOD plane is in XY and z-axis has dimension 1. If the plane is in YZ or XZ then it will only show a line.

Way to reproduce

from dipy.data import get_sphere
from dipy.viz import window, actor
import numpy as np
sphere = get_sphere(name='symmetric724')

random_fods_x = np.random.rand(1, 20, 20, len(sphere.vertices))
random_fods_y = np.random.rand(20, 1, 20, len(sphere.vertices))
random_fods_z = np.random.rand(20, 20, 1, len(sphere.vertices))

# x will only show a single line of FODs
ren = window.Renderer()
fod_spheres = actor.odf_slicer(
    random_fods_x, sphere=sphere, scale=0.9, norm=False, colormap='plasma')
ren.add(fod_spheres)
window.show(ren)

# y will only show a single line of FODs
ren = window.Renderer()
fod_spheres = actor.odf_slicer(
    random_fods_y, sphere=sphere, scale=0.9, norm=False, colormap='plasma')
ren.add(fod_spheres)
window.show(ren)

# only in z you will see a plane of FODs
ren = window.Renderer()
fod_spheres = actor.odf_slicer(
    random_fods_z, sphere=sphere, scale=0.9, norm=False, colormap='plasma')
ren.add(fod_spheres)
window.show(ren)

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

  • Code example
  • Relevant images (if any)
  • Operating system and version (run python -c "import platform; print(platform.platform())") Linux-4.15.0-47-generic-x86_64-with-debian-stretch-sid
  • Python version (run python -c "import sys; print("Python", sys.version)") 2.7.15 |Anaconda, Inc.| (default, Dec 14 2018, 19:04:19) \n[GCC 7.3.0]
  • dipy version (run python -c "import dipy; print(dipy.__version__)") '0.16.0'
  • dependency version (numpy, scipy, nibabel, h5py, cvxpy, fury)
    • import numpy; print("NumPy", numpy.version) N/A
    • import scipy; print("SciPy", scipy.version) N/A
    • import nibabel; print("Nibabel", nibabel.version) N/A
    • import h5py; print("H5py", h5py.version) N/A
    • import cvxpy; print("Cvxpy", cvxpy.version) N/A
    • import fury; print("fury", fury.version) ('fury', u'0.2.0')
@skoudoro

This comment has been minimized.

Copy link
Member

commented May 5, 2019

Hi @rutgerfick,

This is a normal behavior. if you want to have a specific plane direction, you need to set up the extent (actor.display_extent(...) ). More information on this tutorial: http://fury.gl/latest/auto_examples/viz_advanced.html#sphx-glr-auto-examples-viz-advanced-py

@rutgerfick

This comment has been minimized.

Copy link
Contributor Author

commented May 5, 2019

Ah! That helps a lot !!
I was looking at the CSD example and was in confusion as to what I was doing wrong.
Thanks, I'll close the issue then.

@rutgerfick rutgerfick closed this May 5, 2019

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