<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2769" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff background="">
<DIV><FONT face="Courier New" size=2>Hi!<BR><BR>I'm trying to render a volume 
adding the XYZ axes in the rendering, but when I add the vtkActor of the axes 
the volume disappears: I mean I can see or the volume either the axes. Can 
someone help me? <BR><BR>The code of the pipeline is the following:</FONT></DIV>
<DIV><FONT face="Courier New" size=2><BR>void 
C3D_ReconstructorView::Pipeline(vtkImageData *pData)<BR>{<BR></DIV></FONT>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; 
vtkWin32OpenGLRenderWindow *renWin;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; vtkRenderer 
*ren;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; 
vtkWin32RenderWindowInteractor *iren;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; 
vtkStructuredPointsReader * VTKreader;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; vtkImageIslandRemoval2D 
* islandRemover;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; vtkImageGaussianSmooth 
*gaussian;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; vtkImageThreshold 
*selectTissue;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; vtkPiecewiseFunction 
*opacityTransferFunction;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; vtkColorTransferFunction 
*colorTransferFunction;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; vtkVolumeProperty * 
volumeProperty[1];</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; 
vtkVolumeRayCastCompositeFunction *compositeFunction;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; vtkVolumeRayCastMapper 
*volumeMapper;</FONT></DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; vtkVolume 
*volume;</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>&nbsp;&nbsp;&nbsp; islandRemover = 
vtkImageIslandRemoval2D::New();<BR>&nbsp;&nbsp;&nbsp; 
islandRemover-&gt;SetAreaThreshold(4);<BR>&nbsp;&nbsp;&nbsp; 
islandRemover-&gt;SetIslandValue(-1);<BR>&nbsp;&nbsp;&nbsp; 
islandRemover-&gt;SetReplaceValue(1.0);<BR>&nbsp;&nbsp;&nbsp; 
islandRemover-&gt;SetInput(pData);<BR>&nbsp;&nbsp;&nbsp; gaussian = 
vtkImageGaussianSmooth::New();<BR>&nbsp;&nbsp;&nbsp; 
gaussian-&gt;SetStandardDeviations(1.0, 1.0, 1.0);<BR>&nbsp;&nbsp;&nbsp; 
gaussian-&gt;SetRadiusFactors(1.0, 1.0, 1.0);<BR>&nbsp;&nbsp;&nbsp; 
gaussian-&gt;SetInput(islandRemover-&gt;GetOutput());<BR>&nbsp;&nbsp;&nbsp; 
selectTissue = vtkImageThreshold::New();<BR>&nbsp;&nbsp;&nbsp; 
selectTissue-&gt;ThresholdBetween(m_stVievParms.dblNoise, 
255.0);<BR>&nbsp;&nbsp;&nbsp; 
selectTissue-&gt;ReplaceInOff();<BR>&nbsp;&nbsp;&nbsp; 
selectTissue-&gt;SetOutValue(0.0);<BR>&nbsp;&nbsp;&nbsp; 
selectTissue-&gt;SetInput(gaussian-&gt;GetOutput());</FONT></DIV><FONT 
face="Courier New" size=2>
<DIV><BR>// Create transfer mapping scalar value to 
opacity<BR>&nbsp;&nbsp;&nbsp; opacityTransferFunction = 
vtkPiecewiseFunction::New();<BR>&nbsp;&nbsp;&nbsp; 
opacityTransferFunction-&gt;AddPoint(0, 0.0);<BR>&nbsp;&nbsp;&nbsp; 
opacityTransferFunction-&gt;AddPoint(static_cast&lt;int&gt;(m_stVievParms.dblNoise), 
0.259);<BR>&nbsp;&nbsp;&nbsp; opacityTransferFunction-&gt;AddPoint(255, 
1.0);</DIV>
<DIV><BR>// Create transfer mapping scalar value to color<BR>&nbsp;&nbsp;&nbsp; 
colorTransferFunction = vtkColorTransferFunction::New();<BR>&nbsp;&nbsp;&nbsp; 
colorTransferFunction-&gt;AddRGBPoint(0.0, 0.0, 0.0, 0.0);<BR>&nbsp;&nbsp;&nbsp; 
colorTransferFunction-&gt;AddRGBPoint(m_stVievParms.dblNoise, 0.259, 0.259, 
0.259);<BR>&nbsp;&nbsp;&nbsp; colorTransferFunction-&gt;AddRGBPoint(255.0, 1.0, 
1.0, 1.0);</DIV>
<DIV><BR>// The property describes how the data will look<BR>&nbsp;&nbsp;&nbsp; 
volumeProperty[0] = vtkVolumeProperty::New();<BR>&nbsp;&nbsp;&nbsp; 
volumeProperty[0]-&gt;SetColor(colorTransferFunction);<BR>&nbsp;&nbsp;&nbsp; 
volumeProperty[0]-&gt;SetScalarOpacity(opacityTransferFunction);<BR>&nbsp;&nbsp;&nbsp; 
volumeProperty[0]-&gt;SetInterpolationTypeToLinear();<BR>//<BR>// The mapper / 
ray cast function know how to render the data<BR>&nbsp;&nbsp;&nbsp; 
compositeFunction = 
vtkVolumeRayCastCompositeFunction::New();<BR>&nbsp;&nbsp;&nbsp; volumeMapper = 
vtkVolumeRayCastMapper::New();<BR>&nbsp;&nbsp;&nbsp; 
volumeMapper-&gt;SetSampleDistance(0.2);<BR>&nbsp;&nbsp;&nbsp; 
volumeMapper-&gt;SetVolumeRayCastFunction(compositeFunction);<BR>&nbsp;&nbsp;&nbsp; 
volumeMapper-&gt;SetInput(selectTissue-&gt;GetOutput());</DIV>
<DIV><BR>// axes to follow camera<BR>&nbsp;&nbsp;&nbsp; float 
bounds[6];<BR>&nbsp;&nbsp;&nbsp; 
volumeMapper-&gt;GetBounds(bounds);<BR>&nbsp;&nbsp;&nbsp; vtkAxes* axes = 
vtkAxes::New(); //source.<BR>&nbsp;&nbsp;&nbsp; vtkPolyDataMapper* axesMapper = 
vtkPolyDataMapper::New();<BR>&nbsp;&nbsp;&nbsp; vtkActor* axesActor = 
vtkActor::New();<BR>&nbsp;&nbsp;&nbsp; axes-&gt;SetOrigin( 
bounds[0],bounds[2],bounds[4]);<BR>&nbsp;&nbsp;&nbsp; 
axes-&gt;SetScaleFactor(bounds[1] - bounds[0]);<BR>&nbsp;&nbsp;&nbsp; 
axesMapper-&gt;SetInput( axes-&gt;GetOutput());<BR>&nbsp;&nbsp;&nbsp; 
axesActor-&gt;SetMapper(axesMapper);<BR>&nbsp;&nbsp;&nbsp; 
axesActor-&gt;PickableOff();<BR>&nbsp;&nbsp;&nbsp; 
axesActor-&gt;GetProperty()-&gt;SetColor( 255, 255, 255);<BR>&nbsp;&nbsp;&nbsp; 
axesActor-&gt;GetProperty()-&gt;SetLineWidth( 5.);<BR>&nbsp;&nbsp;&nbsp; 
axesActor-&gt;GetProperty()-&gt;SetOpacity(10);<BR><BR>// The volume holds the 
mapper and the property and<BR>// can be used to position/orient the 
volume<BR>&nbsp;&nbsp;&nbsp; 
volume-&gt;SetMapper(volumeMapper);<BR>&nbsp;&nbsp;&nbsp; 
volume-&gt;SetProperty(volumeProperty[0]);<BR>&nbsp;&nbsp;&nbsp; 
volume-&gt;Update();<BR>//&nbsp; ren-&gt;AddActor( axesActor); //this is 
the&nbsp;line that makes disappear the volume<BR>&nbsp;&nbsp;&nbsp; 
ren-&gt;AddVolume(volume);</FONT></DIV>
<DIV><FONT face="Courier New" size=2><BR>&nbsp;&nbsp;&nbsp; 
axes-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
axesMapper-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
axesActor-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
islandRemover-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
gaussian-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
selectTissue-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
opacityTransferFunction-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
colorTransferFunction-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
compositeFunction-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
volumeProperty[0]-&gt;Delete();<BR>&nbsp;&nbsp;&nbsp; 
volumeMapper-&gt;Delete();<BR>}</FONT></DIV>
<DIV><FONT face="Courier New" size=2></FONT>&nbsp;</DIV>
<DIV><FONT face="Courier New" size=2>Thank you in advance.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Sandro Rosi<BR>R&amp;D Software Project 
Manager<BR>Optikon 2000 S.p.A.<BR>Via del Casale di Settebagni, 13<BR>00138 Roma 
(Italy)<BR>Tel +39068887978</FONT></DIV></BODY></HTML>