<div>Hey Ankur,</div>
<div> </div>
<div>I cannot get a clear picture.</div>
<div> </div>
<div>Can you post your pseudocode ?</div>
<div> </div>
<div>Regards,</div>
<div> </div>
<div>Deepak</div>
<div> </div>
<div><span class="gmail_quote">On 1/18/06, <b class="gmail_sendername">Ankur Deshmukh</b> <<a href="mailto:adeshmuk@uccs.edu">adeshmuk@uccs.edu</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Hey Deepak,<br><br>I am using the medical datset provided by vtk. I am trying to map burn<br>texture on to the headsq dataset. The burn texture is a jpeg image.
<br>When I do the mapping this is what i get:<br><a href="http://cs.uccs.edu/~asdeshmu/figure.png">http://cs.uccs.edu/~asdeshmu/figure.png</a><br><br>I am not sure how the mapping is getting all screwed up. Any help will<br>
be appreciated.<br><br>Thanks<br>Ankur<br>Deepak Roy wrote:<br><br>> Hey Ankur,<br>><br>> I am not sure, on to what geometry your are trying to map your<br>> texture. And also whether you are repeating the texture all over your
<br>> medical dataset.<br>><br>> I'll go ahead and describe what i did in my case. Hope it is of some<br>> help to you.<br>><br>> My geomtery is a Triangular mesh - an open surface representation of a<br>
> Human Body. It is initially in the form of a VRML file and i have<br>> written custom vtkPolyDataSource Filter that gives me a vtkPolyData of<br>> the surface geometry i have.<br>><br>> Once this is done, here is the pseudocode i followed:
<br>><br>> ****************************************************************************************************************************<br>><br>> vtkPolyData *pVtkMesh = FromVrmlFile( <vrml-model-file> );
<br>><br>> // create mesh polydata mapper<br>><br>> vtkPolyDataMapper *pMeshMapper = vtkPolyDataMapper::New();<br>><br>> pMeshMapper->SetInput( pVtkMesh );<br>><br>> // read texture image from file vtkImageReader2Factory
<br>> *pImageReaderFactory = vtkImageReader2Factory::New();<br>><br>> vtkImageReader2 *pTextureImageReader = vtkImageReader2::New();<br>><br>> pTextureImageReader =<br>> pImageReaderFactory->CreateImageReader2(strTextureFile);
<br>><br>> pTextureImageReader->SetFileName(strTextureFile);<br>><br>> // build texture vtkTexture *pModelTexture = vtkTexture::New();<br>><br>> pModelTexture->SetInput( pTextureImageReader->GetOutput() );
<br>><br>> pModelTexture->InterpolateOff();<br>><br>> pModelTexture->RepeatOff();<br>><br>> // create and setup actor vtkActor * pTorsoTextureActor =<br>> vtkActor::New();<br>><br>> pTorsoTextureActor->SetMapper( pMeshMapper );
<br>><br>> pTorsoTextureActor->SetTexture( pModelTexture );<br>><br>> *************************************************************************************************************<br>><br>> Regards,<br>
><br>> Deepak<br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>><br>> On 1/17/06, *Ankur Deshmukh* <<a href="mailto:adeshmuk@uccs.edu">adeshmuk@uccs.edu
</a><br>> <mailto:<a href="mailto:adeshmuk@uccs.edu">adeshmuk@uccs.edu</a>> > wrote:<br>><br>> Hey Deepak,<br>><br>> I am having problems with mapping my texture to a medical data set. I<br>
> was wondering if you could send me your code on how you have achieved<br>> the texture mapping.<br>><br>> Thanks<br>> Ankur<br>><br>> Deepak Roy wrote:<br>><br>> > Hello Marc,
<br>> ><br>> > Seems like a lot of mutually benefiting discussion. I like it.<br>> ><br>> > Infact i was looking for a way to play with the clamping and<br>> > interpolation options of the texture in VTK. But i found no way
<br>> to do<br>> > this.<br>> ><br>> > All vtkTexture provides us is Interpolate On/Off and Repeat On/Off.<br>> ><br>> > Do you know how to change the way the texture interpolation is
<br>> done.<br>> ><br>> > I hope this might solve my problem.<br>> ><br>> > Eagerly waiting for your reply .....<br>> ><br>> > Regards,<br>> ><br>
> > Deepak<br>> ><br>> ><br>> ><br>> > On 1/17/06, *Marc Cotran* < <a href="mailto:marc@cotran.ca">marc@cotran.ca</a><br>> <mailto:<a href="mailto:marc@cotran.ca">
marc@cotran.ca</a>> <mailto:<a href="mailto:marc@cotran.ca">marc@cotran.ca</a><br>> <mailto:<a href="mailto:marc@cotran.ca">marc@cotran.ca</a>>>> wrote:<br>> ><br>> > Hi Deepak,
<br>> ><br>> > Quick question: does using Flat interpolation instead of<br>> Gouraud or<br>> > Phong get rid of the cracks?<br>> ><br>> > It does for me...
<br>> ><br>> > Marc<br>> ><br>> ><br>> >------------------------------------------------------------------------<br>> ><br>> >_______________________________________________
<br>> >This is the private VTK discussion list.<br>> >Please keep messages on-topic. Check the FAQ at:<br>> <a href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</a> <<a href="http://www.vtk.org/Wiki/VTK_FAQ">
http://www.vtk.org/Wiki/VTK_FAQ</a>><br>> >Follow this link to subscribe/unsubscribe:<br>> ><a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
> <<a href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</a>><br>> ><br>> ><br>><br>><br><br></blockquote></div><br>