<DIV>Hi all,</DIV>
<DIV>&nbsp;</DIV>
<DIV>I've a volume data that I tried to volume render with ray casting(which I constructed from 5, 2D images).&nbsp; I've&nbsp;a couple of&nbsp;questions at this time:</DIV>
<DIV>&nbsp;</DIV>
<DIV>1.&nbsp;When I rotate the volume around, assuming that image slice 1 is visible, I expect the see the structures in other slices; say if I rotate it 180 degrees around I'm expecting to see structures from image slice 5; but I still see&nbsp;only the&nbsp;structures from slice 1.&nbsp; Am I missing something while rendering?&nbsp; (I've verified the dimensions of the volume dataset and it is correct).</DIV>
<DIV>&nbsp;</DIV>
<DIV>2. Are there segmentation algorithms that are available with vtk that can used on 2D images before being volume rendered?</DIV>
<DIV>&nbsp;</DIV>
<DIV>3. With the volume built from 5 image slices, when I rotate the volume around, the thickness of the volume (along z-axis) appears to be got just from a single image.&nbsp; May be I'm doing something wrong in rendering.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Here are few fragments of my code that I used to volume render:</DIV>
<DIV>&nbsp;</DIV>
<DIV>CVolRendererView::CVolRendererView()<BR>{<BR>&nbsp;this-&gt;color = vtkPiecewiseFunction::New();<BR>&nbsp;this-&gt;color-&gt;AddPoint(0, 0.0);<BR>&nbsp;this-&gt;color-&gt;AddPoint(255, 1.0);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;this-&gt;opacity = vtkPiecewiseFunction::New();<BR>&nbsp;this-&gt;opacity-&gt;AddPoint(0, 0.0);<BR>&nbsp;this-&gt;opacity-&gt;AddPoint(130, 0.0);<BR>&nbsp;this-&gt;opacity-&gt;AddPoint(140, 1.0);<BR>&nbsp;this-&gt;opacity-&gt;AddPoint(255, 1.0);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;this-&gt;gradOpacity = vtkPiecewiseFunction::New();<BR>&nbsp;this-&gt;gradOpacity-&gt;AddPoint(0, 0.0);<BR>&nbsp;this-&gt;gradOpacity-&gt;AddPoint(3, 0.0);<BR>&nbsp;this-&gt;gradOpacity-&gt;AddPoint(6, 1.0);<BR>&nbsp;this-&gt;gradOpacity-&gt;AddPoint(255, 1.0);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;this-&gt;property = vtkVolumeProperty::New();<BR>&nbsp;this-&gt;property-&gt;SetColor(this-&gt;color);<BR>&nbsp;this-&gt;property-&gt;SetScalarOpacity(this-&gt;opacity);<BR>&nbsp;this-&gt;property-&gt;SetGradientOpacity(this-&gt;gradOpacity);</DIV>
<DIV>&nbsp;this-&gt;property-&gt;ShadeOn();<BR>&nbsp;this-&gt;property-&gt;SetInterpolationTypeToLinear();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;this-&gt;composite = vtkVolumeRayCastCompositeFunction::New();<BR>&nbsp;this-&gt;composite-&gt;SetCompositeMethodToInterpolateFirst();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;this-&gt;mapper = vtkVolumeRayCastMapper::New();<BR>&nbsp;this-&gt;mapper-&gt;SetVolumeRayCastFunction(composite);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;this-&gt;volume = vtkVolume::New();<BR>&nbsp;this-&gt;volume-&gt;SetMapper(this-&gt;mapper);<BR>&nbsp;this-&gt;volume-&gt;SetProperty(this-&gt;property);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;this-&gt;ren = vtkRenderer::New();<BR>&nbsp;this-&gt;ren-&gt;AddVolume(volume);</DIV>
<DIV>&nbsp;this-&gt;renWin = vtkWin32OpenGLRenderWindow::New();</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;this-&gt;iren = vtkRenderWindowInteractor::New();</DIV>
<DIV><BR>&nbsp;this-&gt;imageAppend = vtkImageAppend::New();<BR>&nbsp;this-&gt;imageAppend-&gt;SetAppendAxis(2);</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;this-&gt;renWin-&gt;AddRenderer(this-&gt;ren);<BR>&nbsp;this-&gt;iren-&gt;SetRenderWindow(this-&gt;renWin);<BR>&nbsp;this-&gt;iren-&gt;Start();<BR>}</DIV>
<DIV>&nbsp;</DIV>
<DIV>//Updating the volume with new image slices</DIV>
<DIV>this-&gt;imageAppend-&gt;AddInput(this-&gt;GetDocument()-&gt;reader-&gt;GetOutput());<BR>this-&gt;imageAppend-&gt;UpdateWholeExtent();<BR></DIV>
<DIV>//Rendering</DIV>
<DIV>this-&gt;mapper-&gt;SetInput((vtkImageData*)this-&gt;imageAppend-&gt;GetOutput());<BR>this-&gt;ren-&gt;ResetCamera();<BR>this-&gt;renWin-&gt;Render();<BR></DIV>
<DIV>I would appreciate your inputs on this.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Thanks,</DIV>
<DIV>Madhu.</DIV><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com