itkwidgets
itkwidgets copied to clipboard
Drawing ROIs on an image
What would be the best approach to be able to draw some ROIs (rectangle, oval, polygon, polyline) to a 2D image?
Do such tools already exist or can they be built upon the existing ipywidgets?
The idea would be the user to interact with a set of ROIs generated by an algorithm on the kernel side. The user should be able to edit, remove, add ROIs. A list of ROIs would be displayed with ipywidgets using the select widget.
@hadim this is a good idea, and we should sketch out the desired features here. Eventually, we should be able to add support for nearly everything you listed.
More ideas or details on the desired features / behavior are welcome.
What we should try to build is a widget similar to the ImageJ RoiManager. That way it's not application specific and could be reused in a lot of different situations.
The widget could be separated to the one provided by the view
method. They should still be displayed together with widgets.HBox
for example. The view
widget should be aware of it in order to toggle ROIs displaying, adding, selecting, etc.
We will start with the simple vtk.js paint widget:
https://kitware.github.io/vtk-js/examples/PaintWidget.html
CC: @floryst
@thewtex I just wanted to know if you started to work on that or if I should start digging into the code myself?
@hadim I have not started yet, and contributions would be welcome!
We can create an itkwidgets.segment_editor
function that returns a SegmentEditor
.
@floryst and @jourdain built the basic infrastructure in vtk.js -- we could get started. We can start with the PaintWidget
for initial functionality, then add tools by complexity / your needs from there.
@floryst recently added nice vtk.js widget documentation here:
https://kitware.github.io/vtk-js/docs/concepts_widgets.html
I'll try to have a look soon!