hi all.., there is my code to render a 3D Volume of MRI slice., it works good but it displayed in a worng way (contrast is too bad and also it seems not fit in the slice it self like the data was overlaped each other) i think the problem in reading the files(or may be in Opacity..). here is my code:..( i changed the opacity,color but no effect..).. can any one help me to find where is the problem here? vtkRenderer *aRenderer = vtkRenderer::New(); vtkRenderWindow *renWin = vtkRenderWindow::New(); renWin->AddRenderer(aRenderer); vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New(); iren->SetRenderWindow(renWin); vtkTIFFReader *Reader = vtkTIFFReader::New(); Reader->SetFilePrefix ("D:/tiff/TIFF/MRI"); //Location of slices Reader->SetFilePattern("%s%.4d.tif"); Reader->SetDataExtent (0,255,0,255,1,15); //No.of slices Reader->SetDataSpacing(1,1,1); Reader->Update(); vtkPiecewiseFunction *oTFun =vtkPiecewiseFunction::New(); oTFun->AddSegment(80,0.0,255,1.0); vtkPiecewiseFunction *gTFun =vtkPiecewiseFunction::New(); gTFun->AddSegment(0,1.0,255,1.0); vtkVolumeProperty *volProperty = vtkVolumeProperty::New(); volProperty->SetColor(gTFun); //volProperty->SetOpacity(oTFun); volProperty->SetInterpolationTypeToLinear(); volProperty->ShadeOn(); vtkVolumeRayCastCompositeFunction *compositeFunction= vtkVolumeRayCastCompositeFunction::New(); vtkVolumeRayCastMapper *volMapper = vtkVolumeRayCastMapper::New(); volMapper->SetInput(Reader->GetOutput()); volMapper->SetVolumeRayCastFunction(compositeFunction); vtkVolume *vol=vtkVolume::New(); vol->SetMapper(volMapper); vol->SetProperty(volProperty); aRenderer->AddVolume(vol); aRenderer->SetBackground(1,1,1); vtkCamera *aCamera = vtkCamera::New(); aCamera->SetViewUp (0, 0, -1); aCamera->SetPosition (0, 1, 0); aCamera->SetFocalPoint (0, 0, 0); aCamera->ComputeViewPlaneNormal(); aRenderer->SetActiveCamera(aCamera); aRenderer->ResetCamera (); aCamera->Dolly(1.5); renWin->SetSize(640, 480); iren->SetDesiredUpdateRate(3.0); iren->Initialize(); iren->Start(); thanx.. yasser _____________________________________________________________ Your own email, free website, free software and services at http://www.uscomputer.net/portal.htm - courtesy of U.S. Computer Corporation - _____________________________________________________________ Select your own custom email address for FREE! Get you@yourchoice.com w/No Ads, 6MB, POP & more! http://www.everyone.net/selectmail?campaign=tag