<div dir="ltr">Use vtkImageData->SetScalarComponentFrom...<br><br><br>Jothy<br><br><div class="gmail_quote">On Thu, Sep 9, 2010 at 4:14 PM, salmon monviola <span dir="ltr"><<a href="mailto:Jordy.Salmon@rennes.inra.fr">Jordy.Salmon@rennes.inra.fr</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 bgcolor="#ffffff" text="#000000">
Hi,<br>
<br>
I'm newbie in VTK, so it's perhaps a basic question : <br>
<br>
How add data to a cell to store them in a vtkImageData (and write it in
a vti file) <br>
<br>
// Create an image data<br>
vtkSmartPointer<vtkImageData> imageData = <br>
vtkSmartPointer<vtkImageData>::New();<br>
<br>
// Specify the size of the image data<br>
imageData->SetDimensions(2,3,1);<br>
<br>
int* dims = imageData->GetDimensions();<br>
<br>
for (int z = 0; z < dims[2]; z++)<br>
{<br>
for (int y = 0; y < dims[1]; y++)<br>
{<br>
for (int x = 0; x < dims[0]; x++)<br>
{<br>
// ???? <u>HOW TO ADD HERE DATA like a 2 D ARRAY TO THE CELL
(or point) of x,y,z coordinates ????</u><br>
}<br>
}<br>
}<br>
<br>
vtkSmartPointer<vtkXMLImageDataWriter> writer =<br>
vtkSmartPointer<vtkXMLImageDataWriter>::New();<br>
writer->SetFileName(outputFilename.c_str());<br>
writer->SetInput(imageData);<br>
writer->Write();<br>
<br>
<br>
Thank you,<br>
<br>
Jordy<br>
</div>
<br>_______________________________________________<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>
<br></blockquote></div><br></div>