I ran into a similar goof a while back, reported here : <a href="http://www.vtk.org/Bug/bug.php?op=show&amp;bugid=2546&amp;pos=3">http://www.vtk.org/Bug/bug.php?op=show&amp;bugid=2546&amp;pos=3</a><br><br>That's since been fixed in 
VTK5.0. What version are you using?<br><br><div><span class="gmail_quote">On 2/10/06, <b class="gmail_sendername">Juan José Aja Fernández</b> &lt;<a href="mailto:juan.aja@gmail.com">juan.aja@gmail.com</a>&gt; wrote:</span>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Sorry for the double post, apparently the vtkusers mailing system only admits text only messages.
<br>
<br>
Hi, everyone:<br>


<br>


I need to use Volume Rendering on an unstructured grid made out of
voxels, the problem is that I have a lot of them (the grid minimum size
is 50x50x50 so at least 25000 voxels).<br>


<br>


I'm doing a truly horrible hack to try to color them:&nbsp; generate a
vtkPoint for each voxel in the grid by means of<br>


<br>


vtkDoubleArray *pts = ....<br>


<br>


for (i=0; i &lt; numberOf Voxels;&nbsp; i++)<br>


&nbsp;&nbsp;&nbsp;&nbsp; pts-&gt;InsertNextValue(i);<br>


<br>


Then I assign pts to the vtkCellData of my grid:<br>


<br>


(grid-&gt;GetCellData())-&gt;SetScala
<div>rs(pts);<br>

<br>

And finally I populate the color transfer function.<br>

For example if I want to color my grid like a red-green chess board, I
can do: <br>

<br>

for (i=0; i &lt; numberOfVoxels; i++) {<br>

&nbsp;&nbsp;&nbsp; if(i%2 == 0 &amp;&amp; i != 0)<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; ctrans-&gt;AddRGBPoint(pts-&gt;GetValue(i), 1, 0, 0); <br>

&nbsp;&nbsp;&nbsp; else ctrans-&gt;AddRGBPoint(pts-&gt;GetValue(i), 0, 1, 0); <br>

}<br>

<br>

The final result is very strange, the colors don't alternate the way
they are supposed to (see the attached jpgs in the previous mail., the first one dimensions
are: 5x5x5 and it looks good <a href="http://public.kitware.com/pipermail/vtkusers/attachments/20060210/d991c333/5x5x5.jpg" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://public.kitware.com/pipermail/vtkusers/attachments/20060210/d991c333/5x5x5.jpg
</a><br>
the second one 19x19x19 but the checkered pattern dissapears:
<a href="http://public.kitware.com/pipermail/vtkusers/attachments/20060210/d991c333/19x19x19.jpg" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://public.kitware.com/pipermail/vtkusers/attachments/20060210/d991c333/19x19x19.jpg
</a>).<br>

<br>

Obviously I'm doing things wrong (the fact is that I'm somewhat new to
vtk and I don't have the slightest idea of how to accomplish this), or
is there a (short) limit in the number of points my transfer function
can have?<br>

<br>

If not, how can this be accomplished?<br>

<br>

Thanks a lot,<br><span>

Juan<br>

</span></div>

<br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br><br></blockquote></div><br><br clear="all"><br>-- <br>Randall Hand<br>Visualization Scientist, <br>ERDC-MSRC Vicksburg, MS<br>Homepage: <a href="http://www.yeraze.com">http://www.yeraze.com</a>