you have to play more with the transfer functions (opacity and colors).<div>The range is not 0 to 255 but it'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"><<a href="mailto:saouli-abdelhak@hotmail.com">saouli-abdelhak@hotmail.com</a>></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&feature=youtu.be" target="_blank">http://www.youtube.com/watch?v=74_RJe47-js&feature=youtu.be</a><br>
<a href="http://www.youtube.com/watch?v=74_RJe47-js&feature=youtu.be" target="_blank">http://www.youtube.com/watch?v=74_RJe47-js&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 "vtkPolyDataMapper.h"<br>
#include "vtkRenderWindow.h"<br>
</div>#include "vtkPiecewiseFunction.h"<br>
#include "vtkThreshold.h"<br>
#include "vtkRenderer.h"<br>
#include "vtkVolumeProperty.h"<br>
#include "vtkRenderWindowInteractor.h"<br>
#include <vtkDICOMImageReader.h><br>
#include <vtkDataSetTriangleFilter.h><br>
#include <vtkVolumeRayCastMapper.h><br>
#include <vtkImageData.h><br>
#include "vtkColorTransferFunction.h"<br>
#include <vtkVolumeRayCastCompositeFunction.h><br>
#include <vtkVolume.h><br>
#include <vtkDICOMImageReader.h><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->AddRenderer( ren1 );<br>
iren->SetRenderWindow( renWin );<br>
<div class="im"><br>
vtkDICOMImageReader *reader = vtkDICOMImageReader::New();<br>
</div> reader->SetDirectoryName("Data");<br>
reader->Update();<br>
<br>
<br>
<br>
<br>
vtkPiecewiseFunction *opacityTransferFunction =<br>
vtkPiecewiseFunction::New();<br>
opacityTransferFunction->AddPoint(20.0,0.0);<br>
opacityTransferFunction->AddPoint(255.0,2.0);<br>
<br>
vtkColorTransferFunction *colorTransferFunction =<br>
vtkColorTransferFunction::New();<br>
colorTransferFunction->AddRGBPoint(0.0,0.0,0.0,0.0);<br>
colorTransferFunction->AddRGBPoint(64.0,1.0,0.0,0.0);<br>
colorTransferFunction->AddRGBPoint(128,0.0,0.0,1.0);<br>
colorTransferFunction->AddRGBPoint(192.0,1.0,0.0,0.0);<br>
colorTransferFunction->AddRGBPoint(255.0,0.0,0.2,0.0);<br>
<br>
vtkVolumeProperty *volumeProperty = vtkVolumeProperty::New();<br>
volumeProperty->SetColor( colorTransferFunction );<br>
volumeProperty->SetScalarOpacity( opacityTransferFunction );<br>
volumeProperty->ShadeOn();<br>
volumeProperty->SetInterpolationTypeToLinear();<br>
<br>
vtkVolumeRayCastCompositeFunction *compositeFunction =<br>
vtkVolumeRayCastCompositeFunction::New();<br>
vtkVolumeRayCastMapper *volumeMapper = vtkVolumeRayCastMapper::New();<br>
<br>
volumeMapper->SetVolumeRayCastFunction( compositeFunction );<br>
volumeMapper->SetInputConnection ( reader->GetOutputPort() );<br>
<br>
vtkVolume *volume = vtkVolume::New();<br>
volume->SetMapper( volumeMapper ) ;<br>
volume->SetProperty ( volumeProperty );<br>
<br>
ren1->AddVolume( volume );<br>
ren1->SetBackground(0.1,0.21,0.31);<br>
<br>
renWin->SetWindowName("Volume");<br>
renWin->SetSize(500,500);<br>
<div class="im"> renWin->Render();<br>
<br>
iren->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>