<!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 VTK.<BR>(I've mailed sometimes ago 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> vtkRenderer *ren1 =
vtkRenderer::New();<BR> vtkRenderWindow *renWin =
vtkRenderWindow::New();<BR>
renWin->AddRenderer(ren1);<BR><BR> vtkRenderWindowInteractor *iren =
vtkRenderWindowInteractor::New();<BR>
iren->SetRenderWindow(renWin);<BR><BR> unsigned char* data=new unsigned
char[1000000];<BR> int i;<BR><BR>//Just making user defined data - sphere
shape<BR> for(int x=0;x<100;x++){<BR> for(int
y=0;y<100;y++){<BR> for(int
z=0;z<100;z++){<BR> i =
x*10000+y*100+z;<BR>
if(x^2+y^2+z^2<10000)<BR>
data[i]=200;<BR> }<BR>
}<BR> }<BR><BR> vtkImageImport
*img=vtkImageImport::New();<BR> img->SetImportVoidPointer
(data);<BR> img->SetDataScalarTypeToUnsignedChar
();<BR> img->SetWholeExtent (0, 100, 0, 100, 0,
100);<BR> img->SetDataExtentToWholeExtent();<BR><BR>//<BR>//<BR>//Is
there any other setting is
needed?<BR>//<BR>//<BR> <BR> vtkPiecewiseFunction *oTFun =
vtkPiecewiseFunction::New();<BR>
oTFun->AddSegment(80,0.0,255,1.0);<BR> vtkPiecewiseFunction *gTFun =
vtkPiecewiseFunction::New();<BR>
gTFun->AddSegment(0,1.0,255,1.0);<BR><BR> vtkVolumeProperty *volProperty
= vtkVolumeProperty::New();<BR> volProperty->SetColor(gTFun);<BR>
volProperty->SetGradientOpacity(oTFun);<BR>
volProperty->SetInterpolationTypeToLinear();<BR>
volProperty->ShadeOn();<BR><BR> vtkVolumeRayCastCompositeFunction
*compositeFunction = <BR>
vtkVolumeRayCastCompositeFunction::New();<BR><BR> vtkVolumeRayCastMapper
*volMapper = <BR> vtkVolumeRayCastMapper::New();
<BR><BR> volMapper->SetVolumeRayCastFunction(compositeFunction);<BR> volMapper->SetInput
(img->GetOutput());<BR> vtkVolume *vol =
vtkVolume::New();<BR><BR> vol->SetMapper(volMapper);<BR> vol->SetProperty(volProperty);<BR><BR> ren1->AddVolume(vol);<BR> renWin->Render();<BR> ren1->GetActiveCamera()->Azimuth(20);<BR> renWin->Render();<BR> ren1->GetActiveCamera()->Dolly(1.65);<BR> renWin->Render();<BR> iren->SetDesiredUpdateRate(3.0);<BR> renWin->Render();<BR> iren->Start();</FONT></BODY></HTML>