<DIV>hi vtkusers,</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;I am reading 2D slices and constructing a 3D volume, using the following code....</DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=2>
<P>vtkVolume16Reader *v16Img = vtkVolume16Reader::New();</P>
<P>v16Img-&gt;SetDataDimensions (sizex,sizey);</P>
<P>v16Img-&gt;SetImageRange (atoi(argv[3]),atoi(argv[4])); </P></FONT><FONT size=2>
<P>v16Img-&gt;SetHeaderSize(HeadS);</P>
<P>v16Img-&gt;SetFilePrefix (argv[2]); </P>
<P>v16Img-&gt;SetDataSpacing (0.1, 0.1, 0.5);</P>
<P>v16Img-&gt;SetDataOrigin(0, 0, 0);</P>
<P>cout&lt;&lt;"Image Volume Read...."&lt;&lt;endl;</P></FONT><FONT color=#008000 size=2>
<P>&nbsp;</P></FONT><FONT size=2>
<P></P>
<P></FONT><FONT color=#008000 size=2>//CompositeFunction with option</P></FONT><FONT size=2>
<P>vtkVolumeRayCastCompositeFunction *compositeFunction = vtkVolumeRayCastCompositeFunction::New();</P>
<P>compositeFunction-&gt;SetCompositeMethodToInterpolateFirst(); </P>
<P></FONT><FONT color=#008000 size=2></FONT>&nbsp;</P>
<P><FONT color=#008000 size=2>//Mapper with selected RayCastFunction</P></FONT><FONT size=2>
<P>vtkVolumeRayCastMapper *volumeMapper = vtkVolumeRayCastMapper::New();</P>
<P>volumeMapper-&gt;SetInput(v16Img -&gt; GetOutput());</P>
<P>volumeMapper-&gt;SetVolumeRayCastFunction(compositeFunction);</P></FONT><FONT color=#008000 size=2>
<P>&nbsp;</P>
<P>// Create transfer mapping scalar value to opacity</P></FONT><FONT size=2>
<P>vtkPiecewiseFunction *pieceFunc = vtkPiecewiseFunction::New();</P>
<P>pieceFunc-&gt;AddPoint(0, 0.0); </FONT><FONT color=#008000 size=2>// alpha value for the lower intensity limit</P></FONT><FONT size=2>
<P>pieceFunc-&gt;AddPoint(15000, 0.5); </FONT><FONT color=#008000 size=2>// alpha value for the upper intensity limit</P></FONT><FONT color=#008000 size=2>
<P>&nbsp;</P>
<P>//Set Volume Property</P></FONT><FONT size=2>
<P>vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();</P>
<P>volumeProperty-&gt;SetInterpolationTypeToLinear();</P></FONT><FONT size=2>
<P>volumeProperty-&gt;SetScalarOpacity(pieceFunc);</P>
<P>volumeProperty-&gt;ShadeOn();</P></FONT><FONT color=#008000 size=2>
<P>&nbsp;</P>
<P>//The special actor with properties</P></FONT><FONT size=2>
<P>vtkVolume *vol = vtkVolume::New();</P>
<P>vol-&gt;SetMapper(volumeMapper);</P>
<P>vol-&gt;SetProperty(volumeProperty);</P></FONT><FONT color=#008000 size=2>
<P>&nbsp;</P>
<P>// An outline provides context around the data.</P></FONT><FONT size=2>
<P>vtkOutlineFilter *outlineData = vtkOutlineFilter::New();</P>
<P>outlineData-&gt;SetInput((vtkDataSet *) v16Img-&gt;GetOutput());</P>
<P>vtkPolyDataMapper *mapOutline = vtkPolyDataMapper::New();</P>
<P>mapOutline-&gt;SetInput(outlineData-&gt;GetOutput());</P>
<P>vtkActor *outline = vtkActor::New();</P>
<P>outline-&gt;SetMapper(mapOutline);</P>
<P>outline-&gt;GetProperty()-&gt;SetColor(0,0,0); </P>
<P></P></FONT><FONT color=#008000 size=2>
<P>&nbsp;</P>
<P>//Starting to Render</P></FONT><FONT size=2>
<P>vtkRenderer *renderer=vtkRenderer::New();</P></FONT><FONT size=2>
<P>renderer-&gt;AddVolume(vol); </P>
<P>renderer-&gt;SetBackground(1,1,1);</P></FONT><FONT color=#008000 size=2>
<P></FONT><FONT color=#008000 size=2>&nbsp;</P></FONT><FONT size=2>
<P>vtkRenderWindow *renWin=vtkRenderWindow::New();</P>
<P>renWin-&gt;SetSize(500,500);</P>
<P>renWin-&gt;DoubleBufferOn(); </P>
<P>renWin-&gt;AddRenderer(renderer);</P>
<P></P>
<P>vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();</P>
<P>iren-&gt;SetRenderWindow(renWin);</P>
<P>iren-&gt;Initialize(); </P>
<P>iren-&gt;Start();</P>
<P>&nbsp;</P>
<P>my question is : is there any way I can access individual slices and a point in the 3 dimensional space (like p(x,y,z).</P>
<P>&nbsp;</P>
<P>thanks in advance,</P>
<P>&nbsp;</P>
<P>Ravi.</P></FONT></DIV><p>
                <hr size=1>Yahoo! for Good<br> 
<a href="http://store.yahoo.com/redcross-donate3/">Click here to donate</a> to the Hurricane Katrina relief effort.