itkwidgets icon indicating copy to clipboard operation
itkwidgets copied to clipboard

Drawing ROIs on an image

Open hadim opened this issue 5 years ago • 7 comments

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 avatar Oct 03 '18 14:10 hadim

@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.

thewtex avatar Oct 03 '18 21:10 thewtex

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.

hadim avatar Oct 04 '18 01:10 hadim

We will start with the simple vtk.js paint widget:

https://kitware.github.io/vtk-js/examples/PaintWidget.html

thewtex avatar Oct 29 '18 04:10 thewtex

CC: @floryst

thewtex avatar Feb 06 '19 18:02 thewtex

@thewtex I just wanted to know if you started to work on that or if I should start digging into the code myself?

hadim avatar Mar 03 '19 17:03 hadim

@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

thewtex avatar Mar 03 '19 21:03 thewtex

I'll try to have a look soon!

hadim avatar Mar 03 '19 21:03 hadim