[vtkusers] vtkImageReslice

amit saxena amit_saxena01 at yahoo.com.sg
Sun Mar 4 04:46:45 EST 2001


Hi David,
	Some time back I had sent a query about ImageReslice
class. The problem was that although the class was
working in unix but when it comes to windows it just
gives a blank and the application just hangs. 
        At that time after looking at the code you
suggested me to download the vtk again. I did it and
the problem is still same. The class doesnot seem to
be working at all. 
        I am in a fix because of that problem. I am
sending you the code along. If there is some bug in
vtkImageReslice, then how can we rewrite the image
back to the ImageData class after transforming the
image data directly?

         I am sending the piece of code along :

       vtkVolume16Reader *reader1 =
tkVolume16Reader::New();
         reader1->SetFilePrefix(fileName1[0]);
  reader1->SetHeaderSize(header[0]);
  if (byteSwap)
   reader1->SwapBytesOn();
  reader1->SetImageRange(range[0][0],range[0][1]);
  reader1->SetDataSpacing(space[0][0], space[0][1],
space[0][2]);
         reader1->SetDataDimensions(height[0],
width[0]);
           vtkImageShrink3D *shrink2 =
vtkImageShrink3D::New();
          shrink2->SetInput(reader1->GetOutput());
          shrink2->SetShrinkFactors(1,

1,1.0*(range[0][1]-range[0][0])/(range[1][1]-range[1][0])
);

         vtkImageReslice *reslice1 =
vtkImageReslice::New();
          reslice1->SetInput(reader1->GetOutput());
          reslice1->SetOutputSpacing(1,1,1);
          reslice1->InterpolateOn();
         reslice1->SetInterpolationModeToCubic();
         reslice1->SetResliceTransform(transform);

       vtkImageViewer *viewer1 =
vtkImageViewer::New();
        viewer1->SetInput(reslice1->GetOutput());
        viewer1->SetColorLevel(1000);
        viewer1->SetZSlice(0);

Waiting eagerly for the reply

Amit

 	
 


__________________________________________________
Do You Yahoo!?
Yahoo! Mail – Free email you can access from anywhere!
http://mail.yahoo.com.sg/




More information about the vtkusers mailing list