<DIV id=RTEContent>dear vtkusers,</DIV>  <DIV>I am experiencing problem in volume rendeing using vtkvolumeRayCastMapper and using vtkVolumeRayCastCompositeFunction when&nbsp;I use a Color and opacity funtion to make most of my volume voxels transparent but viewing only some specific scalar range values. I am getting a "VTK RENDERING ERROR" and the execution time is terribly slow for a moderate size voxel (50,50,50).</DIV>  <DIV>&nbsp;</DIV>  <DIV>I know that, I might be doing something wrong as it is very common to see a floating volume&nbsp;using VTK and also&nbsp;in VolView.&nbsp;</DIV>  <DIV>&nbsp;</DIV>  <DIV>Please let me know your views. Any help is highly appreciated. Please find below the sample code.</DIV>  <DIV>&nbsp;</DIV>  <DIV>Many Thanks.</DIV>  <DIV>Prasenjit Roy.</DIV>  <DIV>&nbsp;</DIV>  <DIV>// Image Data 8bit [data8bit is an input]</DIV>  <DIV>&nbsp;&nbsp; vtkImageData *image3Ddata =
 vtkImageData::NEW;<BR>&nbsp;image3Ddata-&gt;SetDimensions(dim[0],dim[1],dim[2]);<BR>&nbsp;image3Ddata-&gt;SetOrigin(org[0],org[1],org[2]);<BR>&nbsp;image3Ddata-&gt;SetSpacing(sp[0],sp[1],sp[2]);<BR>&nbsp;image3Ddata-&gt;SetScalarTypeToUnsignedChar();<BR>&nbsp;image3Ddata-&gt;SetNumberOfScalarComponents(1);<BR>&nbsp;image3Ddata-&gt;AllocateScalars();<BR>&nbsp;unsigned char *ptr8 = (unsigned char *) image3Ddata-&gt;GetScalarPointer();<BR>&nbsp;ubound = (dim[0]*dim[1]*dim[2]);<BR>&nbsp;for (k=0; k&lt;ubound; k++)<BR>&nbsp;{<BR>&nbsp;&nbsp;*ptr8++ = (unsigned char) data8bit[k];<BR>&nbsp;}</DIV>  <DIV>// Set Opacity<BR>&nbsp;&nbsp;&nbsp; vtkPiecewiseFunction *opacityFn = vtkPiecewiseFunction::New();<BR>&nbsp;opacityFn-&gt;RemoveAllPoints(); <BR>&nbsp;opacityFn-&gt;AddPoint(200,0.2);&nbsp;&nbsp; // Scalar value ranges from [0 to 255]-8bit image data<BR>&nbsp;opacityFn-&gt;AddPoint(225,1);<BR>&nbsp;opacityFn-&gt;AddPoint(255,0.2);</DIV>  <DIV>// Set Color<BR>&nbsp;&nbsp;
 vtkColorTransferFunction *colorFn = vtkColorTransferFunction::New();&nbsp;<BR>&nbsp;for(i=0;i&lt;nColors;i++)<BR>&nbsp;{<BR>&nbsp;&nbsp;cgp3d_colorFn-&gt;AddRGBPoint(cValue[i],R[i],G[i],B[i]);<BR>&nbsp;}</DIV>  <DIV>//Vol Property<BR>&nbsp;&nbsp; vtkVolumeProperty *volProp = vtkVolumeProperty::New();&nbsp;<BR>&nbsp;volProp-&gt;ShadeOn();<BR>&nbsp;volProp-&gt;SetInterpolationTypeToLinear();<BR>&nbsp;volProp-&gt;SetScalarOpacity(opacityFn);<BR>&nbsp;volProp-&gt;SetColor(colorFn);</DIV>  <DIV>&nbsp;&nbsp; vtkVolumeRayCastCompositeFunction *raycastFn = vtkVolumeRayCastCompositeFunction::New();<BR>&nbsp;raycastFn-&gt;SetCompositeMethodToClassifyFirst();</DIV>  <DIV>&nbsp;&nbsp; vtkVolumeRayCastMapper *volMapper =
 vtkVolumeRayCastMapper::New();<BR>&nbsp;volMapper-&gt;AutoAdjustSampleDistancesOn();<BR>&nbsp;volMapper-&gt;SetMinimumImageSampleDistance(1);<BR>&nbsp;volMapper-&gt;IntermixIntersectingGeometryOn();<BR>&nbsp;volMapper-&gt;SetVolumeRayCastFunction(cgp3d_raycastFn);<BR>&nbsp;volMapper-&gt;SetInput(image3Ddata);&nbsp; // image3Ddata is vtkImageData</DIV>  <DIV>&nbsp;&nbsp; vtlVolume *volActor = vtkVolume::New();&nbsp;<BR>&nbsp;volActor-&gt;SetMapper(volMapper);<BR>&nbsp;volActor-&gt;SetProperty(volProp);</DIV>  <DIV><BR>&nbsp;&nbsp; ren1-&gt;AddVolume(volActor);<BR>&nbsp;<BR></DIV><BR><BR><DIV>
<DIV>
<P align=left>Prasenjit Roy<BR><STRONG></STRONG></P>
<P align=left><STRONG>Home Address</STRONG>:&nbsp;</P>
<P align=left>1032 E Lindsey St, #H; Norman, OK-73071</P>
<P align=left>Cell: 405-227-7463</P>
<P align=left>Home: 405-366-8216</P>
<P align=left>&nbsp;</P></DIV></DIV>