[vtkusers] Slow behaviour of vtkImageReslice

Jothy jothybasu at gmail.com
Mon Feb 14 13:04:17 EST 2011


Hi all,

I am trying to reslice a CT imagedata with vtkImageReslice, but it works
very slow after several slicing.

The code is below

#include "mainwindow.h"

#include "ui_mainwindow.h"

#include<dcmimporter.h>

#include<imagereslicer.h>

 #include<QDebug>

 #include<vtkSmartPointer.h>

#include<vtkImagePlaneWidget.h>

#include<vtkProperty.h>

#include<vtkRenderWindowInteractor.h>

#include<vtkSmartPointer.h>

#include<vtkOutlineFilter.h>

#include<vtkPolyDataMapper.h>

#include<vtkRenderWindow.h>

#include<vtkCellPicker.h>

#include<vtkRenderer.h>

#include<vtkImageMapToColors.h>

#include<vtkImageActor.h>

#include<vtkLookupTable.h>

#include<vtkActor.h>

#include<vtkAxesActor.h>

#include<vtkOrientationMarkerWidget.h>

#include<vtkRenderWindow.h>

#include<vtkInteractorStyleImage.h>

 imageReslicer slicer;

dcmImporter dcm;

 MainWindow::MainWindow(QWidget *parent) :

    QMainWindow(parent),

    ui(new Ui::MainWindow)

{

    ui->setupUi(this);

    ui->mdiArea->tileSubWindows();

 }

 MainWindow::~MainWindow()

{

    delete ui;

}

 void MainWindow::on_actionImport_CT_triggered()

{

     dcm.readImage();

    this->imageData=dcm.imageData;

    ui->AxialScrollBar->setMaximum(dcm.imageDims[2]);

    this->showAxial(50);

}

 void MainWindow::showAxial(int sliceNo)

{

 slicer.sliceImage(this->imageData,sliceNo);

vtkSmartPointer<vtkRenderer> renderer =

    vtkSmartPointer<vtkRenderer>::New();

  renderer->AddActor(slicer.axialSlice);

//  slicer.axialSlice=0;

    this->ui->AxialWidget->GetRenderWindow()->AddRenderer(renderer);

    this->ui->AxialWidget->show();

//    interactor->Start();

 }

 void MainWindow::on_AxialScrollBar_valueChanged(int value)

{

    int scrollValue=this->ui->AxialScrollBar->value();

    qDebug()<<"scrollValue:"<<scrollValue;

    this->showAxial(scrollValue);

}




It seems to be a  problem with the code (memory related).

Thanks very much

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


More information about the vtkusers mailing list