[vtkusers] A wrong visualization result

Bill Lorensen bill.lorensen at gmail.com
Mon Apr 14 19:49:47 EDT 2008


Can you post a screenshot of the result? Since your images are in BMP
format, I suspect that they are 8 bit images and not 16 bit images
required by the Volume16Reader.

Bill


On Mon, Apr 14, 2008 at 2:13 PM, C. Hiba <hiba_vtk at yahoo.fr> wrote:
> 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.
>
>
> _______________________________________________
> This is the private VTK discussion list.
> Please keep messages on-topic. Check the FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list