[vtkusers] orthogonal viewer

jmanjon jmanjon at fis.upv.es
Mon May 6 13:13:35 EDT 2002


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

##########################################################





More information about the vtkusers mailing list