<div dir="ltr">Hi Bea,<div><br></div><div>Then the answer is simple: vtkTransformFilter does not change the "DepthArray" because the transform only operates on point coordinates.  It does not operate on the scalars that are associated with those points.</div><div><br></div><div> - David</div><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Feb 17, 2017 at 7:31 AM, Schober Beatrix [STEMMER IMAGING GmbH] <span dir="ltr"><<a href="mailto:b.schober@stemmer-imaging.de" target="_blank">b.schober@stemmer-imaging.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="DE" link="blue" vlink="purple">
<div class="m_790850733364961156WordSection1">
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">Hi David,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">I do have x, y and z values (e.g. as txt file or as a grayscale image):<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:#dadada">vtkPoints</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#b4b4b4">=</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#4ec9b0">vtkSmartPointer</span><span style="font-family:Consolas;color:#b4b4b4"><</span><span style="font-family:Consolas;color:#4ec9b0">vt<wbr>kPoints</span><span style="font-family:Consolas;color:#b4b4b4">>::</span><span style="font-family:Consolas;color:#c8c8c8">New</span><span style="font-family:Consolas;color:#b4b4b4">();</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:#dadada">vtkCells</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#b4b4b4">=</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#4ec9b0">vtkSmartPointer</span><span style="font-family:Consolas;color:#b4b4b4"><</span><span style="font-family:Consolas;color:#4ec9b0">vtk<wbr>CellArray</span><span style="font-family:Consolas;color:#b4b4b4">>::</span><span style="font-family:Consolas;color:#c8c8c8">New</span><span style="font-family:Consolas;color:#b4b4b4">();</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:#dadada">vtkDepths</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#b4b4b4">=</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#4ec9b0">vtkSmartPointer</span><span style="font-family:Consolas;color:#b4b4b4"><</span><span style="font-family:Consolas;color:#4ec9b0">vt<wbr>kDoubleArray</span><span style="font-family:Consolas;color:#b4b4b4">>::</span><span style="font-family:Consolas;color:#c8c8c8">New</span><span style="font-family:Consolas;color:#b4b4b4">();</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:#569cd6">void</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#c8c8c8">addPoint</span><span style="font-family:Consolas;color:#b4b4b4">(</span><span style="font-family:Consolas;color:#569cd6">double</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#7f7f7f">x</span><span style="font-family:Consolas;color:#b4b4b4">,</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#569cd6">double</span><span style="font-family:Consolas;color:gainsboro"><wbr> </span><span style="font-family:Consolas;color:#7f7f7f">y</span><span style="font-family:Consolas;color:#b4b4b4">,</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#569cd6">double</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#7f7f7f">z</span><span style="font-family:Consolas;color:#b4b4b4">)</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:#b4b4b4">{</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:gainsboro">  </span><span style="font-family:Consolas;color:#4ec9b0">vtkIdType</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#c8c8c8">id</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#b4b4b4">=</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#dadada">vtkPoints</span><span style="font-family:Consolas;color:#b4b4b4">-></span><span style="font-family:Consolas;color:#c8c8c8">In<wbr>sertNextPoint</span><span style="font-family:Consolas;color:#b4b4b4">(</span><span style="font-family:Consolas;color:#7f7f7f">x</span><span style="font-family:Consolas;color:#b4b4b4">,</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#7f7f7f">y</span><span style="font-family:Consolas;color:#b4b4b4">,</span><span style="font-family:Consolas;color:gainsboro"> </span><span style="font-family:Consolas;color:#7f7f7f">z</span><span style="font-family:Consolas;color:#b4b4b4">);</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:gainsboro">  </span><span style="font-family:Consolas;color:#dadada">vtkDepths</span><span style="font-family:Consolas;color:#b4b4b4">-></span><span style="font-family:Consolas;color:#c8c8c8">InsertNextValue</span><span style="font-family:Consolas;color:#b4b4b4">(</span><span style="font-family:Consolas;color:#7f7f7f">z</span><span style="font-family:Consolas;color:#b4b4b4"><wbr>);</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:gainsboro">  </span><span style="font-family:Consolas;color:#dadada">vtkCells</span><span style="font-family:Consolas;color:#b4b4b4">-></span><span style="font-family:Consolas;color:#c8c8c8">InsertNextCell</span><span style="font-family:Consolas;color:#b4b4b4">(</span><span style="font-family:Consolas;color:#b5cea8">1</span><span style="font-family:Consolas;color:#b4b4b4">);</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:gainsboro">  </span><span style="font-family:Consolas;color:#dadada">vtkCells</span><span style="font-family:Consolas;color:#b4b4b4">-></span><span style="font-family:Consolas;color:#c8c8c8">InsertCellPoint</span><span style="font-family:Consolas;color:#b4b4b4">(</span><span style="font-family:Consolas;color:#c8c8c8">id</span><span style="font-family:Consolas;color:#b4b4b4"><wbr>);</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:gainsboro"> <u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:gainsboro">  </span><span style="font-family:Consolas;color:#dadada">vtkCells</span><span style="font-family:Consolas;color:#b4b4b4">-></span><span style="font-family:Consolas;color:#c8c8c8">Modified</span><span style="font-family:Consolas;color:#b4b4b4">();</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:gainsboro">  </span><span style="font-family:Consolas;color:#dadada">vtkPoints</span><span style="font-family:Consolas;color:#b4b4b4">-></span><span style="font-family:Consolas;color:#c8c8c8">Modified</span><span style="font-family:Consolas;color:#b4b4b4">();</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:gainsboro">  </span><span style="font-family:Consolas;color:#dadada">vtkDepths</span><span style="font-family:Consolas;color:#b4b4b4">-></span><span style="font-family:Consolas;color:#c8c8c8">Modified</span><span style="font-family:Consolas;color:#b4b4b4">();</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<pre style="background:#1e1e1e"><span style="font-family:Consolas;color:#b4b4b4">}</span><span style="font-family:Consolas;color:gainsboro"><u></u><u></u></span></pre>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal" style="background:#1e1e1e"><span style="font-size:10.0pt;font-family:Consolas;color:#dadada">vtkDepths</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">-></span><span style="font-size:10.0pt;font-family:Consolas;color:#c8c8c8">SetName</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">(</span><span style="font-size:10.0pt;font-family:Consolas;color:#d69d85">"<wbr>DepthArray"</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">);</span><span style="font-size:10.0pt;font-family:Consolas;color:gainsboro"><u></u><u></u></span></p>
<p class="MsoNormal" style="background:#1e1e1e"><span style="font-size:10.0pt;font-family:Consolas;color:#dadada">vtkPolyData</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">-></span><span style="font-size:10.0pt;font-family:Consolas;color:#c8c8c8">SetPoints</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">(</span><span style="font-size:10.0pt;font-family:Consolas;color:#dadada">m_<wbr>vtkPoints</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">);</span><span style="font-size:10.0pt;font-family:Consolas;color:gainsboro"><u></u><u></u></span></p>
<p class="MsoNormal" style="background:#1e1e1e"><span style="font-size:10.0pt;font-family:Consolas;color:#dadada">vtkPolyData</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">-></span><span style="font-size:10.0pt;font-family:Consolas;color:#c8c8c8">SetVerts</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">(</span><span style="font-size:10.0pt;font-family:Consolas;color:#dadada">m_<wbr>vtkCells</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">);</span><span style="font-size:10.0pt;font-family:Consolas;color:gainsboro"><u></u><u></u></span></p>
<p class="MsoNormal" style="background:#1e1e1e"><span style="font-size:10.0pt;font-family:Consolas;color:#dadada">vtkPolyData</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">-></span><span style="font-size:10.0pt;font-family:Consolas;color:#c8c8c8">GetPointData</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">()-></span><span style="font-size:10.0pt;font-family:Consolas;color:#c8c8c8">S<wbr>etScalars</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">(</span><span style="font-size:10.0pt;font-family:Consolas;color:#dadada">m_vtkDepths</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">);</span><span style="font-size:10.0pt;font-family:Consolas;color:gainsboro"><u></u><u></u></span></p>
<p class="MsoNormal" style="background:#1e1e1e"><span style="font-size:10.0pt;font-family:Consolas;color:#dadada">vtkPolyData</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">-></span><span style="font-size:10.0pt;font-family:Consolas;color:#c8c8c8">GetPointData</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">()-></span><span style="font-size:10.0pt;font-family:Consolas;color:#c8c8c8">S<wbr>etActiveScalars</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">(</span><span style="font-size:10.0pt;font-family:Consolas;color:#d69d85">"DepthArray"</span><span style="font-size:10.0pt;font-family:Consolas;color:#b4b4b4">);</span><span style="font-size:10.0pt;font-family:Consolas;color:gainsboro"><u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">Regards,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d">Bea<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">Von:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> David Gobbi [mailto:<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>]
<br>
<b>Gesendet:</b> Freitag, 17. Februar 2017 14:57<br>
<b>An:</b> Schober Beatrix [STEMMER IMAGING GmbH] <<a href="mailto:b.schober@stemmer-imaging.de" target="_blank">b.schober@stemmer-imaging.de</a>><br>
<b>Cc:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Betreff:</b> Re: [vtkusers] Scaling with VtkTransform and VtkLookupTable<u></u><u></u></span></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Hi Bea,<u></u><u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">There is something missing from your explanation: how are you setting the scalars for your points?  The lookup table maps scalars to colors, and scalars are not changed by vtkTransformFilter.<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal"> - David<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Fri, Feb 17, 2017 at 12:50 AM, Schober Beatrix [STEMMER IMAGING GmbH] <<a href="mailto:b.schober@stemmer-imaging.de" target="_blank">b.schober@stemmer-imaging.de</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Good morning!</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">I am a bit confused about following behaviour. I tried to find an answer / solution, but spent already more than a
 day with that. Maybe the behaviour is correct, I just misunderstand it?</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">I have a point cloud (VtkPolyData), using a VtkTransform Filter to scale the z-values. As I want the points to be displayed
 colored, I use the vtkLookupTable as well as the ScalarBarWidget to display the lookup table.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Before scaling my z-range is 98 – 255, after scaling (2*) the range is 196 – 510.</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">If I do not change the VtkLookupTable’s table range (it is still 98 – 255), the colors are mapped correctly from 196
 to 510. If I change the table range to 196 – 510 and the mapper’s scalar range to 196 – 510, in order to get a correct valued ScalarBarWidget (range 196 – 510), only colors from 196 to 255 are mapped, everything else not. (The picker shows the correctly scaled
 point data.)</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">My questions: Why is the mapping wrong if I update the scalar range / lookup table range? How can I achieve a correctly
 scaled ScalarBarWidget (196 – 510)?</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Thank you very much in advance for your support!</span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif"> </span><u></u><u></u></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:"Arial",sans-serif">Bea</span><u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div>
</div>
</div></div></div>
</div>

</blockquote></div><br></div></div></div>