[vtkusers] reconstruct a stack of TIFF images in 3D

ljp19890525 ljp19890525 at 163.com
Mon Mar 25 09:40:23 EDT 2013


Hi all,
   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!
below is my code,reading one,just one tiff image!
#include <vtkSmartPointer.h>
#include <vtkImageViewer2.h>
#include <vtkTIFFReader.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>

int main(int argc, char* argv[])
{
  //Verify input arguments
  if ( argc != 2 )
    {
    std::cout << "Usage: " << argv[0]
              << " Filename(.tif)" << std::endl;
    return EXIT_FAILURE;
    }

  //Read the image
  vtkSmartPointer<vtkTIFFReader> reader =
    vtkSmartPointer<vtkTIFFReader>::New();
  reader->SetFileName ( argv[1] );

  // Visualize
  vtkSmartPointer<vtkImageViewer2> imageViewer =
    vtkSmartPointer<vtkImageViewer2>::New();
  imageViewer->SetInputConnection(reader->GetOutputPort());
  vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
    vtkSmartPointer<vtkRenderWindowInteractor>::New();
  imageViewer->SetupInteractor(renderWindowInteractor);
  imageViewer->Render();
  imageViewer->GetRenderer()->ResetCamera();
  imageViewer->Render();

  renderWindowInteractor->Start();

  return EXIT_SUCCESS;
}



ljp19890525
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20130325/296de109/attachment.htm>


More information about the vtkusers mailing list