[vtkusers] Image Orientation +vtkImageActor

Mohamed Ben Reguiga breguiga_mh at yahoo.fr
Mon May 29 04:54:34 EDT 2006


hello every one,
I'm begining using VTK in my project in Qt and I have a little problem,
I used a vtkStructuredPoints for rendring images and I want to implement a multiplanar reconstitution to visualize slices in the 3 three axes (X,Y,Z).
for that I used , like in the exemple medical3.cxx, vtkImageActor,vtkLoohupTable and the vtkImageMapToColor, and every thing goes alright for the images following the Axe Z but for the other axes something wrong happens : the image is displayed right in the renderer but when I recover the buffer of that image to create mine, because I use a QGLWidget (of Qt) to visualize the images and the vtkRenderWindow just for testing the result, I guess that the diemensoions of the image that I create are wrongs but I'm not sue.
this is some lines of the code I use for the axial image (following the X axe).
 data2=vtkStructuredPoints::New();
  data2->SetDimensions(width_Vol,Height_Vol,Dpth_Vol);                    
  data2->SetSpacing (Xsp, Ysp, Zsp);
  data2->SetScalarType(VTK_UNSIGNED_SHORT);
  data2->AllocateScalars();
..... Rendering....
hueLut = vtkLookupTable::New();
    hueLut->SetTableRange (0, 2000);
    hueLut->SetHueRange (0, 0);
    hueLut->SetSaturationRange (0,0);
    hueLut->SetValueRange (0, 1);
    hueLut->Build(); 
 axialColors = vtkImageMapToColors::New();
    axialColors->SetInput(data2);
    axialColors->SetLookupTable(hueLut);
 axial = vtkImageActor::New();
    axial->SetInput(axialColors->GetOutput());
 axial->SetDisplayExtent(150,150, 0,Height_Vol, 0,Dpth_Vol); // the slice number 150 //X
//Creation of the Qt Image 
int dims[3];
  axialColors ->GetOutput()->GetDimensions(dims); 
  int Img_width = dims[2];
  int Img_height0 = dims[1];
  QImage *myImgZ=new QImage((uchar*)(axialColors ->GetOutput()->GetScalarPointer()), 
                    Img_width,Img_height0,
        32,
        curCWdgImg->myCDicom->getColorTable(),256,
        QImage::IgnoreEndian);
 
so How can specify that the Image I want, has to  follow that Axe or the other (something like : SetPlaneOrientation (Orientaion)  ????);
thank you for your help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20060529/88c58c84/attachment.htm>


More information about the vtkusers mailing list