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

Add volume mapper choice notes #3824

Merged
merged 3 commits into from
Jan 16, 2023
Merged

Add volume mapper choice notes #3824

merged 3 commits into from
Jan 16, 2023

Conversation

banesullivan
Copy link
Member

@banesullivan banesullivan commented Jan 12, 2023

The 'smart' mapper chooses one of the other available mappers based on rendering parameters and available hardware. I added some notes on how that decision is made.

I also added a waring about the fixed_point mapper and how it CPU-based

Addition notes not included in docs

I noticed on my machine today that when datasets have NaN values, the 'fixed_point' mapper might work best, but the 'smart' mapper was choosing something different. I added these notes to the docstring to help others. I do not want to change the default behavior as the 'smart' mapper usually chooses the best mapper for the given hardware and autoselecting 'fixed_point' in the presence of NaN values could fail for some hardware.

I'm seeing this issue on my M2 Mac but not my Linux machine with an NVIDIA graphics card

import pyvista as pv
from pyvista import examples
import numpy as np

volume = examples.download_knee_full()

volume['SLCImage'] = volume['SLCImage'].astype(float)
volume['SLCImage'][volume['SLCImage'] < 40] = np.nan

p = pv.Plotter()
p.add_volume(volume, cmap="coolwarm", mapper='fixed_point')
p.show()

@github-actions github-actions bot added the documentation Anything related to the documentation/website label Jan 12, 2023
@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Merging #3824 (30440d7) into main (880d172) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #3824   +/-   ##
=======================================
  Coverage   94.18%   94.18%           
=======================================
  Files          86       86           
  Lines       18914    18914           
=======================================
  Hits        17815    17815           
  Misses       1099     1099           

Co-authored-by: Bane Sullivan <banesullivan@gmail.com>
akaszynski
akaszynski previously approved these changes Jan 13, 2023
@banesullivan
Copy link
Member Author

banesullivan commented Jan 13, 2023

I actually changed this up a bit and removed the original NaN note. That NaN issue seems to be specific to arm-based Macs and the OpenGL implementation on that hardware. I don't really want to point people to using the fixed_point mapper since its performance is quite poor (being CPU-based)

Copy link
Member

@tkoyama010 tkoyama010 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akaszynski akaszynski merged commit 728f493 into main Jan 16, 2023
@akaszynski akaszynski deleted the doc/volume-mapper branch January 16, 2023 06:10
@banesullivan banesullivan mentioned this pull request Feb 1, 2023
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Anything related to the documentation/website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants