Hi Weiguang,<br><br>I am estimating the vtkVolumeTextureMapper3D these days. I found some problems (maybe) about this class. This problem does answer your question why the rendering is different from two different mappers. 
<br><br>I am using vtk nightly source on Oct.16 2007. Here I present some cues on the problem:<br><br>First please read function &quot;UpdateColorLookup&quot; in class vtkVolumeTextureMapper3D. We may assume our data type is unsigned char. We also assume we use rgba color TF. So the the size of color TF write into the ColorLookup is arraySizeNeeded as shown in the program. Line 1334 and line 1339 gives us that the pipeline how to get the TF table from the TF user interface with the scalar range of ( scalarRange[0], scalarRange[1]).
<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rgbFunc-&gt;GetTable( scalarRange[0], scalarRange[1], <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arraySizeNeeded, this-&gt;TempArray1 );<br><br>&nbsp; scalarOpacityFunc-&gt;GetTable( scalarRange[0], scalarRange[1], <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; arraySizeNeeded, this-&gt;TempArray2 );
<br><br>Second&nbsp; please read Lines between 1368 to 1401 (we use one component data), you can find that the program transfered TF table obtained before to the ColorLookup. The problems appear here: <br><br>The TF table obtained in Line 1334 and 1339 is used for the  scalar range of ( scalarRange[0], scalarRange[1]). But between lines 1368 to 1401 transferring step, the TF table is set to the range of (0, arraySizeNeeded). Please be aware that:
<br>&nbsp;( arraySizeNeeded = (int)(scalarRange[1] - scalarRange[0] + 1);)<br><br>So the transfer function got from the TF user interface is applied to the wrong scalar range, that&#39;s why the rendering images created from two mappers are different. 
<br><br>I hope to get your feedback about this. I also hope that VTK can correct this bug. Because the new graphics card supports non-power 2 texture size, the vtkVolumeTextureMapper3D should also be updated for this change.
<br><br>Good luck!<br><br>James<br><br><br><br><br><br><br><div><span class="gmail_quote">2007/10/27, Weiguang Guan &lt;<a href="mailto:guanw@rhpcs.mcmaster.ca">guanw@rhpcs.mcmaster.ca</a>&gt;:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all,<br><br>I recently notice an issue (maybe a bug) with volume rendering algorithms<br>(vtkVolumeTextureMapper3D and vtkVolumeRayCastMapper), and cannot find a<br>posting reporting the issue in the mailing list.<br><br>
I have a a scalar volume of vtkImagedata whose value ranges from 0 to<br>7035. By thresholding it at 255, I generate another volume with value<br>range [0-255]. Then, I do volume renderings (both vtkVolumeTextureMapper3D<br>
and vtkVolumeRayCastMapper) of them seperately with the same opacity<br>transfer function:<br><br>vtkPiecewiseFunction opacityTransferFunction<br>&nbsp;&nbsp;&nbsp;&nbsp; opacityTransferFunction AddPoint&nbsp;&nbsp;50&nbsp;&nbsp; 0.0<br>&nbsp;&nbsp;&nbsp;&nbsp; opacityTransferFunction AddPoint&nbsp;&nbsp;255&nbsp;&nbsp;
0.2<br>&nbsp;&nbsp;&nbsp;&nbsp; opacityTransferFunction ClampingOff<br><br>Should I expect to have exactly the same renderings? Rendering with<br>vtkVolumeTextureMapper3D produces a great difference while rendering with<br>vtkVolumeRayCastMapper produces a slightly difference but still
<br>noticeable. Can anybody explain why?<br><br>I have a tcl script to reproduce the &quot;bug&quot;, and can let you have it if<br>you&#39;re interested.<br><br>Weiguang<br><br>_______________________________________________
<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br></blockquote></div><br>