ENH: Adding VTKPlots in Slicer for Interactive manipulation
this pull request is to add VTK Plots in Slicer as discussed during the Summer Project week.
Here a video showing how I designed it: https://www.dropbox.com/s/g08jzgacjxy54dm/videoPlot.mkv?dl=0
Comparing with the Charting with jqPlot: A) vtkMRMLPlotLayoutNode has the similar role of vtkMRMLChartNode. B) vtkMRMLPlotNode has the role of vtkMRMLDoubleArrayNode.
Once it is plotted, the table and the plot are coupled (i.e. modifying the table will update the plot etc...): The panning and zooming is done with middle-click; The selection with right-click ('S' change the type of selection). The selection IDs are stored in the PlotLayoutNode. Click and Drag is done with left-click (and it's disabled for the BarPLot).
I tested up to 10^6 points and It was fully interactive
Few notes:
- Click and Drag will work after this patch to VTK https://github.com/Punzo/VTK/commit/1d5a9219a57f2f60512de069f6b32fa4ecb50f83
So at the moment you can't build and test unless you download the modified classes (vtkChart and vtkChartXY) from my fork of VTK. Or you can disable the click and drag just commenting this line https://github.com/Punzo/Slicer/commit/29316ce388dadfcfe92996162fd48c791823a869#diff-2230803b602f286c1352621a5cddef3fR125
Shall I submit to VTK the patch and then try to update the VTK git tag of Slicer? @jcfr what is the status of updating Slicer to the current VTK(8)? Ref: https://github.com/Kitware/VTK/pull/44
-
@lassoan I had to change the Type from string to float of the column of the table (in the table Module). vtkplot does not accept values as vtkStringArray. I don't like this too much, but converting on the fly to me seems even worst. I am open to any suggestion here. https://github.com/Punzo/Slicer/commit/29316ce388dadfcfe92996162fd48c791823a869#diff-101bce1e10d0c03a223a2f738a774488R315
-
at the moment, it is not possible to plot errors in vtk.