[vtkusers] use itk dicom reader with QT

Jothybasu Selvaraj jothybasu at gmail.com
Mon Feb 27 08:40:06 EST 2012


It works on my computer, there must be some problem with the path to your
headers.

Jothy

On Mon, Feb 27, 2012 at 1:13 PM, Brenno Ribeiro <brennobr at gmail.com> wrote:

> Here is the full code i'm trying to build.
>
> #include <vtkSmartPointer.h>
> #include <vtkImageViewer2.h>
> #include <vtkDICOMImageReader.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(.jpeg)" << std::endl;
>     return EXIT_FAILURE;
>     }
>
>   std::string folder = argv[1];
>
>   // Read all the DICOM files in the specified directory.
>   vtkSmartPointer<vtkDICOMImageReader> reader =
>     vtkSmartPointer<vtkDICOMImageReader>::New();
>   reader->SetDirectoryName(folder.c_str());
>   reader->Update();
>
>   // 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;
> }
>
>
> The following error occurs in these lines "undefined reference to"
>
> vtkSmartPointer<vtkDICOMImageReader> reader =
> vtkSmartPointer<vtkDICOMImageReader>::New();
> vtkSmartPointer<vtkImageViewer2> imageViewer =
> vtkSmartPointer<vtkImageViewer2>::New();
> vtkSmartPointer<vtkRenderWindowInteractor> renderWindowInteractor =
> vtkSmartPointer<vtkRenderWindowInteractor>::New();
>
>
> --
> Brenno Bernardes Ribeiro
>
> Engenharia da Computação
> Universidade Federal do Pará
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>


-- 
Jothy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20120227/e566cc50/attachment.htm>


More information about the vtkusers mailing list