[vtkusers] problem with texture mapping MRI

Amy Squillacote amy.squillacote at kitware.com
Mon Mar 28 10:11:08 EST 2005


Yaqian,

Please provide more information about what happens when you run this code 
and what you expect to happen.  Just saying "it doesn't work as expected" 
is not enough of a description for someone to help with your problem.

- Amy

At 09:46 AM 3/28/2005, Yaqian Fang wrote:
>content-class: urn:content-classes:message
>Content-Type: multipart/alternative;
>         boundary="----_=_NextPart_001_01C533A4.EA0F2A6A"
>
>Hi,
>
>My code for texture mapping MRI heart model is as following.  It cannot 
>generate the textured heart as I expected.  Could anyone please give me 
>some idea on how to fix it?
>
>/* read a picture */
>
>         vtkPNMReader *pnmReader = vtkPNMReader::New();
>
>         pnmReader->SetFileName("C:/heart.ppm");
>
>         vtkTexture *aText = vtkTexture::New();
>
>         pnmReader->Update();
>
>         aText->SetInput(pnmReader->GetOutput());
>
>         aText->InterpolateOn();
>
>/* mapping */
>
>         vtkDelaunay3D *del = vtkDelaunay3D::New();
>
>         del->SetInput((vtkPointSet *)reader->GetOutput());
>
>         del->SetTolerance(0.1);
>
>         vtkThresholdTextureCoords *tmapper = vtkThresholdTextureCoords 
> ::New();
>
>         tmapper->SetInput(del->GetOutput());
>
>         vtkTransformTextureCoords *xform = vtkTransformTextureCoords::New();
>
>         xform->SetInput(tmapper->GetOutput());
>
>         vtkDataSetMapper *mapper = vtkDataSetMapper::New();
>
>         mapper->SetInput((vtkImageData *)xform->GetOutput());
>
>         vtkActor *triangulation = vtkActor::New();
>
>         triangulation->SetMapper(mapper);
>
>         triangulation->SetTexture(aText);
>
>/* rendering*/
>
>         ren1->AddActor(triangulation);
>
>Thank you very much!!!
>
>Regards,
>
>Yaqian
>
>_______________________________________________
>
>This is the private VTK discussion list.
>
>Please keep messages on-topic. Check the FAQ at: 
><http://www.vtk.org/Wiki/VTK_FAQ>http://www.vtk.org/Wiki/VTK_FAQ
>
>Follow this link to subscribe/unsubscribe:
>
><http://www.vtk.org/mailman/listinfo/vtkusers>http://www.vtk.org/mailman/listinfo/vtkusers
>_______________________________________________
>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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050328/522b11a2/attachment.htm>


More information about the vtkusers mailing list