[vtkusers] help

Fabian Graefe graefe at ifr.ing.tu-bs.de
Thu May 13 09:33:27 EDT 2004


Hi there,

i am trying to reproduce a simple example your posted in your 2nd Ed. 
Book ( also using theis SW Ver)
I Tried like this:

     vtkImageViewer    *z_view            = vtkImageViewer::New();
     vtkImageCache    *z_imcche        = vtkImageCache::New();
     vtkImageRegion    *z_imreg        = vtkImageRegion::New();

     z_imcche->SetWholeExtent(0,255,0,255,0,0,0,0);
     z_imcche->SetUpdateExtent(0,255,0,255,0,0,0,0);
     z_imcche->SetScalarTypeToFloat();
     z_imreg = z_imcche->GetScalarRegion();


         int j = 0;
         float *zC_ptr = 0;

     for(int i = 0; i < 256; i++)
     {
      for(j = 0; j < 256; j++)
      {
       zC_ptr  = (float*)z_imreg->GetScalarPointer(j,i,0,0);
       *zC_ptr = (float)128*(sin(i/10)+cos(j/10));
      }
     }
     z_imreg->Delete();
     z_view->SetInput(z_imcche);

     z_view->Render();

What is wrong?

Yours

Fabian Graefe
-- 
Fabian Graefe

IFR - Institut fuer Regelungstechnik
TU Braunschweig
Hans-Sommer Strasse 66
38106 Braunschweig			
Tel.: +49 (0) 531 391 3831
Fax.: +49 (0) 531 391 5194

Email.: graefe at ifr.ing.tu-bs.de
http://www.ifr.ing.tu-bs.de		




More information about the vtkusers mailing list