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

ENH: Add vmin and vmax to viewer #724

Merged
merged 1 commit into from
Dec 21, 2023

Conversation

PaulHax
Copy link
Collaborator

@PaulHax PaulHax commented Dec 20, 2023

Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

Nice!

@bnmajor if / when we have an inherited ipywidget viewer class, they will be able to override these properties with the traitlets, correct?

@PaulHax could you please also add vmin, vmax arguments to view?

@bnmajor
Copy link
Collaborator

bnmajor commented Dec 20, 2023

@bnmajor if / when we have an inherited ipywidget viewer class, they will be able to override these properties with the traitlets, correct?

Yup! Essentially you would just swap out property for observe and val.setter for default("val"). For example:

class Foo:
    ....
     @property
     def bar(self):
             return self.get_value()

     @bar.setter
     def bar(self, val):
             self.set_value(val)

should become

class Foo(HasTraits):
    bar = Int()

     @observe
     def bar(self):
             return self.get_value()

     @default("bar")
     def bar(self, val):
             self.set_value(val)

Copy link
Member

@thewtex thewtex left a comment

Choose a reason for hiding this comment

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

👍 please bump the itk-vtk-viewer version before merge

@thewtex thewtex merged commit d20b17b into InsightSoftwareConsortium:main Dec 21, 2023
6 checks passed
@thewtex
Copy link
Member

thewtex commented Dec 21, 2023

tagging

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

Successfully merging this pull request may close these issues.

vmin and vmax viewer properties set color range
3 participants