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

What's the mean of levels and opacities? #26

Open
Thatfreesky opened this issue Apr 27, 2017 · 6 comments
Open

What's the mean of levels and opacities? #26

Thatfreesky opened this issue Apr 27, 2017 · 6 comments

Comments

@Thatfreesky
Copy link

I can not understand the effect of slides of levels and opacities? I think that the API is not clear about this part of content. Can anyone help me?

screenshot from 2017-04-27 13-59-46

screenshot from 2017-04-27 14-04-12

@maartenbreddels
Copy link
Collaborator

Hi,

I wanted to explain this by updating the docs on this, but let's start here first. A transfer function maps voxel values in the range [0, 1] to rgba (rgb+alpha) colors. In ipvolume, a volumetric cube is first normalized to the [0, 1] range, unless datamin, datamax is provided, where clipping is applied when the values are outside this range. The default transfer function exists of 3 gaussian bumps, where the location of the bumps are provided in level, the sigmas/widths by level_width, and the height/opacity by opacity. The first bump causes will result in red values, the 2nd in green, and the 3rd in blue. Note that this is the default transfer function, it should be possible (but haven't tested that for a while) to define your own transfer function.

Would really like to have an example reproducing for instance this

Does this help? I will keep this open until transfer functions are better documented.

@Thatfreesky
Copy link
Author

Thanks for your help. I think I need to learn some details about the transfer functions.

@satra
Copy link
Contributor

satra commented Aug 15, 2017

it looks like the upperbound for opacity is hardcoded here. is there a way to modify this programmatically at present?

https://github.com/maartenbreddels/ipyvolume/blob/master/ipyvolume/transferfunction.py#L88

@maartenbreddels
Copy link
Collaborator

Hi Satrajit,

yes, I have to say that the transfer functions are something that needs more work, but I've added a max_opacity keyword to volshow(..) as you can see in the referenced commit. It would be possible btw to get a reference to this max opacity, but it's difficult to obtain, and this change makes more sense I think.

cheers,

Maarten

@maartenbreddels
Copy link
Collaborator

PS: Please raise a new issue next time :)

@satra
Copy link
Contributor

satra commented Aug 15, 2017

thanks. will do

mpu-creare pushed a commit to mpu-creare/ipyvolume that referenced this issue Mar 26, 2018
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

3 participants