you have to play more with the transfer functions (opacity and colors).<div>The range is not 0 to 255 but it&#39;s your image range (-1000 to 3000 ?).<br><div>j.<br><br><div class="gmail_quote">On Wed, Mar 7, 2012 at 11:57 AM, Hellice <span dir="ltr">&lt;<a href="mailto:saouli-abdelhak@hotmail.com">saouli-abdelhak@hotmail.com</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Again well afer Hours of reading examples  and testing them i comme up<br>
withe some resulte :<br>
This video on youtube shows my work :<br>
<a href="http://www.youtube.com/watch?v=74_RJe47-js&amp;feature=youtu.be" target="_blank">http://www.youtube.com/watch?v=74_RJe47-js&amp;feature=youtu.be</a><br>
<a href="http://www.youtube.com/watch?v=74_RJe47-js&amp;feature=youtu.be" target="_blank">http://www.youtube.com/watch?v=74_RJe47-js&amp;feature=youtu.be</a><br>
<br>
As you can see i did not get he rendring right , i just used a simple ray<br>
cast and applide on Dicom slices<br>
<br>
please if you just have some idea to get it done just tell me.<br>
<br>
here is my code<br>
--------------------------------------------------------------------------------------------<br>
<div class="im">*<br>
#include &quot;vtkPolyDataMapper.h&quot;<br>
#include &quot;vtkRenderWindow.h&quot;<br>
</div>#include &quot;vtkPiecewiseFunction.h&quot;<br>
#include &quot;vtkThreshold.h&quot;<br>
#include &quot;vtkRenderer.h&quot;<br>
#include &quot;vtkVolumeProperty.h&quot;<br>
#include &quot;vtkRenderWindowInteractor.h&quot;<br>
#include &lt;vtkDICOMImageReader.h&gt;<br>
#include &lt;vtkDataSetTriangleFilter.h&gt;<br>
#include &lt;vtkVolumeRayCastMapper.h&gt;<br>
#include &lt;vtkImageData.h&gt;<br>
#include &quot;vtkColorTransferFunction.h&quot;<br>
#include &lt;vtkVolumeRayCastCompositeFunction.h&gt;<br>
#include &lt;vtkVolume.h&gt;<br>
#include &lt;vtkDICOMImageReader.h&gt;<br>
<div class="im"><br>
using namespace std;<br>
<br>
int main()<br>
{<br>
</div>        vtkRenderer *ren1 = vtkRenderer::New();<br>
<div class="im">        vtkRenderWindow *renWin = vtkRenderWindow::New();<br>
</div><div class="im">        vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();<br>
<br>
</div>        renWin-&gt;AddRenderer( ren1 );<br>
        iren-&gt;SetRenderWindow( renWin );<br>
<div class="im"><br>
        vtkDICOMImageReader *reader = vtkDICOMImageReader::New();<br>
</div>        reader-&gt;SetDirectoryName(&quot;Data&quot;);<br>
    reader-&gt;Update();<br>
<br>
<br>
<br>
<br>
        vtkPiecewiseFunction *opacityTransferFunction =<br>
vtkPiecewiseFunction::New();<br>
        opacityTransferFunction-&gt;AddPoint(20.0,0.0);<br>
        opacityTransferFunction-&gt;AddPoint(255.0,2.0);<br>
<br>
        vtkColorTransferFunction *colorTransferFunction =<br>
vtkColorTransferFunction::New();<br>
        colorTransferFunction-&gt;AddRGBPoint(0.0,0.0,0.0,0.0);<br>
        colorTransferFunction-&gt;AddRGBPoint(64.0,1.0,0.0,0.0);<br>
        colorTransferFunction-&gt;AddRGBPoint(128,0.0,0.0,1.0);<br>
        colorTransferFunction-&gt;AddRGBPoint(192.0,1.0,0.0,0.0);<br>
        colorTransferFunction-&gt;AddRGBPoint(255.0,0.0,0.2,0.0);<br>
<br>
        vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();<br>
        volumeProperty-&gt;SetColor( colorTransferFunction );<br>
        volumeProperty-&gt;SetScalarOpacity( opacityTransferFunction );<br>
        volumeProperty-&gt;ShadeOn();<br>
        volumeProperty-&gt;SetInterpolationTypeToLinear();<br>
<br>
        vtkVolumeRayCastCompositeFunction  *compositeFunction =<br>
vtkVolumeRayCastCompositeFunction::New();<br>
        vtkVolumeRayCastMapper *volumeMapper = vtkVolumeRayCastMapper::New();<br>
<br>
        volumeMapper-&gt;SetVolumeRayCastFunction( compositeFunction );<br>
        volumeMapper-&gt;SetInputConnection ( reader-&gt;GetOutputPort() );<br>
<br>
        vtkVolume *volume = vtkVolume::New();<br>
        volume-&gt;SetMapper( volumeMapper ) ;<br>
        volume-&gt;SetProperty ( volumeProperty );<br>
<br>
        ren1-&gt;AddVolume( volume );<br>
        ren1-&gt;SetBackground(0.1,0.21,0.31);<br>
<br>
        renWin-&gt;SetWindowName(&quot;Volume&quot;);<br>
        renWin-&gt;SetSize(500,500);<br>
<div class="im">        renWin-&gt;Render();<br>
<br>
        iren-&gt;Start();<br>
<br>
        return 0;<br>
}<br>
</div>*<br>
20 mn of your precious for reading and try to figur out the prob and i will<br>
be thankful for eternity ^^<br>
<br>
--<br>
View this message in context: <a href="http://vtk.1045678.n5.nabble.com/Help-Display-Slice-of-images-on-3D-vtkImageActor-tp5533571p5544760.html" target="_blank">http://vtk.1045678.n5.nabble.com/Help-Display-Slice-of-images-on-3D-vtkImageActor-tp5533571p5544760.html</a><br>


<div class="HOEnZb"><div class="h5">Sent from the VTK - Users mailing list archive at Nabble.com.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
</div></div></blockquote></div><br></div></div>