<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)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--@font-face
        {体}
/* Font Definitions */
@font-face
        {font-family:SimSun;
        panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:SimSun;
        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;
        font-family:Arial;
        color:windowtext;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@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 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi all, <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>It’s me again. Maybe my previous question
was not clearly explained. I will try to explain it with a more specific way. Sorry
to bother again.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>As I mentioned before, I was generating
the projection images of a synthetic data by rotating the camera (vtkCamere
type) around the volume. The camera’s position is determined by a
transformation matrix (vtkMatrix4x4 type), computed by 2 rotational angles. The
program worked fine, except for some angles, the projection image looked like: 1)
shifted in some pixel positions; 2) some part of the phantom is truncated; 3) some
extra structure in the projected image. I was trying to tune some parameters,
such as using trilinear interpolation, ray sample size to be 0.1 unit of the
volume spacing (0.05*0.1=0.005), etc. The problem could not be solved by these
trials. I also tried to modify a little bit of the 2 rotational angles, for
example, replace the original angle A (A is in degree unit) by A+0.02, this
results a slight change in camera position. But with this 0.02 degree changes,
the projection data looked correctly projected.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Does anyone have idea of what happened
there? <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks in advance,<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Chong</span></font><o:p></o:p></p>
</div>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> Chong Zhang
[mailto:chong.zhang@upf.edu] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, December 15, 2006
17:27 PM<br>
<b><span style='font-weight:bold'>To:</span></b> 'vtkusers@vtk.org'<br>
<b><span style='font-weight:bold'>Subject:</span></b> Ray casting process
problems?</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<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> </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> </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> </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->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->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->volProperty->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->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->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> </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->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->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> </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->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->SetProperty(
volProperty
); <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> </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->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->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->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->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->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->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"'>
writer->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"'>
writer->SetInput( renLarge->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"'>
writer->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->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> </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 “stepSize” 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’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> </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
“depth” (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'> <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> </o:p></span></font></p>
<p class=MsoNormal><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'>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>