[vtkusers] Help! Reslice program problem

Arsene ELLA ella at pet.mpin-koeln.mpg.de
Thu Mar 7 08:42:57 EST 2002


Hi everybody,

I have transformed the Tcl IMAGE RESLICE example in the VTK40 user guide book
page 135 to a Visual C++6 console program as following:

___________________________________

// RESLICE.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"

#include "vtkImageReader.h"
#include "vtkTransform.h"
#include "vtkImageReslice.h"
#include "vtkImageViewer.h"
#include "vtkRenderer.h"


int main(int argc, char* argv[])
{
  // Image pipeline
  vtkImageReader *reader;
  reader = vtkImageReader::New();
  reader->ReleaseDataFlagOff();
  reader->SetDataByteOrderToLittleEndian();
  reader->SetDataExtent(0, 63, 0, 63, 1, 93);
  reader->SetDataOrigin(-32.5, -32.5, -47);
  reader->SetFilePrefix("C:\\Program 
Files\\VTK40\\VTKData\\Data\\headsq\\quarter");
  reader->SetDataMask(0x7fff);
  reader->Update();

// Transform
  vtkTransform *transform;
  transform = vtkTransform::New();
  transform->RotateX(10);
  transform->RotateY(20);
  transform->RotateZ(30);

// Reslice
  vtkImageReslice *reslice;
  reslice = vtkImageReslice::New();
  reslice->SetInput(reader->GetOutput());
  reslice->SetResliceTransform(transform);
  reslice->InterpolateOn();
  reslice->SetBackgroundLevel(1023);

// Viewer
  vtkImageViewer *viewer;
  viewer = vtkImageViewer::New();
  viewer->SetInput(reslice->GetOutput());
  viewer->SetZSlice(120);
  viewer->SetColorWindow(2000);
  viewer->SetColorLevel(1000);
  viewer->SetSize(800, 800);
  viewer->Render();

// Free th Memory
  reader->Delete();
  transform->Delete();
  reslice->Delete();
  viewer->Delete();


  return 0;
}


___________________________________

the program is compiled and executed without any error message, but I have 
nothing
in the window!!!

Could somebody please tell me where is the mistake.

Thanks in advance,

Arsene



Arsene ELLA, PhD
Max-Planck Institut Für Neurogische Forschung
Gleueler str, 50
D-50931 Cologne
GERMANY
Tel:   (+49) 221 478 5713
Mob: (+49) 174 320 7881
Fax:  (+49) 221 478 7256




More information about the vtkusers mailing list