[vtkusers] problem with texture mapping MRI

Yaqian Fang y.fang at epsa.uq.edu.au
Mon Mar 28 09:46:24 EST 2005


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
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/20050329/d413c343/attachment.htm>


More information about the vtkusers mailing list