<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:&#23435;&#20307;;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:"\@&#23435;&#20307;";
        panose-1:2 1 6 0 3 1 1 1 1 1;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Dear all,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>I am using </span></font><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>vtkVolumeRayCastCompositeFunction
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>to perform volume rendering. But I keep getting strange rendering
results (I attached some of the snapshot images in this email). <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>My volume data is a phantom with spacing 0.05*0.05*0.05
(mm). With this data, I was generating a series of snapshot images of the
rendered volume from different viewing positions, by moving the camera (of
vtkCamera type) around the volume data. The code related with the rendering is
the following:<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:9.0pt;
font-family:"Courier New"'>volProperty </span></font><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>is an instance of </span></font><font
size=1 face="Courier New"><span style='font-size:9.0pt;font-family:"Courier New"'>vtkVolumeProperty</span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>, </span></font><font
size=1 face="Courier New"><span style='font-size:9.0pt;font-family:"Courier New"'>ctFunc
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>and </span></font><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>otFunc </span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>are the
transfer functions from the volume intensity value to the its opacity and
color. Either Nearest or Trilinear interpolation methods were used, stepSize
are related to the volume spacing (I used 1 spacing, means 0.05, and 0.1
spacing, means 0.005).<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>volProperty-&gt;SetColor(
ctFunc );<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>volProperty-&gt;SetScalarOpacity(
otFunc );<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 color=green
face="Courier New"><span style='font-size:9.0pt;font-family:"Courier New";
color:green'>//this-&gt;volProperty-&gt;SetInterpolationTypeToLinear();<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>volProperty-&gt;SetInterpolationTypeToNearest();<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>volProperty-&gt;SetScalarOpacityUnitDistance(
stepSize );<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:9.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:9.0pt;
font-family:"Courier New"'>mapper </span></font><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>is an instance of </span></font><font
size=1 face="Courier New"><span style='font-size:9.0pt;font-family:"Courier New"'>vtkVolumeRayCastMapper</span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'>, sample
distance is depending on the volume spacing as well. <o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>vtkVolumeRayCastCompositeFunction*
raycastFunction = vtkVolumeRayCastCompositeFunction::New();<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>mapper-&gt;SetVolumeRayCastFunction(
raycastFunction );<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>mapper-&gt;SetSampleDistance(
stepSize );<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:9.0pt;
font-family:"Courier New"'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:9.0pt;
font-family:"Courier New"'>volume</span></font><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'> is the phantom data.<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>volume-&gt;SetMapper( mapper
);<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>volume-&gt;SetProperty(
volProperty
);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>The following is the usual vtk rendering pipeline stuff and
the snapshots.<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>ren-&gt;AddVolume( volume );<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>renWin-&gt;SetSize( 512, 512
);<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
lang=DE style='font-size:9.0pt;font-family:"Courier New"'>renWin-&gt;AddRenderer(
ren );</span></font><font size=2 face=Arial><span lang=DE style='font-size:
10.0pt;font-family:Arial'><o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
lang=DE style='font-size:9.0pt;font-family:"Courier New"'>vtkRenderLargeImage
*renLarge = vtkRenderLargeImage::New();<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>renLarge-&gt;SetInput( ren );<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>renLarge-&gt;SetMagnification(
4.0 );<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>renLarge-&gt;Update();<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>vtkPNGWriter *writer =
vtkPNGWriter::New();<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
writer-&gt;SetFileName( imgName );<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
writer-&gt;SetInput( renLarge-&gt;GetOutput() );<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:9.0pt;
font-family:"Courier New"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
writer-&gt;Write();<o:p></o:p></span></font></p>

<p class=MsoNormal style='text-indent:.5in'><font size=1 face="Courier New"><span
style='font-size:9.0pt;font-family:"Courier New"'>writer-&gt;Delete();</span></font><font
size=2 face=Arial><span style='font-size:10.0pt;font-family:Arial'><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Most of the snapshot images looks okay, at least visually.
But for some specific viewing position snapshots, the image are distorted, the
distortion effect has different formations, as can be seen from the attached
example images. Why I say it is some specific viewing positions, because the
distorted images were always generated from those viewing positions, no matter
the &#8220;stepSize&#8221; value. Images number, for example, 018, 024, 032, 034, 035, 068,
etc, are the ones that have distorted effects. My phantom is a fused
combination of one bended cylinder, one thinner cylinder, one sphere, and
another smaller sphere. I don&#8217;t understand why this happens? <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Even more weird, sometimes the program just crashed
somewhere, but when I tune a very little bit of the camera position, it worked
fine. This happened, in particular, when I set the interpolation method to be
trilinear, and using stepSize to be 0.005(0.1 spacing of the volume). I tried
to debug the code, the crashed point was at the trilinear interpolation
calculation. It looked as if the stepSize was too small, then the ray &#8220;depth&#8221;
(sample units) values are too big, and therefore the machine can not reach it.<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>&nbsp;&nbsp;<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Does some of you have any idea about all these? Any
suggestion and discussion are appreciated! <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Best,<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 face=Arial><span style='font-size:10.0pt;
font-family:Arial'>Chong<o:p></o:p></span></font></p>

</div>

</body>

</html>