[vtkusers] problem with texture mapping MRI

Amy Squillacote amy.squillacote at kitware.com
Mon Mar 28 10:53:58 EST 2005


Hi Yaqian,

I am posting your response back to the VTK users mailing list.  That way 
more people potentially help answer your question and others can benefit 
from the answers.

- Amy

At 10:46 AM 3/28/2005, Yaqian Fang wrote:

>Hi,
>
>Buy running the code in my previous message, it only produced the heart 
>shape accourding the source file
>
>        vtkStructuredPointsReader *reader = vtkStructuredPointsReader::New();
>
>     reader->SetFileName("C://new.vtk");
>
>What I’ve been trying to do is generating a heart shape from .vtk file, 
>which has been done.  And then map a texture onto the exterior of the 
>heart.  Since heart is not a standard shape (e.g. sphere), I guess the way 
>to texture it is different.  I’ve tried to search some examples, but seems 
>people use .vtk file as texutre source as well as shape source.  Maybe I’m 
>wrong about it
  Anyway, I do hope I can get some help.  Thank you.
>
>Yaqian
>-----Original Message----- From: Amy Squillacote 
>[<mailto:amy.squillacote at kitware.com>mailto:amy.squillacote at kitware.com] 
>Sent: Tuesday, 29 March 2005 1:11 AM To: vtkusers at vtk.org Subject: Re: 
>[vtkusers] problem with texture mapping MRI 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>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 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20050328/8be38bbf/attachment.htm>


More information about the vtkusers mailing list