[vtkusers] A wrong visualization result
C. Hiba
hiba_vtk at yahoo.fr
Mon Apr 14 14:13:11 EDT 2008
Good evening.
I'm trying to visualize the skull volume from a sequence of segmented images. The program runs normally but the result is not right: I don't have a skull volume in my interface but 4!!!
I have attached mt code and i hope that someone tells me where is the error.
Thank you.
vtkVolume16Reader *Reader = vtkVolume16Reader::New();
Reader->SetDataDimensions(128,128);
Reader->SetFilePrefix("C:/Images/bmp/X");
Reader->SetImageRange(1,48);
Reader->SetDataByteOrderToLittleEndian();
Reader->SetDataSpacing(1,1,1);
// An isosurface, or contour value of 500 is known to correspond to the skin of the // patient. Once generated, a vtkPolyDataNormals filter is used to create normals // for smooth surface shading during rendering
vtkContourFilter *skinExtractor = vtkContourFilter::New();
skinExtractor->SetInput((vtkDataSet *) Reader->GetOutput());
skinExtractor->SetValue(0,500);
vtkPolyDataNormals *skinNormals = vtkPolyDataNormals::New();
skinNormals->SetInput(skinExtractor->GetOutput());
skinNormals->SetFeatureAngle(60.0);
vtkPolyDataMapper *skinMapper = vtkPolyDataMapper::New();
skinMapper->SetInput(skinNormals->GetOutput());
skinMapper->ScalarVisibilityOff();
vtkActor *skin = vtkActor::New();
skin->SetMapper(skinMapper);
// It is convenient to create an initial view of the data. The FocalPoint and Position // form a vector direction. Later on (ResetCamera() method) this vector is used to // position the camera to look at the data in this direction.
vtkCamera *aCamera = vtkCamera::New();
aCamera->SetViewUp (0, 0, 1);
aCamera->SetPosition (0, 1, 0);
aCamera->SetFocalPoint (0, 0, 0);
aCamera->ComputeViewPlaneNormal();
// Actors are added to the renderer. An initial camera view is created.
// The Dolly() method moves the camera towards the FocalPoint,thereby enlarging // the image.
mRender->AddActor(skin);
mRender->SetActiveCamera(aCamera);
mRender->ResetCamera();
aCamera->Dolly(1.5);
---------------------------------
Envoyé avec Yahoo! Mail.
Une boite mail plus intelligente.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080414/c5b057a3/attachment.htm>
More information about the vtkusers
mailing list