Eric, It works! =DDD<br>Thank you! :-D<br><br>"I have other examples which include setting column/axis visibility and
getting the indices of selections that I can put up on the Wiki
sometime." <br>I would be very happy with this. =]<br><br>I was trying to set visibilty and it doesn't work. <br>Example:<br><br><span style="font-family: courier new,monospace;">chart = vtk.vtkChartParallelCoordinates()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">chart.SetColumnVisibilityAll(False)</span><br><br>Python says:<br><span style="font-family: courier new,monospace;">chart.SetColumnVisibilityAll(False)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">AttributeError: SetColumnVisibilityAll</span><br><br>I don't know if I am the problem or if the vtk+python is. Because all I try to do doesn't work. :s<br><br>Thank you<br>
Henry<br><br><br>P.S. I'm trying to write in English, so sorry if I wrote wrong things. :)<br><br><br><div class="gmail_quote">On Sat, Oct 16, 2010 at 10:06, Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu">emonson@cs.duke.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">Hey Henry,<div><br></div><div>After playing with it for a few minutes I'm starting to suspect that although vtkParallelCoordinatesRepresentation is supposed to accept a vtkTable as input, maybe there are some problems with that. The example from the Wiki uses a vtkImageData as input and plots its attributes.</div>
<div><br></div><div>What you might want to do is to switch to using the parallel coordinates chart from the newer VTK Charts. It doesn't have quite as many selection mode options, but it is very nice. Also, I know it's built to take a table as input for sure:</div>
<div><br></div><div># ======</div><div>import vtk</div><div><div><br></div><div># Set up a 2D scene, add an XY chart to it</div><div>view = vtk.vtkContextView()</div><div>view.GetRenderer().SetBackground(1.0, 1.0, 1.0)</div>
<div>view.GetRenderWindow().SetSize(600,300)</div><div><br></div><div>chart = vtk.vtkChartParallelCoordinates()</div><div>view.GetScene().AddItem(chart)</div><div><br></div><div>reader = vtk.vtkDelimitedTextReader()</div>
<div class="im"><div>reader.DetectNumericColumnsOn()</div><div>reader.SetFieldDelimiterCharacters(" ")</div><div>reader.SetHaveHeaders(True)</div><div>reader.SetMaxRecords(100)</div></div><div>reader.SetFileName("News.gbdiv")</div>
<div>reader.Update()</div><div><br></div><div>chart.GetPlot(0).SetInput(reader.GetOutput())</div><div><br></div><div>view.ResetCamera()</div><div>view.Render()</div><div><br></div><div># Start interaction event loop</div>
<div>view.GetInteractor().Start()</div></div><div># ======</div><div><br></div><div>I have other examples which include setting column/axis visibility and getting the indices of selections that I can put up on the Wiki sometime.</div>
<div><br></div><div>Talk to you later,</div><div>-Eric</div><div><br></div><div><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">------------------------------------------------------<br>
Eric E Monson<br>Duke Visualization Technology Group<br></span>
</div>
<div><br></div><br><div><div><div></div><div class="h5"><div>On Oct 15, 2010, at 11:49 PM, Henry wrote:</div><br></div></div><blockquote type="cite"><div><div></div><div class="h5">Hi! :-)<br>I'm having a problem and it's:<br>
<br>I'd like to plot parallel coordinates but I can't. The vtkParallelCoordinatesRepresentation can't get my data. It doesn't plot the rows.<br><br>I'm trying to be guided by the example of the wiki: <a href="http://www.vtk.org/Wiki/VTK/Examples/Python/Infovis/ParallelCoordinatesView" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Python/Infovis/ParallelCoordinatesView</a><br>
(The example works very well; my code doesn't)<br><br>My code is:<br><b>(...)<br><br><span style="font-family:courier new,monospace">reader = vtkDelimitedTextReader()</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">reader.DetectNumericColumnsOn()</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">reader.SetFieldDelimiterCharacters(" ")</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">reader.SetHaveHeaders(True)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">reader.SetMaxRecords(100)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">reader.SetFileName(".\DataSets\News.gbdiv")</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">reader.Update()</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">#table = reader.GetOutput()</span><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">rep = vtk.vtkParallelCoordinatesRepresentation()</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"># I don't know why this don't work<br><br style="font-family:courier new,monospace"></span><span style="font-family:courier new,monospace">rep.SetInputConnection(reader.GetOutputPort())</span> <br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"><br>#I have tried many ways to put my data in, but nothing works. another is:</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">#rep.SetInput(table)</span></b><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace" clear="all"><b style="font-family:courier new,monospace">rep.SetInputArrayToProcess(0,0,0,0,'all')<br>rep.SetInputArrayToProcess(1,0,0,0,'music')<br>rep.SetInputArrayToProcess(2,0,0,0,'entertainment')<br>
rep.SetInputArrayToProcess(3,0,0,0,'health')<br>rep.SetInputArrayToProcess(4,0,0,0,'business')<br>rep.SetInputArrayToProcess(5,0,0,0,'sport')<br>rep.SetInputArrayToProcess(6,0,0,0,'science')<br>
rep.SetInputArrayToProcess(7,0,0,0,'environment')<br>rep.SetInputArrayToProcess(8,0,0,0,'politics')</b><br style="font-family:courier new,monospace"><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">#Here is the same code in the example of the wiki</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">rep.SetUseCurves(0) </span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">rep.SetLineOpacity(0.5)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">view.SetRepresentation(rep)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">view.SetInspectMode(1) </span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">view.SetBrushModeToLasso()</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">view.SetBrushOperatorToReplace()</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">def ToggleInspectors(obj,event):</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> if (view.GetInspectMode() == 0):</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> view.SetInspectMode(1)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace"> else:</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> view.SetInspectMode(0)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">view.GetInteractor().AddObserver("UserEvent", ToggleInspectors)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">view.GetRenderWindow().SetSize(1000,600)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">view.ResetCamera()</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace">view.Render()</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">view.GetInteractor().Start()</span><br><br><br>The data read by the reader is(each column,All, Music, Enter..., is a coordinate):<br>
<b style="font-family:courier new,monospace">All Music Entertainment Health Business Sport Science Environment Politics<br>2.02657807 0.86289549 0.31007752 1.10266160 0.92307692 0.27089783 0.98556846 0.45808520 0.11614402<br>
1.67774086 0.23969319 2.17054264 0.83650190 0.19230769 0.00000000 0.70397747 0.04580852 0.27100271<br>1.16279070 0.14381592 0.10335917 0.41825095 0.73076923 0.34829721 0.35198874 0.22904260 0.61943477</b><br style="font-family:courier new,monospace">
<b style="font-family:courier new,monospace">(...)</b><br style="font-family:courier new,monospace"><br><br>What should I do to plot my data? What am I forgetting to? The reader get my data and the GetOutput() return a table. I've tried get some values by index and i'v got the right ones. But I can't plot it. =\<br>
<br>Thank you, <br>:)<br><br>-- <br>Henry<br><br>Bacharelado em Ciências de Computação - 2007<br>ICMC - USP - São Carlos<br></div></div>
_______________________________________________<br>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</blockquote></div></div></div></blockquote></div>