InsightSoftwareConsortium / InsightSoftwareConsortium/itkwidgets

Add `clicked_point_set` trait

Open
#388 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
624
Forks
83
PR merge metrics
No merged PRs in 30d

Description

This trait will be triggered when a point set is clicked, and it will provide information about the point set that clicked, the index of the point in the point set, and the position of the point in space.

For example:

```
# Your callback function
def my_point_clicked_callback(point):
print(point.index) # The point index
print(point.position) # The point [x,y,z] position

viewer.observe(my_point_clicked_callback, ['clicked_point_set'])
```

This trait and its data will be similar to the `ImagePoint` and `ImagePointTrait`:

https://github.com/InsightSoftwareConsortium/itkwidgets/blob/d90037eb6d6e1a367cbb54cfffc9df3cc7d75ba2/itkwidgets/trait_types.py#L277-L298

adding a new `clicked_point_set` trait to the `Viewer` widget. It depends https://github.com/Kitware/itk-vtk-viewer/issues/342 for the JavaScript side.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.