<div dir="ltr">Hi David,<br><br>Thank you for your answer.<br>Regarding my previous questions, I tried some new manipulations and came with results:<br><br>*First, regarding the writing of vtkPolyData with its scalars:<br>
I tried to use this filter with the following code:<br><br> vtkSmartPointer<vtkXMLPolyDataWriter> writerXML = <br> vtkSmartPointer<vtkXMLPolyDataWriter>::New();<br> <br> writerXML->SetFileName("Colored_Surface.vtp");<br>
<br> writerXML->SetInput(surfacePolyData);<br> <br> writerXML->Write();<br><br> But It's only writing the polyData without its scalars/colors.<br> What have I missed?<br><br>*Second, regarding the look up table: I simply used the following code and got the right results, but I'm still searching for a way to get a variety from the same color in each range (for example, in the i'th table which I set to red, I'd like to get lighter/darker color due to its value in the range).<br>
<br> vtkSmartPointer<vtkLookupTable> lut = vtkSmartPointer<vtkLookupTable>::New();<br><br> lut->SetNumberOfTableValues(3); // I need only three colors<br> <br> lut->Build();<br> <br> lut->SetTableValue(0,0,1,0); <br>
<br> lut->SetTableValue(1,1,1,0); <br> <br> lut->SetTableValue(2,1,0,0); <br> <br> myVtkFloatArray->SetLookupTable(lut);<br><br><br>Any help would be very appreciated!<br>Regards,<br>Miri<br><br><br><div class="gmail_quote">
On Sun, Jan 8, 2012 at 9:44 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="im">On Sun, Jan 8, 2012 at 2:15 PM, Miri Trope <<a href="mailto:miritrope@gmail.com">miritrope@gmail.com</a>> wrote:<br>
> Hi Again,<br>
><br>
> In addition,<br>
> I'd like to ask about vtkPolyDataWriter:<br>
> I set scalars on vtkPolyData and would like to save both the vtkPolyData<br>
> with his scalars (it means that I'd like to save the colored surface).<br>
><br>
> How should I do this?<br>
<br>
</div>You should probably be using vtkXMLPolyDataWriter to write a .vtp<br>
file. Use Paraview (<a href="http://paraview.org" target="_blank">paraview.org</a>) to inspect the result - the<br>
PointData, CellData, and FieldData<br>
(<a href="http://www.vtk.org/Wiki/VTK/Tutorials/DataStorage" target="_blank">http://www.vtk.org/Wiki/VTK/Tutorials/DataStorage</a>) should<br>
automatically be saved to the file.<br>
<font color="#888888"><br>
David<br>
</font></blockquote></div><br><div style="display:inline" id="avg_ls_inline_popup"></div><style type="text/css">#avg_ls_inline_popup { position:absolute; z-index:9999; padding: 0px 0px; margin-left: 0px; margin-top: 0px; width: 240px; overflow: hidden; word-wrap: break-word; color: black; font-size: 10px; text-align: left; line-height: 13px;}</style></div>