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

[FIX] Force LUT to be RGB #329

Merged
merged 1 commit into from Oct 8, 2020
Merged

Conversation

skoudoro
Copy link
Contributor

@skoudoro skoudoro commented Oct 5, 2020

This PR is due to some change on the alpha channel with VTK9.
The event on the actor is not called if we do not force the LUT to be RGB. This is a quick fix for DIPY Horizon but we need to go deeper in our custom interactor.

See the code below to reproduce the error:

from fury import actor, window
import numpy as np

# It is working with this array
# arr = np.random.rand(375).reshape((5, 5, 5, 3)) * 255
# ERROR with the array below
arr = np.random.rand(125).reshape((5, 5, 5)) * 255

def left_click_callback(obj, ev):
    print('CALLBACK')
    print(obj)

fig = actor.slicer(arr)
fig1 = fig.copy()
fig1.display(None, None, 0)
print(fig1.shape)
fig1.SetInterpolate(False)
fig1.AddObserver('UserEvent',
                 left_click_callback, 10000.0)
scene = window.Scene()
showm = window.ShowManager(scene, interactor_style='custom')
showm.initialize()
scene.add(fig1)
showm.start()

@skoudoro skoudoro added the type:Bug Fix Something isn't working label Oct 5, 2020
@skoudoro skoudoro added this to the v0.7.0 milestone Oct 5, 2020
@codecov
Copy link

codecov bot commented Oct 5, 2020

Codecov Report

Merging #329 into master will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #329   +/-   ##
=======================================
  Coverage   88.65%   88.65%           
=======================================
  Files          21       21           
  Lines        5075     5076    +1     
  Branches      656      656           
=======================================
+ Hits         4499     4500    +1     
  Misses        406      406           
  Partials      170      170           
Impacted Files Coverage Δ
fury/window.py 78.42% <ø> (ø)
fury/actor.py 92.84% <100.00%> (+<0.01%) ⬆️

@Garyfallidis Garyfallidis merged commit f10ce3b into fury-gl:master Oct 8, 2020
@skoudoro skoudoro deleted the fix-alpha-lut branch October 8, 2020 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:Bug Fix Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants