[vtkusers] orthogonal viewer

Will Schroeder will.schroeder at kitware.com
Mon May 6 13:11:44 EDT 2002


Hello Professor Herrera -

Do not use vtkStructuredPointsGeometryFilter ... you are creating a polygon 
per each pixel. It's much faster to use vtkImageActor, which essentially 
packages up a vtkPlaneSource, vtkPolyDataMapper, vtkTexture, and vtkActor 
to do texture mapping.

Will

At 07:13 PM 5/6/2002 +0200, jmanjon wrote:
>Hi there,
>
>I am trying to do an orthogonal mri 3d viewer and all works fine but the 
>results
>are extremely slow.
>
>I wonder how just showing 3 planes can be so slow.
>
>any idea?
>
>the code is this(data is 256x256x160 bytes):
>
>  vtkStructuredPointsGeometryFilter 
> *plane1=vtkStructuredPointsGeometryFilter::New();
>         plane1->SetInput(data);
>         plane1->SetExtent(0.5*ancho,0.5*ancho,0,alto,0,fuentes);
>
>   vtkPolyDataMapper *m1=vtkPolyDataMapper::New();
>         m1->SetInput(plane1->GetOutput());
>         m1->SetScalarRange(data->GetScalarRange());
>   m1->SetLookupTable(lut);
>
>         vtkActor *a1=vtkActor::New();
>         a1->SetMapper(m1);
>
>   vtkStructuredPointsGeometryFilter 
> *plane2=vtkStructuredPointsGeometryFilter::New();
>         plane2->SetInput(data);
>         plane2->SetExtent(0,ancho,0.5*alto,0.5*alto,0,fuentes);
>
>   vtkPolyDataMapper *m2=vtkPolyDataMapper::New();
>         m2->SetInput(plane2->GetOutput());
>         m2->SetScalarRange(data->GetScalarRange());
>   m2->SetLookupTable(lut);
>
>         vtkActor *a2=vtkActor::New();
>         a2->SetMapper(m2);
>
>
>      vtkStructuredPointsGeometryFilter
>*plane3=vtkStructuredPointsGeometryFilter::New();
>         plane3->SetInput(data);
>         plane3->SetExtent(0,ancho,0,alto,0.5*fuentes,0.5*fuentes);
>
>   vtkPolyDataMapper *m3=vtkPolyDataMapper::New();
>         m3->SetInput(plane3->GetOutput());
>         m3->SetScalarRange(data->GetScalarRange());
>   m3->SetLookupTable(lut);
>
>
>         vtkActor *a3=vtkActor::New();
>         a3->SetMapper(m3);
>
>   vtkOutlineFilter *outline=vtkOutlineFilter::New();
>         outline->SetInput(data);
>         vtkPolyDataMapper *outlineMapper=vtkPolyDataMapper::New();
>         outlineMapper->SetInput(outline->GetOutput());
>         vtkActor *outlineActor=vtkActor::New();
>         outlineActor->SetMapper(outlineMapper);
>         outlineActor->GetProperty()->SetColor(0,0,0);
>
>   this->Renderer->AddActor(a1);
>         this->Renderer->AddActor(a2);
>         this->Renderer->AddActor(a3);
>   this->Renderer->AddActor(outlineActor);
>
>   this->Renderer->SetBackground(1,1,1);
>
>
>jose
>
>##########################################################
>
>         Prof.  Jose Vicente Manjón Herrera
>
>         Dept. Fisica Aplicada
>         Escuela Universitaria de Informatica
>         Universidad Politécnica de Valencia
>
>##########################################################
>
>
>_______________________________________________
>This is the private VTK discussion list.
>Please keep messages on-topic. Check the FAQ at: 
><http://public.kitware.com/cgi-bin/vtkfaq>
>Follow this link to subscribe/unsubscribe:
>http://public.kitware.com/mailman/listinfo/vtkusers




More information about the vtkusers mailing list