<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Hey Darshan,<div><br></div><div>How recent is your version of VTK? Marcus checked in a bug fix a week or two ago that may fix this. If you're using a very recent version then maybe you can post your test code and we can take a look.</div><div><br></div><div>-Eric</div><div><br></div><div><br><div><div>On Mar 29, 2011, at 7:24 PM, Darshan Pai wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Working on it some more I see some more problems . <br>I have 5 rows ans select the 5th row for color which is the category value 0 and 1 . <br>I make a lookup table with 2 values having green and blue . I select the range from 0 -1 . <br>
So ideally the plot should show the category value 0 with green and 1 with blue . <br><br>Instead I see that some of the lines of category zero are blue while some lines with category 1 are transparent . Also some lines change color in between . I don't understand what is wrong here . <br>
<br>added snapshot <br><br><br><div class="gmail_quote">On Mon, Mar 28, 2011 at 2:50 PM, Darshan Pai <span dir="ltr"><<a href="mailto:darshanpai@gmail.com">darshanpai@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Yes that was the problem . Got it working . Thanks<br><font color="#888888"><br>Darshan</font><div><div></div><div class="h5"><br><br><div class="gmail_quote">On Mon, Mar 28, 2011 at 2:41 PM, Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu" target="_blank">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">Those methods aren't defined in vtkPlot, but in vtkPlotPoints and vtkPlotParallelCoordinates separately. You'll have to cast the GetPlot() to the correct type.<div>
<br></div><font color="#888888"><div>-E</div></font><div><div></div><div><div><br><div><div>On Mar 28, 2011, at 2:39 PM, Darshan Pai wrote:</div><br><blockquote type="cite">.\PC.cpp(77) : error C2039: 'SetScalarVisibility' : is not a member of 'vtkPlot'<br>
1> C:\vtkcvs\VTK\Charts\vtkPlot.h(42) : see declaration of 'vtkPlot'<br>1>..\PC.cpp(78) : error C2039: 'SetLookupTable' : is not a member of 'vtkPlot'<br>
1> C:\vtkcvs\VTK\Charts\vtkPlot.h(42) : see declaration of 'vtkPlot'<br>1>..\PC.cpp(79) : error C2039: 'SelectColorArray' : is not a member of 'vtkPlot'<br>1> C:\vtkcvs\VTK\Charts\vtkPlot.h(42) : see declaration of 'vtkPlot'<br>
<br>Not sure if I am missing an include<br><br><div class="gmail_quote">On Mon, Mar 28, 2011 at 2:22 PM, Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu" target="_blank">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">That's strange since the Python is just a wrapper around the C++...<div><br></div>
<div>-E</div><div><br><div><div><div>On Mar 28, 2011, at 2:15 PM, Darshan Pai wrote:</div><br></div><blockquote type="cite"><div>Thanks I get it . <br><br>BTW I cannot convert it for C++ . Is there a way to port it to C++. Esp ScalarVisibility and SelectColorArray is not defined in C++<br>
<br></div><div class="gmail_quote"><div>On Mon, Mar 28, 2011 at 9:44 AM, Eric E. Monson <span dir="ltr"><<a href="mailto:emonson@cs.duke.edu" target="_blank">emonson@cs.duke.edu</a>></span> wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hey Darshan,<div><br></div><div>I don't remember if there's a way to color the lines in the older parallel coordinates view (and don't have time to look right now), but in the new Charts classes you can color plots by another array. This will be in 5.8 and it's been in git master for a while, but it wasn't in 5.6.</div>
<div><br></div><div>(There is a little bug lingering in the parallel coordinates charts plot which causes it to use the plot's pen opacity instead of the opacity of the lookup table you've passed it, but I think Marcus is trying to get around to checking in a fix sometime soon.)</div>
<div><br></div><div>Here's an example that uses categorical colors with the parallel coordinates:</div><div><br></div><div>Talk to you later,</div><div>-Eric</div><div><div style="font-size:12px"><br></div><div style="font-size:12px">
· · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · ·</div><div style="font-size:12px">Eric E Monson</div><div style="font-size:12px">Duke Visualization Technology Group</div><div style="font-size:12px"><br>
</div></div></div><div><span><ParallelCoordinatesCatsColors.png></span><div><div></div><div><br><div>
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;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;font-size:medium"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<div><span style="font-size:medium"><br></span></div></div></span></span><br>
</div>
<div># Translated to Python from [VTK]/Charts/Testing/Cxx/TestPCPlot.cxx</div><div><br></div><div>import vtk</div><div>import math</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># Test charting with a few more points...</div><div>numPoints = 100</div><div>numCats = 8</div><div>inc = 7.5 / (numPoints-1)</div><div><br></div><div># Create arrays that will end up as table columns</div>
<div>arrX = vtk.vtkFloatArray()</div><div>arrX.SetName("XAxis")</div><div>arrX.SetNumberOfComponents(1)</div><div>arrX.SetNumberOfTuples(numPoints)</div><div>arrC = vtk.vtkFloatArray()</div><div>arrC.SetName("Cosine")</div>
<div>arrC.SetNumberOfComponents(1)</div><div>arrC.SetNumberOfTuples(numPoints)</div><div>arrS = vtk.vtkFloatArray()</div><div>arrS.SetName("Sine")</div><div>arrS.SetNumberOfComponents(1)</div><div>arrS.SetNumberOfTuples(numPoints)</div>
<div><br></div><div>arrCat = vtk.vtkIntArray()</div><div>arrCat.SetName("Category_ids")</div><div>arrCat.SetNumberOfComponents(1)</div><div>arrCat.SetNumberOfTuples(numPoints)</div><div><br></div><div># For some reason table.SetValue() is not wrapped</div>
<div># <span style="white-space:pre-wrap">        </span>so need to build arrays and then add as columns</div><div># Would be more elegant to use numpy, but wanted to keep it out for now...</div><div>for i in range(numPoints):</div>
<div><span style="white-space:pre-wrap">        </span>arrX.SetTuple1(i, i * inc)</div><div><span style="white-space:pre-wrap">        </span>arrC.SetTuple1(i, math.cos(i * inc) + 0.0)</div><div><span style="white-space:pre-wrap">        </span>arrS.SetTuple1(i, math.sin(i * inc) + 0.0)</div>
<div><span style="white-space:pre-wrap">        </span>arrCat.SetTuple1(i, int(float(numCats)*float(i)/float(numPoints)))</div><div><br></div><div># Create a table with some points in it...</div><div>table = vtk.vtkTable()</div>
<div>table.AddColumn(arrX)</div><div>table.AddColumn(arrC)</div><div>table.AddColumn(arrS)</div><div>table.AddColumn(arrCat)</div><div><br></div><div>cl = []</div><div>cl.append([float(cc)/255.0 for cc in [27, 158, 119]])<span style="white-space:pre-wrap">        </span># Colorbrewer Dark2</div>
<div>cl.append([float(cc)/255.0 for cc in [217, 95, 2]])</div><div>cl.append([float(cc)/255.0 for cc in [117, 112, 179]])</div><div>cl.append([float(cc)/255.0 for cc in [231, 41, 138]])</div><div>cl.append([float(cc)/255.0 for cc in [102, 166, 30]])</div>
<div>cl.append([float(cc)/255.0 for cc in [230, 171, 2]])</div><div>cl.append([float(cc)/255.0 for cc in [166, 118, 29]])</div><div>cl.append([float(cc)/255.0 for cc in [102, 102, 102]])</div><div><br></div><div>lut = vtk.vtkLookupTable()</div>
<div>lutNum = len(cl)</div><div>lut.SetNumberOfTableValues(lutNum)</div><div>lut.Build()</div><div>for ii,cc in enumerate(cl):</div><div><span style="white-space:pre-wrap">        </span>lut.SetTableValue(ii,cc[0],cc[1],cc[2],1.0)</div>
<div>lut.SetRange(0,numCats-1)</div><div>lut.SetAlpha(1.0)</div><div><br></div><div>chart.GetPlot(0).SetInput(table)</div><div>chart.GetPlot(0).SetScalarVisibility(1)</div><div>chart.GetPlot(0).SetLookupTable(lut)</div><div>
chart.GetPlot(0).SelectColorArray("Category_ids")</div><div><br></div><div>chart.GetPlot(0).GetPen().SetOpacityF(0.8)</div><div><br></div><div>view.GetRenderWindow().SetMultiSamples(0)</div><div>view.GetRenderWindow().Render()</div>
<div><br></div><div>view.GetInteractor().Start()</div><div><br></div><div><br></div><div><br></div><div><div><div></div><div><div>On Mar 26, 2011, at 1:15 AM, Darshan Pai wrote:</div><br></div></div><blockquote type="cite">
<div><div></div><div>Oh ok , so i guess it somehow picks up the internal arrays from the RTanalyticsSOurce.<br>Is there anyway to have some of the lines as different colors ? I mean like categorical data.<br>There is also a Parallel Coordinates in the Charts too .<br>
<br><div class="gmail_quote">On Fri, Mar 25, 2011 at 10:38 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div>On Fri, Mar 25, 2011 at 8:12 PM, Darshan Pai <<a href="mailto:darshanpai@gmail.com" target="_blank">darshanpai@gmail.com</a>> wrote:<br>
><br>
> This example<br>
> <a href="http://www.vtk.org/Wiki/VTK/Examples/Python/Infovis/ParallelCoordinatesExtraction" target="_blank">http://www.vtk.org/Wiki/VTK/Examples/Python/Infovis/ParallelCoordinatesExtraction</a><br>
> I can run it , but can someone please explain this part in the code<br>
> rep.SetInputArrayToProcess(0,0,0,0,'RTDataGradient')<br>
> rep.SetInputArrayToProcess(1,0,0,0,'RTData')<br>
> rep.SetInputArrayToProcess(2,0,0,0,'Elevation')<br>
> rep.SetInputArrayToProcess(3,0,0,0,'BrownianVectors')<br>
><br>
> How is this data acquired ? I never used Infovis before so I am not clear what these lines are doing exactly<br>
> Thanks in advance<br>
> Darshan<br>
<br>
</div></div>The SetInputArrayToProcess function is among the most confusing ones I<br>
have encountered (it doesn't have anything to do with vtkInfovis)<br>
<br>
<a href="http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html#a6bea16e1329609dbccce0ff8d2367484" target="_blank">http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html#a6bea16e1329609dbccce0ff8d2367484</a><br>
<br>
I believe all that is happening is the arrays RTDataGradient, RTData,<br>
Elevation, BrownianVectors are being set as vertical axes in the<br>
parallel coordinate representation. The first parameter, 'idx', is<br>
setting the 0th array, the 1st array, etc. I just always put 0's for<br>
the rest of the arguments.<br>
<br>
It has always seemed to me that for saneness there should be a<br>
<br>
void SetInputArrayToProcess (int idx, const char *name)<br>
<br>
so the explanation of "I don't know, just put 0's" doesn't ever have to be used.<br>
<font color="#888888"><br>
David<br>
</font></blockquote></div><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><br></div></div></div></div></blockquote></div><br>
</blockquote></div><br></div></div></blockquote></div><br>
</blockquote></div><br></div></div></div></div></blockquote></div><br>
</div></div></blockquote></div><br>
<span><plotoutput.jpg></span></blockquote></div><br></div></body></html>