<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
hi:<BR>
i have a problem while using the volume rendering algorithm.<BR>
i need to learn how i can reconstruct only a single object in the image set<BR>
(for example my set is for segmented liver so i want only the liver to be appear in 3d but what actualy happen is that the whole image is being accumulated and the result is a box containing the first slice on one side and the last on the other even when i set the pixels that i don't need to transparent)<BR>
plz if there is a solution for this i need it clear.<BR>
my code is<BR>
&nbsp;<BR><FONT color=#008080 size=2>
vtkPNGReader</FONT><FONT color=#000000 size=2> pngreader = </FONT><FONT color=#0000ff size=2>new</FONT><FONT color=#000000 size=2> </FONT><FONT color=#008080 size=2>vtkPNGReader</FONT><FONT size=2><FONT color=#000000>();</FONT><BR>
pngreader.SetFilePrefix(standardStr+</FONT><FONT color=#800000 size=2>"\\"</FONT><FONT size=2>);<BR>
pngreader.SetFilePattern(</FONT><FONT color=#800000 size=2>"%s%d.png"</FONT><FONT size=2>);<BR></FONT><FONT size=2>
pngreader.SetFileNameSliceOffset(1);<BR>
pngreader.SetFileNameSliceSpacing(1);<BR>
pngreader.SetDataSpacing(0.35,0.35,1);<BR>
pngreader.SetDataOrigin(0,0,0);<BR></FONT><FONT size=2>
pngreader.SetDataExtent(0,511,0,511,3,7);<BR>
pngreader.Update();<BR></FONT><FONT color=#008080 size=2>
vtkPiecewiseFunction</FONT><FONT color=#000000 size=2> opacitytransfer = </FONT><FONT color=#0000ff size=2>new</FONT><FONT color=#000000 size=2> </FONT><FONT color=#008080 size=2>vtkPiecewiseFunction</FONT><FONT size=2><FONT color=#000000>();</FONT><BR>
<FONT color=#000000></FONT><BR>
<FONT color=#000000></FONT><BR>
<FONT color=#000000></FONT><BR>
opacitytransfer.AddPoint(0,0.0);<BR>
opacitytransfer.AddPoint(150,0.0);<BR>
<BR></FONT><FONT color=#008080 size=2>
vtkColorTransferFunction</FONT><FONT color=#000000 size=2> colorTransferFunction =</FONT><FONT color=#0000ff size=2>new</FONT><FONT color=#000000 size=2> </FONT><FONT color=#008080 size=2>vtkColorTransferFunction</FONT><FONT size=2><FONT color=#000000>();</FONT><BR>
colorTransferFunction.AddRGBPoint(0.0,0.0,0.0,0.0);<BR>
colorTransferFunction.AddRGBPoint(255.0, 1.0, 1.0, 1.0);<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
&nbsp;<BR>
</FONT><FONT color=#008080 size=2>vtkVolumeProperty</FONT><FONT size=2> volumeproperty = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>vtkVolumeProperty</FONT><FONT size=2>();<BR>
volumeproperty.SetScalarOpacity(opacitytransfer);<BR>
volumeproperty.SetColor(colorTransferFunction);<BR>
volumeproperty.ShadeOn();<BR>
</FONT><FONT color=#008080 size=2>vtkFixedPointVolumeRayCastMapper</FONT><FONT size=2> volumemapper = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>vtkFixedPointVolumeRayCastMapper</FONT><FONT size=2>();<BR>
<BR>
<BR>
<BR>
</FONT><FONT color=#008080 size=2>vtkVolumeRayCastCompositeFunction</FONT><FONT size=2> raycastfunction = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>vtkVolumeRayCastCompositeFunction</FONT><FONT size=2>();<BR>
raycastfunction.SetCompositeMethodToClassifyFirst();<BR>
<BR>
volumemapper.SetInput(pngreader.GetOutput());<BR>
<BR>
</FONT><FONT color=#008080 size=2>vtkVolume</FONT><FONT size=2> volume = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>vtkVolume</FONT><FONT size=2>();<BR>
<BR>
volume.SetMapper(volumemapper);<BR>
</FONT><FONT color=#008080 size=2>vtkCamera</FONT><FONT size=2> acamera = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>vtkCamera</FONT><FONT size=2>();<BR>
acamera.SetViewUp(0,0,-1);<BR>
acamera.SetPosition(0,1,0);<BR>
acamera.SetFocalPoint(0,0,0);<BR>
acamera.ComputeViewPlaneNormal();<BR>
&nbsp;<BR>
renwin.AddRenderer(render);<BR>
iren.SetRenderWindow(renwin);<BR>
render.AddActor(volume);<BR>
render.SetActiveCamera(acamera);<BR>
render.ResetCamera();<BR>
acamera.UpdateViewport(render);<BR>
render.SetBackground(1,1,1);<BR>
render.GetRenderWindow().Render();<BR>
</FONT>&nbsp;<BR>
&nbsp;<BR>
thanks alot.<BR>
<BR><BR><BR>
<P align=center><FONT face="Lucida Handwriting, Cursive" color=#800000 size=4><STRONG>اللهم قدرني علي من ظلمني.....لأجعل عفوى عنه</STRONG></FONT></P>
<P align=center><FONT face="Lucida Handwriting, Cursive" color=#800000 size=4><STRONG>شكرا لك علي قدرتي عليه</STRONG></FONT></P><br /><hr />Making the world a better place one message at a time. <a href='http://www.imtalkathon.com/?source=EML_WLH_Talkathon_BetterPlace' target='_new'>Check out the i’m Talkathon.</a></body>
</html>