-
Notifications
You must be signed in to change notification settings - Fork 158
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
Possible error on python ElevationBandsWithGlyphs example #140
Comments
Thanks, we'll take a look.
On Mar 13, 2018 8:34 PM, "Nahom Kidane" <[email protected]> wrote:
VTKExamples/Python/Visualization/ElevationBandsWithGlyphs
On ReverseLUT, I think we also need to reverse the annotations. Fixed by
add the line "revList = reversed(list(range(t + 1))) after the second t
assignment.
def ReverseLUT(lut):
"""
Create a lookup table with the colors reversed.
:param: lut - An indexed lookup table.
:return: The reversed indexed lookup table.
"""
lutr = vtk.vtkLookupTable()
lutr.DeepCopy(lut)
t = lut.GetNumberOfTableValues() - 1
revList = reversed(list(range(t + 1)))
for i in revList:
rgba = [0, 0, 0]
v = float(i)
lut.GetColor(v, rgba)
rgba.append(lut.GetOpacity(v))
lutr.SetTableValue(t - i, rgba)
t = lut.GetNumberOfAnnotatedValues() - 1
------>revList = reversed(list(range(t + 1)))<-------------
for i in revList:
lutr.SetAnnotation(t - i, lut.GetAnnotation(i))
return lutr
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#140>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAUFDHIo5xNQUmXjVgItUN2VhYpxlHrGks5teI-pgaJpZM4SpyYY>
.
|
I'll check it out sometime tomorrow.
Andrew
Andrew Maclean
…On Wed, 14 Mar 2018, 16:23 Bill Lorensen ***@***.***> wrote:
Thanks, we'll take a look.
On Mar 13, 2018 8:34 PM, "Nahom Kidane" ***@***.***> wrote:
VTKExamples/Python/Visualization/ElevationBandsWithGlyphs
On ReverseLUT, I think we also need to reverse the annotations. Fixed by
add the line "revList = reversed(list(range(t + 1))) after the second t
assignment.
def ReverseLUT(lut):
"""
Create a lookup table with the colors reversed.
:param: lut - An indexed lookup table.
:return: The reversed indexed lookup table.
"""
lutr = vtk.vtkLookupTable()
lutr.DeepCopy(lut)
t = lut.GetNumberOfTableValues() - 1
revList = reversed(list(range(t + 1)))
for i in revList:
rgba = [0, 0, 0]
v = float(i)
lut.GetColor(v, rgba)
rgba.append(lut.GetOpacity(v))
lutr.SetTableValue(t - i, rgba)
t = lut.GetNumberOfAnnotatedValues() - 1
------>revList = reversed(list(range(t + 1)))<-------------
for i in revList:
lutr.SetAnnotation(t - i, lut.GetAnnotation(i))
return lutr
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#140>, or mute the thread
<
https://github.com/notifications/unsubscribe-auth/AAUFDHIo5xNQUmXjVgItUN2VhYpxlHrGks5teI-pgaJpZM4SpyYY
>
.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#140 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIJ4OyTO75HRxp8QuZpYEFsyouwl7kqJks5teKk8gaJpZM4SpyYY>
.
|
@NahomKidane All fixed, please see: #142 Thankyou so much for finding this. The C++ code was correct, however I must have forgotten to update the Python code. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
VTKExamples/Python/Visualization/ElevationBandsWithGlyphs
On ReverseLUT, I think we also need to reverse the annotations. Fixed by add the line "revList = reversed(list(range(t + 1))) after the second t assignment.
def ReverseLUT(lut):
"""
Create a lookup table with the colors reversed.
:param: lut - An indexed lookup table.
:return: The reversed indexed lookup table.
"""
lutr = vtk.vtkLookupTable()
lutr.DeepCopy(lut)
t = lut.GetNumberOfTableValues() - 1
revList = reversed(list(range(t + 1)))
for i in revList:
rgba = [0, 0, 0]
v = float(i)
lut.GetColor(v, rgba)
rgba.append(lut.GetOpacity(v))
lutr.SetTableValue(t - i, rgba)
t = lut.GetNumberOfAnnotatedValues() - 1
------>revList = reversed(list(range(t + 1)))<-------------
for i in revList:
lutr.SetAnnotation(t - i, lut.GetAnnotation(i))
return lutr
The text was updated successfully, but these errors were encountered: