Hi,<br><br>I'm a new user of VTK library. I'm creating a 3D image as vtkImageData. This image is a cube consisting of a dense group of points. Well, the problem is when I try to visualize it using lookup tables with transparencies and I can watch only the extern peel. The transparencies work fine, but only the extern points are visualized and across the transparencies only the points of the opposite peel can be watched whereas the inside points also should be rendered.<br>
<br>Could Anybody say me if this fact is normal because VTK can't control the transparencies of several peels at the same time?<br><br>Here, I append part of my code:<br><br>vtkSmartPointer<vtkImageData> imageData = vtkSmartPointer<vtkImageData>::New();<br>
vtkSmartPointer<vtkXMLImageDataReader> reader = vtkSmartPointer<vtkXMLImageDataReader>::New();<br>reader->SetFileName("3Dimage.vti");<br><br>vtkSmartPointer<vtkLookupTable> lut = vtkSmartPointer<vtkLookupTable>::New();<br>
<br>double *minMax = imageData->GetScalarRange();<br>lut->SetNumberOfColors(256);<br>lut->SetRange(minMax);<br>lut->SetHueRange(0.0, 0.667); <br>lut->Build(); //effectiv <br><br>float airRange[]={-0.03, 0.051};<br>
<br>double rgba[4];<br> for(int i=lut->GetIndex(airRange[0])+1;i<=lut->GetIndex(airRange[i]);i++) <br>{<br> float alpha=0.0;<br> lut->GetTableValue(i, rgba);<br> rgba[3]=alpha; <br> lut->SetTableValue(i, rgba);<br>
}<br> <br>vtkSmartPointer<vtkDataSetMapper> mapper = vtkSmartPointer<vtkDataSetMapper>::New();<br><br>mapper->SetInputConnection(extractor->GetOutputPort());<br>mapper->SetLookupTable(lut);<br>mapper->SetScalarRange(minMax);<br>
mapper->ScalarVisibilityOn();<br><br>vtkSmartPointer<vtkActor> actor = vtkSmartPointer<vtkActor>::New();<br>actor->SetMapper(mapper);<br><br>vtkSmartPointer<vtkRenderer> renderer = vtkSmartPointer<vtkRenderer>::New();<br>
renderer->AddActor(actor);<br>renderer->ResetCamera();<br>renderer->SetBackground(1,1,1);<br><br>vtkSmartPointer<vtkRenderWindow> renderWindow = vtkSmartPointer<vtkRenderWindow>::New();<br>renderWindow->AddRenderer(renderer);<br>
<br>vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor = vtkSmartPointer<vtkRenderWindowInteractor>::New();<br>renderWindowInteractor->SetRenderWindow(renderWindow);<br>renderWindowInteractor->Initialize();<br>
<br>renderWindowInteractor->Start();<br><br>--<br>Juan Bueno Losada<br>Universidad de Salamanca<br><br>