[vtkusers] Problems creating a image

rafael possani gentefinabr at hotmail.com
Mon Sep 3 18:49:07 EDT 2007


   Hi there, I am needing some help, well, I have been trying to convert my polydata to a image, and I am using vtkPolyDataToImageStencil for that, but I aways  received this error: 
Generic Warning: In ..\..\VTK\Common\vtkMath.cxx, line 608
vtkMath::Jacobi: Error extracting eigenfunctions

my code:

    vtkImageData img = new vtkImageData();
    img.SetDimensions( 128, 73, 0 );
    img.SetSpacing( 1.0 , 1.0 , 1.0 );
    img.SetOrigin( 0.0 , 0.0 , 0.0 );
    img.SetNumberOfScalarComponents( 10 );
    img.SetScalarTypeToUnsignedChar();
    img.AllocateScalars();    

    vtkPolyData polyData = new vtkPolyData();
    polyData.SetPoints(points); // my polydata are points, I dont have z coordinate.
    polyData.SetVerts(polys);
    polyData.GetPointData().SetScalars(scalars);
     
    vtkPolyDataToImageStencil filter = new vtkPolyDataToImageStencil ();
    filter.SetInput(polyData);
    
    vtkImageStencil stencil = new vtkImageStencil();
    stencil.SetInput( img );
    stencil.SetStencil( filter.GetOutput());
    stencil.SetBackgroundValue(0);

    vtkBMPWriter writer = new vtkBMPWriter ();
    writer . SetFileDimensionality ( 2 );
    writer . SetFileName ("c:\\image.bmp");
    writer . SetInput(stencil.GetOutput());
    writer . Write (); 

_________________________________________________________________
Conheça o Windows Live Spaces, a rede de relacionamentos conectada ao Messenger!
http://spaces.live.com/signup.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070903/6e54f023/attachment.htm>


More information about the vtkusers mailing list