-
Notifications
You must be signed in to change notification settings - Fork 84
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
feat: add set_image_piecewise_function_points #755
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PaulHax awesome, thank you!
itkwidgets/_type_aliases.py
Outdated
|
||
Gaussian_Curve = Dict[str, float] | ||
Gaussians = Dict[str, List[Gaussian_Curve]] | ||
Points2d = List[Tuple[float, float]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could be
Sequence[Sequence[float, float]]
? Please check if variants work by passing them to the set_*
method. If they do not work, then it may be worthwhile type casting with list()
or tuple()
to provide a more convenient interface for the caller.
In the documentation example there is:
[[.2, .1], [.8, .9]]
which is a List[List[float, float]].
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, yes. Updated type to Sequence[Sequence[float]]
. Sequence can't do Sequence[float, float]
. Passing tuple points or list points works. Passing 3D point bugs out TF editor =/
itkwidgets/_initialization_params.py
Outdated
@@ -22,7 +22,7 @@ def init_params_dict(itk_viewer): | |||
'gradient_opacity': itk_viewer.setImageGradientOpacity, | |||
'gradient_opacity_scale': itk_viewer.setImageGradientOpacityScale, | |||
'interpolation': itk_viewer.setImageInterpolationEnabled, | |||
'gaussians': itk_viewer.setImagePiecewiseFunctionGaussians, | |||
'piecewise_function_points': itk_viewer.setImagePiecewiseFunctionPoints, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about tf_points
or something else shorter here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or the more specific transfer_function_points
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to transfer_function_points
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PaulHax thank you! How about transfer_function
for brevity? I do not think _points
is adding enough information to warrant the length for interactive use. They are always points and this is implicit in the specification.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better and better. Changed.
807300c
to
883440d
Compare
remove set_image_piecewise_function_gaussians
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
remove set_image_piecewise_function_gaussians
Depends on
Kitware/itk-vtk-viewer#751