<html>
<body>
Hi Yaqian,<br><br>
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.<br><br>
- Amy<br><br>
At 10:46 AM 3/28/2005, Yaqian Fang wrote:<br><br>
<blockquote type=cite class=cite cite="">
<font face="Verdana" color="#000080">Hi,<br>
</font><br>
<font face="Verdana" color="#000080"><a></a>Buy running the code in my
previous message, it</font>
<font face="Verdana" color="#000080">only</font>
<font face="Verdana" color="#000080">produced the heart shape accourding
the source file</font> <br><br>
vtkStructuredPointsReader *reader =
vtkStructuredPointsReader::New();<br><br>
<font face="Courier New, Courier" size=2>
reader->SetFileName("C://new.vtk");<br>
</font><br>
<font face="Verdana" color="#000080">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</font>
<font face="Verdana" color="#000080">the</font>
<font face="Verdana" color="#000080">exterior</font>
<font face="Verdana" color="#000080">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… </font> <font face="Verdana" color="#000080">Anyway, I do
hope I can get some help. Thank you.<br>
</font><br>
<font face="Verdana" color="#000080">Yaqian</font>
<ul>
<ul>
<font face="Tahoma" size=2>-----Original Message-----
<b>From:</b> Amy Squillacote
[<a href="mailto:amy.squillacote@kitware.com">
mailto:amy.squillacote@kitware.com</a>]
<b>Sent:</b> Tuesday, 29 March 2005 1:11 AM
<b>To:</b> vtkusers@vtk.org
<b>Subject:</b> Re: [vtkusers] problem with texture mapping MRI</font>
Yaqian,<br>
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.<br>
- Amy<br>
At 09:46 AM 3/28/2005, Yaqian Fang wrote:<br>
content-class: urn:content-classes:message
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C533A4.EA0F2A6A"<br><br>
<font face="Verdana" color="#000080">Hi,</font>
<font face="Verdana" color="#000080">My code for texture mapping MRI
heart model is as following. It cannot generate the textured heart
as I expected.</font> <font face="Verdana" color="#000080">Could
anyone please give me some idea on</font>
<font face="Verdana" color="#000080">how to fix it?</font>
<font face="Courier New, Courier">/* read a picture */</font>
<font face="Courier New, Courier">vtkPNMReader *pnmReader =
vtkPNMReader::New();</font>
<font face="Courier New, Courier">
pnmReader->SetFileName("C:/heart.ppm");</font>
<font face="Courier New, Courier">vtkTexture *aText =
vtkTexture::New();</font>
<font face="Courier New, Courier">pnmReader->Update();</font>
<font face="Courier New, Courier">
aText->SetInput(pnmReader->GetOutput());</font>
<font face="Courier New, Courier">aText->InterpolateOn();</font>
<font face="Courier New, Courier">/* mapping */</font>
<font face="Courier New, Courier">vtkDelaunay3D *del =
vtkDelaunay3D::New();</font>
<font face="Courier New, Courier">del->SetInput((vtkPointSet
*)reader->GetOutput());</font>
<font face="Courier New, Courier">del->SetTolerance(0.1);</font>
<font face="Courier New, Courier">vtkThresholdTextureCoords *tmapper =
vtkThresholdTextureCoords ::New();</font>
<font face="Courier New, Courier">
tmapper->SetInput(del->GetOutput());</font>
<font face="Courier New, Courier">vtkTransformTextureCoords *xform =
vtkTransformTextureCoords::New();</font>
<font face="Courier New, Courier">
xform->SetInput(tmapper->GetOutput());</font>
<font face="Courier New, Courier">vtkDataSetMapper *mapper =
vtkDataSetMapper::New();</font>
<font face="Courier New, Courier">mapper->SetInput((vtkImageData
*)xform->GetOutput());</font>
<font face="Courier New, Courier">vtkActor *triangulation =
vtkActor::New();</font>
<font face="Courier New, Courier">
triangulation->SetMapper(mapper);</font>
<font face="Courier New, Courier">
triangulation->SetTexture(aText);</font>
<font face="Courier New, Courier">/* rendering*/</font>
<font face="Courier New, Courier">ren1->AddActor(triangulation);</font>
<font face="Verdana" color="#000080">Thank you very much!!!</font>
<font face="Verdana" color="#000080">Regards,</font>
<font face="Verdana" color="#000080">Yaqian</font>
<font face="Verdana" color="#000080">
_______________________________________________</font>
<font face="Verdana" color="#000080">This is the private VTK discussion
list.</font>
<font face="Verdana" color="#000080">Please keep messages on-topic. Check
the FAQ at:</font>
<a href="http://www.vtk.org/Wiki/VTK_FAQ">
<font face="Verdana" color="#0000FF"><u>
http://www.vtk.org/Wiki/VTK_FAQ</a></u></font><br><br>
<font face="Verdana" color="#000080">Follow this link to
subscribe/unsubscribe:</font>
<font face="Verdana" color="#0000FF"><u>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers">
http://www.vtk.org/mailman/listinfo/vtkusers</a></u></font>
_______________________________________________
This is the private VTK discussion list.
Please keep messages on-topic. Check the FAQ at:
<a href="http://www.vtk.org/Wiki/VTK_FAQ"><font color="#0000FF"><u>
http://www.vtk.org/Wiki/VTK_FAQ</a></u></font>
Follow this link to subscribe/unsubscribe:
<font color="#0000FF"><u>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers">
http://www.vtk.org/mailman/listinfo/vtkusers</a></font>
</ul>
</ul></u></blockquote></body>
</html>