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
Viz surfaces #1034
Viz surfaces #1034
Conversation
Update fork
This is cool -- thanks for including this! Any chance to show an example of how this can be used to visualize some brain data? There are some VTK files in the mindboggle data-sets that might lend themselves to this, or we could create VTK files of brain surfaces for the Stanford HARDI data-set. I am curious to see how you would suggest using this together with streamlines. |
Hello Ariel, I added an example file "doc/examples/viz_surfaces.py" to show how to Once you have a vtkPolyData you can generate a vtkActor and use it in a scene/windows exactly like the streamlines actor. Later on, I could add a tutorial with surface and streamlines visualization. |
On Wed, May 4, 2016 at 10:15 AM, StongeEtienne notifications@github.com
|
I think, for basic surface feature, I shouldn't add more details.
Also I didn't want to add a brain_mesh files in your data, and I don't know how your data fetching system works. |
@Garyfallidis Do you think you will have some time to look at this ? |
Yes, will do asap. Hold on there! |
@@ -228,3 +228,251 @@ def lines_to_vtk_polydata(lines, colors=None): | |||
poly_data.SetLines(vtk_lines) | |||
poly_data.GetPointData().SetScalars(vtk_colors) | |||
return poly_data, is_colormap | |||
|
|||
|
|||
########################################## |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-standard comment style.
Visualize surfaces; load/save, get/set and update vtkPolyData. | ||
======================================== | ||
|
||
import usefull functions and dipy utils |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from dipy.viz.utils
@@ -0,0 +1,99 @@ | |||
""" | |||
======================================== | |||
Visualize surfaces; load/save, get/set and update vtkPolyData. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just write
Visualize surfaces or Surface visualization
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@StongeEtienne have you seen this?
|
||
""" | ||
generate a empty vtkPolyData | ||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an empty line between comments and code. Otherwise the tutorial will not render correctly.
""" | ||
ut_vtk.set_polydata_vertices(my_polydata, my_vetices) | ||
ut_vtk.set_polydata_triangles(my_polydata, my_triangles) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One empty line between code.
Changes Unknown when pulling 5a78436 on StongeEtienne:viz_surfaces into * on nipy:master*. |
1 similar comment
Changes Unknown when pulling 5a78436 on StongeEtienne:viz_surfaces into * on nipy:master*. |
Current coverage is 80.82% (diff: 15.94%)
|
Okay thanks. Merging this and making a PR with some updates for the website. |
For future reference: you might want to give a couple of days warning before you merge PRs. Something like "I will merge this in a couple of days, unless I hear from everyone" would be helpful. For example, my suggestion from May (#1034 (comment)) has been ignored in the revision. |
Thanks Elef for the merge, @arokem I don't mind for the "warning before merge", but I already answer ( #1034 (comment) ) to your request in a comment right after, and this branch wasn't touch for a whole 5 months. |
Sure - I was wrong about your answer. It has been a while... Still - the principle still applies |
Surface visualization tools
Load/Save surface (polydata)
vtk polydata numpy support
surfaces tutorial