View Issue Details

IDProjectCategoryView StatusLast Update
0004436Slicer4Core: Chartpublic2017-09-22 03:16
ReporterlassoanAssigned ToDavide 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionSlicer 4.7.0 
Target VersionFixed in Version 
Summary0004436: Interactive plot: need GUI to specify x axis coordinates
Description

In the interactive plot view I don't see how I can set the column for x axis (or how to set to just use simple ordinal numbers 1, 2, 3, ... as x coordinate values).

TagsNo tags attached.

Activities

Davide

Davide

2017-09-21 08:45

developer   ~0015100

Last edited: 2017-09-21 08:48

View 4 revisions

You are right. I assumed that the first selected column in the table is the x axis and the others are different Y axes (and for each one I allocate a PlotDataNode).

It is possible to change the X and Y columns of a PlotDataNode. However, I am not sure how to implement a change of the X-axis for all the PlotDataNodes in a PlotChartNode through the PlotViewController GUI after the plots have been already instantiated.

I think the best is to modify the widget in the table Module giving more options. Something like in which the user can choose which is the X-axis between the selected or if all the selected columns are all Y-axes and the Plot should use simple ordinal numbers as X-axis. Let me know if you like this solution.

lassoan

lassoan

2017-09-21 08:56

developer   ~0015101

Last edited: 2017-09-21 08:56

View 2 revisions

I would use the same (or very similar GUI) as in Paraview - see the attached image. You have the option to just use the index or select a column for X array.



Davide

Davide

2017-09-21 09:21

developer   ~0015102

Last edited: 2017-09-21 09:29

View 3 revisions

OK, but where shall I put this: in the PlotViewController GUI? or in the table Module GUI?

The problem is that the current implementation of the button to create the plot from the Table Module GUI assume that the first column is the X-Axis.
So I think the best is to change that behavior and add something similar to Paraview in the GUI of the Table Module, do you agree?

lassoan

lassoan

2017-09-21 09:50

developer   ~0015103

In Tables module GUI you only set table properties, so it's not a good place to specify if a column should act as X axis in a certain plot. What we have in the table module GUI is a convenience function that may assume that the first column is the X axis (or it may use index as X axis and interpret all columns as arrays) but the X axis selection should be later editable in PlotViewController.

lassoan

lassoan

2017-09-21 10:25

developer   ~0015104

I don't understand what makes some columns show up in the series list. How PlotData nodes can be created and edited?

lassoan

lassoan

2017-09-21 10:36

developer   ~0015105

I've noticed that in vtkMRMLPlotChartNode you store both column index and name. Column index should not be used for referring to a column in a table, as it can be changed too easily (e.g., you add or delete a column before). Store the column name only.

Davide

Davide

2017-09-21 10:56

developer   ~0015106

Last edited: 2017-09-21 11:04

View 2 revisions

ok, I'll modify and store only the name. Sorry, but I didn't understand your previous question

P.S.:
I am preparing another pull request with all the new modifications:
https://github.com/Punzo/Slicer/tree/AdditionalFeaturesForVTKPLotting

lassoan

lassoan

2017-09-21 11:11

developer   ~0015107

I don't understand what makes some columns show up in the series list. How PlotData nodes can be created and edited?
Sorry, but I didn't understand your previous question

If I create a table node and add a column, then the new column does not show up in the plot view controls. How do I make it show up?
I know that I can do it using the plot button in tables module, but how can I edit the resulting PlotData node?

We should have a way of viewing list of all PlotData nodes, create new ones, and editing existing ones - all at one place. It could be in the Plot view controller, but if there is not enough space or the GUI would become too complex then it may be better to create a module GUI where we could view/edit/create/delete all PlotChart and PlotData nodes.

Davide

Davide

2017-09-21 11:23

developer   ~0015108

Last edited: 2017-09-21 11:32

View 3 revisions

OK, now I got what you mean. The answer is that it is not possible to edit the properties of PlotData from the GUI. The properties of PlotChart instead are all exposed in the GUI of the PlotViewController. Each PlotData will need some GUI, definitively it cannot be inserted in the ViewController, both for reason of complexity and space. We may think to add a PlotViewController more extended in the module ViewControllers

So at the moment, if you want to show a column added after the first plot, you need to select the new column (+ the x-Axis column) and push again the button plot in the Table Module GUI

Davide

Davide

2017-09-21 11:37

developer   ~0015109

Last edited: 2017-09-21 11:47

View 3 revisions

sorry neither the PlotChart proprieties are all exposed in the GUI: here is the full list of them

/// \li "Type" - "Line", "Line and Scatter", "Scatter", "Bar"
/// \li "TitleName" - title ploted on the PlotChart
/// \li "ShowTitle" - show title "on" or "off"
/// \li "XAxisLabelName" - label ploted on the x-axis
/// \li "ShowXAxisLabel" - show x-axis label "on" or "off"
/// \li "ClickAndDragAlongX" - set the action along x-axis "on" or "off"
/// \li "ClickAndDragAlongY" - set the action along y-axis "on" or "off"
/// \li "YAxisLabelName" - label ploted on the y-axis
/// \li "ShowYAxisLabel" - show y-axis label "on" or "off"
/// \li "ShowGrid" - show grid "on" or "off"
/// \li "ShowLegend" - show legend "on" or "off"
/// \li "FontType" - global Font for the PlotChart: "Arial", "Times", "Courier"
/// \li "TitleFontSize" - default: "20"
/// \li "AxisTitleFontSize" - default: "16"
/// \li "AxisLabelFontSize" - default: "12"
/// \li "LookupTable" colorNodeID default: NULL

as you can see the Font Size, Font Type, the ClickAndDrag and the LookupTable (for the colors) options are not accessible from the GUI of the current PlotViewController.

Davide

Davide

2017-09-21 12:28

developer   ~0015111

Last edited: 2017-09-21 12:32

View 2 revisions

done in https://github.com/Slicer/Slicer/pull/795

i.e.:
Change x-Axis, store only Name and not indexes in PlotDataNodes

Davide

Davide

2017-09-21 12:31

developer   ~0015112

NEXT TO DO:

1) Adding in the Table Module some GUI to cast the Column Type (current default is string, not working with Plots);

2) Adding a more extended GUI of the PlotViewController in the Module ViewControllers.

Andras, will you take care of the first point or do you want I do it?
For the second point, sorry but now I don't have the time.

Davide

Davide

2017-09-22 03:16

developer   ~0015118

fixed in https://github.com/Slicer/Slicer/commit/57e0ad748af7f97592bbb2c34da0a050ba07c179
https://github.com/Slicer/Slicer/commit/6a57e1861dd8c4c17e8c065e28f417d684f7ecc1

Issue History

Date Modified Username Field Change
2017-09-20 16:28 lassoan New Issue
2017-09-20 16:28 lassoan Status new => assigned
2017-09-20 16:28 lassoan Assigned To => Davide
2017-09-21 08:45 Davide Note Added: 0015100
2017-09-21 08:46 Davide Note Edited: 0015100 View Revisions
2017-09-21 08:47 Davide Note Edited: 0015100 View Revisions
2017-09-21 08:48 Davide Note Edited: 0015100 View Revisions
2017-09-21 08:56 lassoan File Added: PlottingOptionsParaview.png
2017-09-21 08:56 lassoan Note Added: 0015101
2017-09-21 08:56 lassoan Note Edited: 0015101 View Revisions
2017-09-21 09:21 Davide Note Added: 0015102
2017-09-21 09:28 Davide Note Edited: 0015102 View Revisions
2017-09-21 09:29 Davide Note Edited: 0015102 View Revisions
2017-09-21 09:50 lassoan Note Added: 0015103
2017-09-21 10:25 lassoan Note Added: 0015104
2017-09-21 10:36 lassoan Note Added: 0015105
2017-09-21 10:56 Davide Note Added: 0015106
2017-09-21 11:04 Davide Note Edited: 0015106 View Revisions
2017-09-21 11:11 lassoan Note Added: 0015107
2017-09-21 11:23 Davide Note Added: 0015108
2017-09-21 11:24 Davide Note Edited: 0015108 View Revisions
2017-09-21 11:32 Davide Note Edited: 0015108 View Revisions
2017-09-21 11:37 Davide Note Added: 0015109
2017-09-21 11:38 Davide Note Edited: 0015109 View Revisions
2017-09-21 11:47 Davide Note Edited: 0015109 View Revisions
2017-09-21 12:28 Davide Note Added: 0015111
2017-09-21 12:31 Davide Note Added: 0015112
2017-09-21 12:32 Davide Note Edited: 0015111 View Revisions
2017-09-22 03:16 Davide Status assigned => resolved
2017-09-22 03:16 Davide Resolution open => fixed
2017-09-22 03:16 Davide Note Added: 0015118