<div dir="ltr"><div class="gmail_default" style="font-size:small">The best way to get the data is to check out VTKExamples as detailed here.</div><div class="gmail_default" style="font-size:small">Once you have done this the data files can be found in VTKExamples/src/Testing/Data.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">If you are a Python user I have usually created a function: <b>get_program_parameters()</b>. This function tells you the data file used and any parameters needed.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">In the case of the Cxx code you will usually find code like this:</div><div class="gmail_default" style="font-size:small">
<pre style="box-sizing:inherit;color:rgb(55,71,79);font-feature-settings:"kern";font-family:"Roboto Mono","Courier New",Courier,monospace;background-color:transparent;font-size:13.6px;margin:0px;border-radius:0.2rem;line-height:1.4;display:block;padding:1.05rem 1.2rem;overflow:auto;vertical-align:top;text-decoration-style:initial;text-decoration-color:initial"> <span class="gmail-k" style="box-sizing:inherit;color:rgb(59,120,231)">if</span> <span class="gmail-p" style="box-sizing:inherit">(</span><span class="gmail-n" style="box-sizing:inherit">argc</span> <span class="gmail-o" style="box-sizing:inherit;color:inherit"><</span> <span class="gmail-mi" style="box-sizing:inherit;color:rgb(231,76,60)">2</span><span class="gmail-p" style="box-sizing:inherit">)</span>
<span class="gmail-p" style="box-sizing:inherit">{</span>
<span class="gmail-hll" style="box-sizing:inherit;display:block;padding:0px 1.2rem;background-color:rgba(240,240,240,0.8)"> <span class="gmail-n" style="box-sizing:inherit">std</span><span class="gmail-o" style="box-sizing:inherit;color:inherit">::</span><span class="gmail-n" style="box-sizing:inherit">cout</span> <span class="gmail-o" style="box-sizing:inherit;color:inherit"><<</span> <span class="gmail-s" style="box-sizing:inherit;color:rgb(13,144,79)">"Usage: "</span> <span class="gmail-o" style="box-sizing:inherit;color:inherit"><<</span> <span class="gmail-n" style="box-sizing:inherit">argv</span><span class="gmail-p" style="box-sizing:inherit">[</span><span class="gmail-mi" style="box-sizing:inherit;color:rgb(231,76,60)">0</span><span class="gmail-p" style="box-sizing:inherit">]</span> <span class="gmail-o" style="box-sizing:inherit;color:inherit"><<</span> <span class="gmail-s" style="box-sizing:inherit;color:rgb(13,144,79)">" carotid.vtk"</span> <span class="gmail-o" style="box-sizing:inherit;color:inherit"><<</span> <span class="gmail-n" style="box-sizing:inherit">std</span><span class="gmail-o" style="box-sizing:inherit;color:inherit">::</span><span class="gmail-n" style="box-sizing:inherit">endl</span><span class="gmail-p" style="box-sizing:inherit">;</span>
</span> <span class="gmail-k" style="box-sizing:inherit;color:rgb(59,120,231)">return</span> <span class="gmail-n" style="box-sizing:inherit">EXIT_SUCCESS</span><span class="gmail-p" style="box-sizing:inherit">;</span>
<span class="gmail-p" style="box-sizing:inherit">}</span>
</pre><div class="gmail_default" style="font-size:small"><br></div>Alternatively, look at the CMakeLists.txt file in the directory where the Cxx code lives. For the Cxx equivalent of the Python example you used, it is in
<span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">VTKExamples/Visualization. If you look at the CMakeLists.txt file there you will find a line:</span></div><div class="gmail_default"><div class="gmail_default">------</div><div class="gmail_default">add_test(${KIT}-ComplexV ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests</div><div class="gmail_default"> TestComplexV ${DATA}/carotid.vtk)</div><div class="gmail_default" style="font-size:small">------</div><div class="gmail_default" style="font-size:small">Note that the paramters are also listed here e.g. in the case of
<span style="background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">CorrectlyRenderTranslucentGeometry.cxx:</span></div>
<div class="gmail_default">------</div><div class="gmail_default">add_test(${KIT}-CorrectlyRenderTranslucentGeometry ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${KIT}CxxTests</div><div class="gmail_default"> TestCorrectlyRenderTranslucentGeometry 100 100 50 0.1 0 0)</div><div class="gmail_default">------</div></div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Regards</div><div class="gmail_default" style="font-size:small"> Andrew</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">---------- Forwarded message ----------<br>From:<div class="gmail_default" style="font-size:small;display:inline"></div> Aron Helser <<a href="mailto:aron.helser@kitware.com" target="_blank">aron.helser@kitware.com</a>><br>To: Jack Eiler <<a href="mailto:babybishops@gmail.com" target="_blank">babybishops@gmail.com</a>><br>Cc: <a href="mailto:vtkusers@public.kitware.com" target="_blank">vtkusers@public.kitware.com</a><br>Bcc: <br>Date: Fri, 6 Jul 2018 10:21:55 -0400<br>Subject: Re: [vtkusers] How can I plot a Hedgehog with programmatically-built data? (Python)<br><div dir="ltr">If you build VTK, with testing or with examples, the data files end up in the build directory. It's a binary file ~2.5Mb, or I'd attach it.<div>The example uses
<span style="color:rgb(55,71,79);font-family:"Roboto Mono","Courier New",Courier,monospace;font-size:13.6px;white-space:pre-wrap;background-color:rgba(240,240,240,0.8);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">vtkStructuredPointsReader</span> to read the file, then
<span style="color:rgb(55,71,79);font-family:"Roboto Mono","Courier New",Courier,monospace;font-size:13.6px;white-space:pre-wrap;background-color:rgba(240,240,240,0.8);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">vtkPolyDataMapper</span> , tells you carotid is probably a PolyData, so you can look for examples of constructing that. The example of exchanging data with Numpy arrays might be helpful.</div><div>HTH,</div><div>Aron<br><div><br></div></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Jul 6, 2018 at 4:10 AM J. <<a href="mailto:babybishops@gmail.com" target="_blank">babybishops@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>I'd like to draw a Hedgehog plot in Python. I had a look at this example:</div><div><br></div><div><a href="https://lorensen.github.io/VTKExamples/site/Python/Visualization/ComplexV/" target="_blank">https://lorensen.github.io/VTKExamples/site/Python/Visualization/ComplexV/</a></div><div><br></div><div>But unfortunately the data for the plot there is just read from a file, "carotid.vtk" (a file which, by the way, I can't find anywhere on the Internet - maybe a download a link could be added to the examples page?). Thus it's quite opaque exactly how this data needs to be presented. I've been trying to guess my way to success by looking at some C code I found, but I'm not getting any joy.</div><div><br></div><div>Say I have a 2-dimensional python array of python 3-tuples representing the values of a vector field at each point of a regular 3d grid. What steps do I take to plot that as a hedgehog?<br></div></div></blockquote></div></blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail-m_-773088438621160474gmail_signature">___________________________________________<br>Andrew J. P. Maclean<br><br>___________________________________________</div></div>