|
This example I can run it , but can someone please explain this part in the code rep.SetInputArrayToProcess(0,0,0,0,'RTDataGradient') rep.SetInputArrayToProcess(1,0,0,0,'RTData') rep.SetInputArrayToProcess(2,0,0,0,'Elevation') rep.SetInputArrayToProcess(3,0,0,0,'BrownianVectors') How is this data acquired ? I never used Infovis before so I am not clear what these lines are doing exactly
Thanks in advance Darshan
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
On Fri, Mar 25, 2011 at 8:12 PM, Darshan Pai <[hidden email]> wrote:
> > This example > http://www.vtk.org/Wiki/VTK/Examples/Python/Infovis/ParallelCoordinatesExtraction > I can run it , but can someone please explain this part in the code > rep.SetInputArrayToProcess(0,0,0,0,'RTDataGradient') > rep.SetInputArrayToProcess(1,0,0,0,'RTData') > rep.SetInputArrayToProcess(2,0,0,0,'Elevation') > rep.SetInputArrayToProcess(3,0,0,0,'BrownianVectors') > > How is this data acquired ? I never used Infovis before so I am not clear what these lines are doing exactly > Thanks in advance > Darshan The SetInputArrayToProcess function is among the most confusing ones I have encountered (it doesn't have anything to do with vtkInfovis) http://www.vtk.org/doc/nightly/html/classvtkAlgorithm.html#a6bea16e1329609dbccce0ff8d2367484 I believe all that is happening is the arrays RTDataGradient, RTData, Elevation, BrownianVectors are being set as vertical axes in the parallel coordinate representation. The first parameter, 'idx', is setting the 0th array, the 1st array, etc. I just always put 0's for the rest of the arguments. It has always seemed to me that for saneness there should be a void SetInputArrayToProcess (int idx, const char *name) so the explanation of "I don't know, just put 0's" doesn't ever have to be used. David _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
Oh ok , so i guess it somehow picks up the internal arrays from the RTanalyticsSOurce.
Is there anyway to have some of the lines as different colors ? I mean like categorical data. There is also a Parallel Coordinates in the Charts too . On Fri, Mar 25, 2011 at 10:38 PM, David Doria <[hidden email]> wrote:
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
Hey Darshan,
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. (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.) Here's an example that uses categorical colors with the parallel coordinates: Talk to you later, -Eric · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · · Eric E Monson Duke Visualization Technology Group ![]() # Translated to Python from [VTK]/Charts/Testing/Cxx/TestPCPlot.cxx import vtk import math # Set up a 2D scene, add an XY chart to it view = vtk.vtkContextView() view.GetRenderer().SetBackground(1.0, 1.0, 1.0) view.GetRenderWindow().SetSize(600,300) chart = vtk.vtkChartParallelCoordinates() view.GetScene().AddItem(chart) # Test charting with a few more points... numPoints = 100 numCats = 8 inc = 7.5 / (numPoints-1) # Create arrays that will end up as table columns arrX = vtk.vtkFloatArray() arrX.SetName("XAxis") arrX.SetNumberOfComponents(1) arrX.SetNumberOfTuples(numPoints) arrC = vtk.vtkFloatArray() arrC.SetName("Cosine") arrC.SetNumberOfComponents(1) arrC.SetNumberOfTuples(numPoints) arrS = vtk.vtkFloatArray() arrS.SetName("Sine") arrS.SetNumberOfComponents(1) arrS.SetNumberOfTuples(numPoints) arrCat = vtk.vtkIntArray() arrCat.SetName("Category_ids") arrCat.SetNumberOfComponents(1) arrCat.SetNumberOfTuples(numPoints) # For some reason table.SetValue() is not wrapped # so need to build arrays and then add as columns # Would be more elegant to use numpy, but wanted to keep it out for now... for i in range(numPoints): arrX.SetTuple1(i, i * inc) arrC.SetTuple1(i, math.cos(i * inc) + 0.0) arrS.SetTuple1(i, math.sin(i * inc) + 0.0) arrCat.SetTuple1(i, int(float(numCats)*float(i)/float(numPoints))) # Create a table with some points in it... table = vtk.vtkTable() table.AddColumn(arrX) table.AddColumn(arrC) table.AddColumn(arrS) table.AddColumn(arrCat) cl = [] cl.append([float(cc)/255.0 for cc in [27, 158, 119]]) # Colorbrewer Dark2 cl.append([float(cc)/255.0 for cc in [217, 95, 2]]) cl.append([float(cc)/255.0 for cc in [117, 112, 179]]) cl.append([float(cc)/255.0 for cc in [231, 41, 138]]) cl.append([float(cc)/255.0 for cc in [102, 166, 30]]) cl.append([float(cc)/255.0 for cc in [230, 171, 2]]) cl.append([float(cc)/255.0 for cc in [166, 118, 29]]) cl.append([float(cc)/255.0 for cc in [102, 102, 102]]) lut = vtk.vtkLookupTable() lutNum = len(cl) lut.SetNumberOfTableValues(lutNum) lut.Build() for ii,cc in enumerate(cl): lut.SetTableValue(ii,cc[0],cc[1],cc[2],1.0) lut.SetRange(0,numCats-1) lut.SetAlpha(1.0) chart.GetPlot(0).SetInput(table) chart.GetPlot(0).SetScalarVisibility(1) chart.GetPlot(0).SetLookupTable(lut) chart.GetPlot(0).SelectColorArray("Category_ids") chart.GetPlot(0).GetPen().SetOpacityF(0.8) view.GetRenderWindow().SetMultiSamples(0) view.GetRenderWindow().Render() view.GetInteractor().Start() On Mar 26, 2011, at 1:15 AM, Darshan Pai wrote: Oh ok , so i guess it somehow picks up the internal arrays from the RTanalyticsSOurce. _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
Hey Darshan,
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. -Eric On Mar 29, 2011, at 7:24 PM, Darshan Pai wrote: Working on it some more I see some more problems . _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
I think it is the VTK nightly from some date in February . I will update the VTK and see whether the error still persists .
Regards Darshan On Tue, Mar 29, 2011 at 7:40 PM, Eric E. Monson <[hidden email]> wrote:
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
How do I set up the scalar range for each axis ?
On Wed, Mar 30, 2011 at 4:07 PM, Darshan Pai <[hidden email]> wrote: So i updated to the current nightly build . Now I see that the category colors are correct , but the output is transparent . I changed the opacity of the plot and set it to 1 but still the output lines are very light . Is there any way to change this behaviour . Also can I change the line Size ? _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
In reply to this post by Darshan Pai-2
Hey Darshan,
Because there's still a slight bug in the plot class you have to set the line opacity through the plot's Pen rather than through the lookup table. You also set the line width through the Pen (this is Python, so you may have to do some casting in C++): chart.GetPlot(0).GetPen().SetOpacityF(0.8) chart.GetPlot(0).GetPen().SetWidth(6) You set the scalar range for each axis (index i) by first calling chart.GetAxis(i).SetBehavior(1) to set it to a "fixed" range rather than auto-rescaling, and then you call chart.GetAxis(i).SetMaximum() and SetMinimum(). If you want/need to then specify where the ticks are and what their labels are, then you need to call chart.GetAxis(i).SetTickPositions() with a vtkDoubleArray of position values and SetTickLabels() with a vtkStringArray of labels. -Eric On Mar 30, 2011, at 4:07 PM, Darshan Pai wrote: > So i updated to the current nightly build . Now I see that the category colors are correct , but the output is transparent . I changed the opacity of the plot and set it to 1 but still the output lines are very light . Is there any way to change this behaviour . Also can I change the line Size ? > > Regards > Darshan > <Updated_PC.jpg> _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
thanks eric , works great!!
On Thu, Mar 31, 2011 at 1:38 PM, Eric E. Monson <[hidden email]> wrote: Hey Darshan, _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
Eric,
Is there an upper limit to the number of axis the Parallel Coordinates defaults too ? I was just trying for 17 , but i does not allow me anything greater than 10 . Regards Darshan
On Thu, Mar 31, 2011 at 2:00 PM, Darshan Pai <[hidden email]> wrote: thanks eric , works great!! _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
Hey Darshan,
I think there is still a default limit of 10 columns, which was probably just so the chart would still end up looking reasonable even if you fed it a table with a thousand columns. All you need to do is loop through your table column names and the call SetColumnVisibility(vtkStdString name, bool visible) for the ones you want to appear. Note that there is also a convenience method SetColumnVisibilityAll(bool visible) in case you want to turn them all on, or want all off so you can just turn on a select few. -Eric On Mar 31, 2011, at 6:38 PM, Darshan Pai wrote: Eric, _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
Eric,
I see what you are saying but then I guess there is a bug in the implementation or else I am doing something wrong . If I hide one of the columns less than 10 and unhide one column greater than 10 it crashes . Also if I try to set the max and min of columns greater than 10 it crashes too . It looks as if it only defaults to the first 10 columns. Regards Darshan On Fri, Apr 1, 2011 at 9:43 AM, Eric E. Monson <[hidden email]> wrote:
_______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
Try setting all columns invisible first, and then setting the ones you want to visible. Also, as you've seen, don't try setting attributes of axes/columns that aren't visible since it only keeps a list of and only creates vtkAxis objects for visible columns.
The PC chart is a little brittle with regard to these types of operations, but it's been a while since I looked at the code, so I can't remember exactly why. -Eric On Apr 1, 2011, at 2:05 PM, Darshan Pai wrote: Eric, _______________________________________________ Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
|
Hi,
Commit 733af6b should address the transparency issue, and I added extra API so that all four color components can be set in one call for the vtkPen and vtkBrush classes in commit 802784b. If there is something missing there let me know, but that was also merged to release for VTK 5.8. If there is some delicacy around setting the visibility of columns in the parallel coordinates please file bugs describing them to me. I am really busy right now, but will certainly try to get to them as soon as I can. Marcus -- Marcus D. Hanwell, Ph.D. R&D Engineer, Kitware Inc. (518) 881-4937 On Fri, Apr 1, 2011 at 4:51 PM, Eric E. Monson <[hidden email]> wrote: > Try setting all columns invisible first, and then setting the ones you want > to visible. Also, as you've seen, don't try setting attributes of > axes/columns that aren't visible since it only keeps a list of and only > creates vtkAxis objects for visible columns. > The PC chart is a little brittle with regard to these types of operations, > but it's been a while since I looked at the code, so I can't remember > exactly why. > -Eric > > On Apr 1, 2011, at 2:05 PM, Darshan Pai wrote: > > Eric, > > I see what you are saying but then I guess there is a bug in the > implementation or else I am doing something wrong . > If I hide one of the columns less than 10 and unhide one column greater > than 10 it crashes . > Also if I try to set the max and min of columns greater than 10 it crashes > too . > > It looks as if it only defaults to the first 10 columns. > > Regards > Darshan > > On Fri, Apr 1, 2011 at 9:43 AM, Eric E. Monson <[hidden email]> wrote: >> >> Hey Darshan, >> I think there is still a default limit of 10 columns, which was probably >> just so the chart would still end up looking reasonable even if you fed it a >> table with a thousand columns. All you need to do is loop through your table >> column names and the call SetColumnVisibility(vtkStdString name, bool >> visible) for the ones you want to appear. Note that there is also a >> convenience method SetColumnVisibilityAll(bool visible) in case you want to >> turn them all on, or want all off so you can just turn on a select few. >> -Eric >> >> On Mar 31, 2011, at 6:38 PM, Darshan Pai wrote: >> >> Eric, >> >> Is there an upper limit to the number of axis the Parallel Coordinates >> defaults too ? >> I was just trying for 17 , but i does not allow me anything greater than >> 10 . >> >> Regards >> Darshan >> >> >> On Thu, Mar 31, 2011 at 2:00 PM, Darshan Pai <[hidden email]> wrote: >>> >>> thanks eric , works great!! >>> >>> On Thu, Mar 31, 2011 at 1:38 PM, Eric E. Monson <[hidden email]> >>> wrote: >>>> >>>> Hey Darshan, >>>> >>>> Because there's still a slight bug in the plot class you have to set the >>>> line opacity through the plot's Pen rather than through the lookup table. >>>> You also set the line width through the Pen (this is Python, so you may have >>>> to do some casting in C++): >>>> >>>> chart.GetPlot(0).GetPen().SetOpacityF(0.8) >>>> chart.GetPlot(0).GetPen().SetWidth(6) >>>> >>>> You set the scalar range for each axis (index i) by first calling >>>> chart.GetAxis(i).SetBehavior(1) to set it to a "fixed" range rather than >>>> auto-rescaling, and then you call chart.GetAxis(i).SetMaximum() and >>>> SetMinimum(). If you want/need to then specify where the ticks are and what >>>> their labels are, then you need to call chart.GetAxis(i).SetTickPositions() >>>> with a vtkDoubleArray of position values and SetTickLabels() with a >>>> vtkStringArray of labels. >>>> >>>> -Eric >>>> >>>> >>>> On Mar 30, 2011, at 4:07 PM, Darshan Pai wrote: >>>> >>>> > So i updated to the current nightly build . Now I see that the >>>> > category colors are correct , but the output is transparent . I changed the >>>> > opacity of the plot and set it to 1 but still the output lines are very >>>> > light . Is there any way to change this behaviour . Also can I change the >>>> > line Size ? >>>> > >>>> > Regards >>>> > Darshan >>>> > <Updated_PC.jpg> >>>> >>> >> >> > > > > _______________________________________________ > Powered by www.kitware.com > > Visit other Kitware open-source projects at > http://www.kitware.com/opensource/opensource.html > > Please keep messages on-topic and check the VTK FAQ at: > http://www.vtk.org/Wiki/VTK_FAQ > > Follow this link to subscribe/unsubscribe: > http://www.vtk.org/mailman/listinfo/vtkusers > > Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ Follow this link to subscribe/unsubscribe: http://www.vtk.org/mailman/listinfo/vtkusers |
| Powered by Nabble | Edit this page |
