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

Not able to plot object with original intensity #453

Open
pranaysingh25 opened this issue Jun 26, 2021 · 0 comments
Open

Not able to plot object with original intensity #453

pranaysingh25 opened this issue Jun 26, 2021 · 0 comments

Comments

@pranaysingh25
Copy link

ss
Hi,

I need to plot a vtkimageData, I am using pyvista.plot for this and using add_mesh method. I need to plot my object with original intensity which I am not able to do, For example, the attached picture shows the color of my object which happens to be a tooth in black color, while the original intensity is somewhat white, of different intensities. When I use add_mesh_threshold for plotting, the color of the tooth that gets plotted appears green is color, which is not realistic.

After reading the plotting guide and APIs, I somewhat understand that it has something to do with scalar argument(or is it ?) I also have a little vague understanding of what 'scalars' are ? scalars are optional arguments that can be supplied to add_mesh method, and the documentaiton says "Scalars used to “color” the mesh". I have also tried other intuitive parameters such as "log_scale" = False. But I was not able to get my plot which shows original intensity of the tooth with accurate intensity level at every voxel.
If someone can guide me to understand what are the proper parameters need to be set of which plotting method to use to get what I want, that would be extremely helpful.

For reference to the original intensity , I have also attached a slice from my data which shows the original intensity of the tooth.
Also, here is the code snipped I am using:

import pyvista as pv
Ugrid = pv.UniformGrid(imageData)
plotter = pv.Plotter()
plotter.enable()
plotter.add_mesh_threshold(Ugrid, log_scale=False, cmap='gray')
actor = plotter.show_bounds(grid='front', location='outer', all_edges=True)
cpos = plotter.show(jupyter_backend = 'static', interactive=True)

thanks,
Pranay
ss2

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

No branches or pull requests

1 participant