I saw that increments is (0, 0, 0). It should be something like (1, 11, 121), no? Maybe you missed to call SetNumberOfScalarComponents( ... ) ?<br><br>That&#39;s an (humble) idea...<br>Jerome<br><br><div class="gmail_quote">
2009/12/9 David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria%2Bvtk@gmail.com">daviddoria+vtk@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I create an ImageData:<br>
<br>
vtkSmartPointer&lt;vtkImageData&gt; grid = vtkSmartPointer&lt;vtkImageData&gt;::New();<br>
grid-&gt;SetOrigin(xmin, ymin, zmin);<br>
grid-&gt;SetExtent(0, this-&gt;NumberOfCellsX-1, 0, this-&gt;NumberOfCellsY-1,<br>
0, this-&gt;NumberOfCellsZ-1); //same as grid-&gt;SetDimensions(10, 10, 10);<br>
grid-&gt;SetSpacing((xmax-xmin)/static_cast&lt;double&gt;(this-&gt;NumberOfCellsX),<br>
(ymax-ymin)/static_cast&lt;double&gt;(this-&gt;NumberOfCellsY),<br>
(zmax-zmin)/static_cast&lt;double&gt;(this-&gt;NumberOfCellsZ));<br>
<br>
Then I set a value at each point:<br>
<br>
 for (int z = 0; z &lt; dims[2]; z++)<br>
    {<br>
    for (int y = 0; y &lt; dims[1]; y++)<br>
      {<br>
      for (int x = 0; x &lt; dims[0]; x++)<br>
        {<br>
       //compute d ....<br>
        grid-&gt;SetScalarComponentFromDouble(x,y,z,0,d);<br>
        }<br>
      }<br>
    }<br>
<br>
Then I want to extract the 0 isosurface of this scalar field.<br>
<br>
I tried to do:<br>
<br>
vtkSmartPointer&lt;vtkContourFilter&gt; contourFilter =<br>
        vtkSmartPointer&lt;vtkContourFilter&gt;::New();<br>
<br>
contourFilter-&gt;SetInput(grid);<br>
<br>
vtkPolyData* surface = contourFilter-&gt;GetOutput();<br>
<br>
but the result has 0 points and 0 cells. Have I done something wrong<br>
with constructing the ImageData? Or using the ContourFilter?<br>
<br>
Thanks,<br>
<br>
David<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>
</blockquote></div><br>