<DIV>Hi, all</DIV>
<DIV> </DIV>
<DIV>I want to display a bone image(vtk format) in the screen, so i create a bone.cpp file, the code is as follows:</DIV>
<DIV>***********************************************<FONT color=#0000ff size=2><FONT color=#008000 size=2></DIV>
<DIV></FONT><FONT color=#0000ff size=2>
<P>#include</FONT><FONT size=2><FONT color=#000000> "vtkPolyReader.h"</FONT></P></FONT><FONT color=#0000ff size=2>
<P>#include</FONT><FONT size=2><FONT color=#000000> "vtkPolyDataMapper.h"</FONT></P></FONT><FONT color=#0000ff size=2>
<P>#include</FONT><FONT size=2><FONT color=#000000> "vtkActor.h"</FONT></P></FONT><FONT color=#0000ff size=2>
<P>#include</FONT><FONT size=2><FONT color=#000000> "vtkRenderWindow.h"</FONT></P></FONT><FONT color=#0000ff size=2>
<P>#include</FONT><FONT size=2><FONT color=#000000> "vtkRenderer.h"</FONT></P></FONT><FONT color=#0000ff size=2>
<P>#include</FONT><FONT size=2><FONT color=#000000> "vtkRenderWindowInteractor.h"</FONT></P></FONT><FONT color=#0000ff size=2>
<P>void</FONT><FONT size=2><FONT color=#000000> main ()</FONT></P>
<P>{</P>
<P></FONT>
<P><FONT color=#008000 size=2></P></FONT><FONT size=2>vtkPolyDataReader *reader = vtkPolyDataReader::New();</P>
<P>reader->setFileName("z:/Cisc499/image.vtk);</P>
<P></P>
<P></FONT><FONT color=#008000 size=2>// map to graphics library</P></FONT><FONT size=2>
<P>vtkPolyDataMapper *map = vtkPolyDataMapper::New();</P>
<P>map->SetInput(reader->GetOutput());</P>
<P></FONT><FONT color=#008000 size=2>// actor coordinates geometry, properties, transformation</P></FONT><FONT size=2>
<P>vtkActor *aBone = vtkActor::New();</P>
<P>aBone->SetMapper(map);</P>
<P>aBone->GetProperty()->SetColor(0,0,1); </FONT><FONT color=#008000 size=2>// sphere color blue</P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>// a renderer and render window</P></FONT><FONT size=2>
<P>vtkRenderer *ren1 = vtkRenderer::New();</P>
<P>vtkRenderWindow *renWin = vtkRenderWindow::New();</P>
<P>renWin->AddRenderer(ren1);</P>
<P></FONT><FONT color=#008000 size=2>// an interactor</P></FONT><FONT size=2>
<P>vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();</P>
<P>iren->SetRenderWindow(renWin);</P>
<P></FONT><FONT color=#008000 size=2>// add the actor to the scene</P></FONT><FONT size=2>
<P>ren1->AddActor(aBone);</P>
<P>ren1->SetBackground(1,1,1); </FONT><FONT color=#008000 size=2>// Background color white</P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>// render an image (lights and cameras are created automatically)</P></FONT><FONT size=2>
<P>renWin->Render();</P>
<P></FONT><FONT color=#008000 size=2>// begin mouse interaction</P></FONT><FONT size=2>
<P>iren->Start();</P>
<P>}</P></FONT></FONT><FONT size=2></FONT></DIV>
<P>************************** end of code</P>
<P>Then i donot know what to do next. Do i have to write a CMakeLists.txt in the same folder(I reallyd donot know how to write CMakeLists.txt for this bone.cpp) or build this bone.cpp directly? or do i have to specify the .h files locaition? and how?</P>
<P> </P>
<P>By the way, i have already build VTK_Binary and examples.</P>
<P>Thanks for your help</P>
<P>Happy New Years!!</P>
<P>Steven </P><p><hr SIZE=1>
Do you Yahoo!?<br>
<a href="http://search.yahoo.com/top2003">Find out what made the Top Yahoo! Searches of 2003
</a>