<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<STYLE>
BLOCKQUOTE {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; MARGIN-LEFT: 2em
}
OL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
UL {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
P {
        MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px
}
BODY {
        LINE-HEIGHT: 1.5; FONT-FAMILY: ΢ÈíÑźÚ; COLOR: #000000; FONT-SIZE: 10.5pt
}
</STYLE>
<META name=GENERATOR content="MSHTML 8.00.7600.17166"></HEAD>
<BODY style="MARGIN: 10px">
<DIV>
<DIV>Hi all,</DIV>
<DIV> I have obtained a
stack of TIFF images. I want to show the images in 3D by
VTK. And I want to reconstruct the images in 3D. By now
I can only show just one tiff image¡¾through the vtkTIFFReader¡¿,but What I
need is to show a stack of TIFF images in 3D. I
would like to see three-dimensional Artistic. They are tiff
imgaes. Thanks a lot!</DIV>
<DIV>below is my code,reading one,just one tiff image!</DIV>
<DIV>#include <vtkSmartPointer.h></DIV></DIV>
<DIV>
<DIV>#include <vtkImageViewer2.h></DIV>
<DIV>#include <vtkTIFFReader.h></DIV>
<DIV>#include <vtkRenderWindow.h></DIV>
<DIV>#include <vtkRenderWindowInteractor.h></DIV>
<DIV>#include <vtkRenderer.h></DIV>
<DIV> </DIV>
<DIV>int main(int argc, char* argv[])</DIV>
<DIV>{</DIV>
<DIV> //Verify input arguments</DIV>
<DIV> if ( argc != 2 )</DIV>
<DIV> {</DIV>
<DIV> std::cout << "Usage: " << argv[0]</DIV>
<DIV> << " Filename(.tif)" << std::endl;</DIV>
<DIV> return EXIT_FAILURE;</DIV>
<DIV> }</DIV>
<DIV> </DIV>
<DIV> //Read the image</DIV>
<DIV> vtkSmartPointer<vtkTIFFReader> reader =</DIV>
<DIV> vtkSmartPointer<vtkTIFFReader>::New();</DIV>
<DIV> reader->SetFileName ( argv[1] );</DIV>
<DIV> </DIV>
<DIV> // Visualize</DIV>
<DIV> vtkSmartPointer<vtkImageViewer2> imageViewer =</DIV>
<DIV> vtkSmartPointer<vtkImageViewer2>::New();</DIV>
<DIV> imageViewer->SetInputConnection(reader->GetOutputPort());</DIV>
<DIV> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =</DIV>
<DIV> vtkSmartPointer<vtkRenderWindowInteractor>::New();</DIV>
<DIV> imageViewer->SetupInteractor(renderWindowInteractor);</DIV>
<DIV> imageViewer->Render();</DIV>
<DIV> imageViewer->GetRenderer()->ResetCamera();</DIV>
<DIV> imageViewer->Render();</DIV>
<DIV> </DIV>
<DIV> renderWindowInteractor->Start();</DIV>
<DIV> </DIV>
<DIV> return EXIT_SUCCESS;</DIV>
<DIV>}</DIV></DIV>
<HR style="WIDTH: 210px; HEIGHT: 1px" align=left color=#b5c4df SIZE=1>
<DIV><SPAN>ljp19890525</SPAN></DIV></BODY></HTML>