<DIV>hi vtkusers,</DIV>
<DIV> </DIV>
<DIV> I am reading 2D slices and constructing a 3D volume, using the following code....</DIV>
<DIV> </DIV>
<DIV><FONT size=2>
<P>vtkVolume16Reader *v16Img = vtkVolume16Reader::New();</P>
<P>v16Img->SetDataDimensions (sizex,sizey);</P>
<P>v16Img->SetImageRange (atoi(argv[3]),atoi(argv[4])); </P></FONT><FONT size=2>
<P>v16Img->SetHeaderSize(HeadS);</P>
<P>v16Img->SetFilePrefix (argv[2]); </P>
<P>v16Img->SetDataSpacing (0.1, 0.1, 0.5);</P>
<P>v16Img->SetDataOrigin(0, 0, 0);</P>
<P>cout<<"Image Volume Read...."<<endl;</P></FONT><FONT color=#008000 size=2>
<P> </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->SetCompositeMethodToInterpolateFirst(); </P>
<P></FONT><FONT color=#008000 size=2></FONT> </P>
<P><FONT color=#008000 size=2>//Mapper with selected RayCastFunction</P></FONT><FONT size=2>
<P>vtkVolumeRayCastMapper *volumeMapper = vtkVolumeRayCastMapper::New();</P>
<P>volumeMapper->SetInput(v16Img -> GetOutput());</P>
<P>volumeMapper->SetVolumeRayCastFunction(compositeFunction);</P></FONT><FONT color=#008000 size=2>
<P> </P>
<P>// Create transfer mapping scalar value to opacity</P></FONT><FONT size=2>
<P>vtkPiecewiseFunction *pieceFunc = vtkPiecewiseFunction::New();</P>
<P>pieceFunc->AddPoint(0, 0.0); </FONT><FONT color=#008000 size=2>// alpha value for the lower intensity limit</P></FONT><FONT size=2>
<P>pieceFunc->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> </P>
<P>//Set Volume Property</P></FONT><FONT size=2>
<P>vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();</P>
<P>volumeProperty->SetInterpolationTypeToLinear();</P></FONT><FONT size=2>
<P>volumeProperty->SetScalarOpacity(pieceFunc);</P>
<P>volumeProperty->ShadeOn();</P></FONT><FONT color=#008000 size=2>
<P> </P>
<P>//The special actor with properties</P></FONT><FONT size=2>
<P>vtkVolume *vol = vtkVolume::New();</P>
<P>vol->SetMapper(volumeMapper);</P>
<P>vol->SetProperty(volumeProperty);</P></FONT><FONT color=#008000 size=2>
<P> </P>
<P>// An outline provides context around the data.</P></FONT><FONT size=2>
<P>vtkOutlineFilter *outlineData = vtkOutlineFilter::New();</P>
<P>outlineData->SetInput((vtkDataSet *) v16Img->GetOutput());</P>
<P>vtkPolyDataMapper *mapOutline = vtkPolyDataMapper::New();</P>
<P>mapOutline->SetInput(outlineData->GetOutput());</P>
<P>vtkActor *outline = vtkActor::New();</P>
<P>outline->SetMapper(mapOutline);</P>
<P>outline->GetProperty()->SetColor(0,0,0); </P>
<P></P></FONT><FONT color=#008000 size=2>
<P> </P>
<P>//Starting to Render</P></FONT><FONT size=2>
<P>vtkRenderer *renderer=vtkRenderer::New();</P></FONT><FONT size=2>
<P>renderer->AddVolume(vol); </P>
<P>renderer->SetBackground(1,1,1);</P></FONT><FONT color=#008000 size=2>
<P></FONT><FONT color=#008000 size=2> </P></FONT><FONT size=2>
<P>vtkRenderWindow *renWin=vtkRenderWindow::New();</P>
<P>renWin->SetSize(500,500);</P>
<P>renWin->DoubleBufferOn(); </P>
<P>renWin->AddRenderer(renderer);</P>
<P></P>
<P>vtkRenderWindowInteractor *iren=vtkRenderWindowInteractor::New();</P>
<P>iren->SetRenderWindow(renWin);</P>
<P>iren->Initialize(); </P>
<P>iren->Start();</P>
<P> </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> </P>
<P>thanks in advance,</P>
<P> </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.