[vtkusers] connecting vtkKWImage & vtkKWImageIO to itkFilters

Bryn Lloyd blloyd at vision.ee.ethz.ch
Wed Apr 1 06:11:06 EDT 2009


Sergio,

Have a look at the example here:
http://public.kitware.com/cgi-bin/viewcvs.cgi/*checkout*/Imaging/Testing/Cxx/FastSplatter.cxx?root=VTK&content-type=text/plain


Since my ImageViewer inherits from vtkImageViewer2, you can use it in
the same way. You only need to setup an interactor:


   // Set up a viewer for the image.  vtkImageViewer and
   // vtkImageViewer2 are convenient wrappers around vtkActor2D,
   // vtkImageMapper, vtkRenderer, and vtkRenderWindow.  All you need
   // to supply is the interactor.
   ImageViewer *viewer = ImageViewer::New();
   viewer->SetInput( reader->GetOutput() );

   vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
   viewer->SetupInteractor(iren);

   viewer->Render();
   viewer->GetRenderer()->ResetCamera();

   viewer->Render();
   iren->Start();


--Bryn





Sergio Aguirre wrote:
> Bryn
> 
> Your code has been very helpful.
> 
> I was wondering if by any chance you could suggest how to use the 
> ImageViewer class and SeedPicker without the QApplication Class...
> 
> I have been trying to decouple it but have been unsuccessful to setup 
> the Interactor :
> 
>   viewer->SetupInteractor(widget.GetRenderWindow()->GetInteractor());
> 
> Could the class be decoupled from Qapplication and still use VTKWidget?
> 
> Thank you
> 
> Sergio
> 
> On Mon, Mar 23, 2009 at 7:21 AM, Bryn Lloyd <blloyd at vision.ee.ethz.ch 
> <mailto:blloyd at vision.ee.ethz.ch>> wrote:
> 
>     Hi Sergio
> 
> 
>         My question is, I noticed that you write a xxx.txt file of the
>         seeds you select with this application.
> 
>         Do you later on read the seed.txt file in ITK? or can you export
>         the seeds from VTK to ITK?
> 
>         Thank you again.
> 
>         Sergio
> 
> 
>     Well sometimes I might want to read them later. But If you build an
>     application using the ImageViewer class, you can also do the following:
> 
>     say viewer is a ImageViewer, then you can access the seed points
>     like this:
> 
>      SeedPicker *seedpick = viewer->GetSeedPicker();
>      vector<SeedPicker::Index> ind;
>      seedpick->getSeedPoints(ind);
> 
>     Have a look at SeedPicker.h for a definition of the Index struct.
> 
>     bye
>     Bryn
> 
> 
> 


-- 
-------------------------------------------------
Bryn Lloyd
Computer Vision Laboratory
ETH Zürich, Sternwartstrasse 7
CH - 8092 Zürich, Switzerland
Tel: +41 44 63 26668
Fax: +41 44 63 21199
-------------------------------------------------




More information about the vtkusers mailing list