<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi there,</div>
<div>
<div class="post-text" itemprop="text">
<p>i want to convert several vtkpolydata objects into one imagedata object, because i want to read along every voxel (x,y,z). I using vtkAppendPolyData to append several polydataobjets like spheres. This output is used in this algorithm: <a href="http://www.paraview.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToImageData" rel="nofollow">http://www.paraview.org/Wiki/VTK/Examples/Cxx/PolyData/PolyDataToImageData</a></p>
<p>My next step is:</p>
<p>int* dims = imgstenc->GetOutput()->GetDimensions();</p>
<pre><code>for (int x=0; x<dims[0]; x++)
{
for (int y=0; y<dims[1]; y++)
{
int teiler = 0;
for (int z=0; z<dims[2]; z++)
{
double voxel = imgstenc->GetOutput()->GetScalarComponentAsDouble(x,y,z,0); //Pixelwerte
if (voxel > 0)
{
teiler++;
}
}
outputFile << teiler <<",";
}
outputFile << endl;
}
</code></pre>
<p>So i want to count every voxel that has the objectvalue of 255.</p>
<p>It works great, but if a polydata objects intersects another, at the intersection a voxelvalue of 0 is count, not 255 and i dont know why. Maybe there is a problem with the vtkAppendPolyData filter ?</p>
<p><a href="http://www.pic-upload.de/view-23915628/berechneteWerte2.jpg.html" rel="nofollow">http://www.pic-upload.de/view-23915628/berechneteWerte2.jpg.html</a></p>
<p>Best regards Chris</p>
</div>
</div></div></body></html>