[vtkusers] Where's my Reslice?

Scott Johnson Scott.Johnson at neuwave.com
Tue Apr 27 13:20:08 EDT 2010


Hi Folks,

 

I'm trying to display image planes in a vtkImageViewer2 without much
luck.  My current pipeline looks like:

 

                                                    vtkTransform

                                                                |

                                                                V

vtkDICOMImageReader->vtkImageReslice->vtkImageViewer2

 

If I try to display an Axial slice, it works fine, if I try to display
sagittal or coronal slices I don't see the images.  If I insert a
vtkImageChangeInformation object after the vtkDICOMImageReader, I can
see the sagittal and coronal images as well as the axial.  This causes a
problem because I am trying to coordinate other displays with the
resliced result.  I need to see the images without using the
vtkImageChangeInformation object.

 

I've tried to explicitly set the bounds on the vtkImageActor managed by
the vtkImageViewer2, with no luck.  I've also tried to place the
vtkCamera to point at the center of the plane along the direction of the
normal.  Didn't work either.

 

There may be a fundamental misunderstanding on my part as to how
vtkImageReslice works.  I am assuming that the resulting resliced volume
would be displayed the same as an axial image, so I am leaving the
vtkImageViewer2->SetSliceOrientationXY() and moving between slices with
the SetSlice method.

 

The eventual goal is to reslice the image volume at oblique angles, but
I figure I'm on the right track if I can get the sagittal and coronal
images to display correctly.

 

I'm concerned that vtkImageViewer2 is doing something for me that I
don't want it to do.  Do I need to manage my own vtkImageActor?

 

A code snippet for the Coronal images follows:

(input is the vtkDICOMImageReader)

 

 

    _transform = vtkTransform::New();

    _transform->RotateZ(0.0);

    _transform->RotateX(90.0);

    _transform->RotateY(0.0);

 

    _reslice = vtkImageReslice::New();

    _reslice->SetOutputDimensionality(3);

    _reslice->SetResliceTransform(_transform);

    _reslice->SetInputConnection(input);

    _reslice->Update();

 

    inputData=vtkImageData::SafeDownCast(_reslice->GetInput());

    inputData->GetCenter(center);

    _transform->Translate(center[0], center[1], center[2]);

 

    _interactor = vtkRenderWindowInteractor::New();

 

    _imageViewer = vtkImageViewer2::New();

    _imageViewer->SetupInteractor(_interactor);

    _imageViewer->SetSize(400, 400);

    _imageViewer->SetColorWindow(1024);

    _imageViewer->SetColorLevel(800);

    _imageViewer->SetInputConnection(_reslice->GetOutputPort());

 

Any ideas appreciated.

 

Thanks

 

                                -- Scott

 

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


More information about the vtkusers mailing list