<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=ks_c_5601-1987">
<META content="MSHTML 6.00.2716.2200" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff background=""><FONT size=2>Hi, I'm mailing again. I'm 
beginner of&nbsp; VTK.<BR>(I've mailed sometimes ago&nbsp;but all of them has 
font problems....<BR>I can't understand why it ocurred. anyway....)<BR>So I 
don't know how to do the volume rendering of the data in file or array in C 
language.<BR>I think that your source contains them. (I saw it in user's 
digest.)<BR>Could you give me the full volume rendering source code in Cpp with 
<BR>my data like those follows?<BR>(The source code of me is not working 
properly)<BR>Please complete the souce code as that can 
run.<BR><BR>&nbsp;vtkRenderer *ren1 = 
vtkRenderer::New();<BR>&nbsp;vtkRenderWindow *renWin = 
vtkRenderWindow::New();<BR>&nbsp; 
renWin-&gt;AddRenderer(ren1);<BR><BR>&nbsp;vtkRenderWindowInteractor *iren = 
vtkRenderWindowInteractor::New();<BR>&nbsp; 
iren-&gt;SetRenderWindow(renWin);<BR><BR>&nbsp;unsigned char* data=new unsigned 
char[1000000];<BR>&nbsp;int i;<BR><BR>//Just making user defined data - sphere 
shape<BR>&nbsp;for(int x=0;x&lt;100;x++){<BR>&nbsp; for(int 
y=0;y&lt;100;y++){<BR>&nbsp;&nbsp; for(int 
z=0;z&lt;100;z++){<BR>&nbsp;&nbsp;&nbsp; i = 
x*10000+y*100+z;<BR>&nbsp;&nbsp;&nbsp; 
if(x^2+y^2+z^2&lt;10000)<BR>&nbsp;&nbsp;&nbsp;&nbsp; 
data[i]=200;<BR>&nbsp;&nbsp; }<BR>&nbsp; 
}<BR>&nbsp;}<BR><BR>&nbsp;vtkImageImport 
*img=vtkImageImport::New();<BR>&nbsp;img-&gt;SetImportVoidPointer 
(data);<BR>&nbsp;img-&gt;SetDataScalarTypeToUnsignedChar 
();<BR>&nbsp;img-&gt;SetWholeExtent (0, 100, 0, 100, 0, 
100);<BR>&nbsp;img-&gt;SetDataExtentToWholeExtent();<BR><BR>//<BR>//<BR>//Is 
there any other setting is 
needed?<BR>//<BR>//<BR>&nbsp;<BR>&nbsp;vtkPiecewiseFunction *oTFun = 
vtkPiecewiseFunction::New();<BR>&nbsp; 
oTFun-&gt;AddSegment(80,0.0,255,1.0);<BR>&nbsp;vtkPiecewiseFunction *gTFun = 
vtkPiecewiseFunction::New();<BR>&nbsp; 
gTFun-&gt;AddSegment(0,1.0,255,1.0);<BR><BR>&nbsp;vtkVolumeProperty *volProperty 
= vtkVolumeProperty::New();<BR>&nbsp; volProperty-&gt;SetColor(gTFun);<BR>&nbsp; 
volProperty-&gt;SetGradientOpacity(oTFun);<BR>&nbsp; 
volProperty-&gt;SetInterpolationTypeToLinear();<BR>&nbsp; 
volProperty-&gt;ShadeOn();<BR><BR>&nbsp;vtkVolumeRayCastCompositeFunction 
*compositeFunction = <BR>&nbsp; 
vtkVolumeRayCastCompositeFunction::New();<BR><BR>&nbsp;vtkVolumeRayCastMapper 
*volMapper = <BR>&nbsp; vtkVolumeRayCastMapper::New(); 
<BR><BR>&nbsp;volMapper-&gt;SetVolumeRayCastFunction(compositeFunction);<BR>&nbsp;volMapper-&gt;SetInput 
(img-&gt;GetOutput());<BR>&nbsp;vtkVolume *vol = 
vtkVolume::New();<BR><BR>&nbsp;vol-&gt;SetMapper(volMapper);<BR>&nbsp;vol-&gt;SetProperty(volProperty);<BR><BR>&nbsp;ren1-&gt;AddVolume(vol);<BR>&nbsp;renWin-&gt;Render();<BR>&nbsp;ren1-&gt;GetActiveCamera()-&gt;Azimuth(20);<BR>&nbsp;renWin-&gt;Render();<BR>&nbsp;ren1-&gt;GetActiveCamera()-&gt;Dolly(1.65);<BR>&nbsp;renWin-&gt;Render();<BR>&nbsp;iren-&gt;SetDesiredUpdateRate(3.0);<BR>&nbsp;renWin-&gt;Render();<BR>&nbsp;iren-&gt;Start();</FONT></BODY></HTML>