[vtkusers] Where's my Reslice?

Jothy jothybasu at gmail.com
Tue Apr 27 13:27:32 EDT 2010


Hi Scott,

You don't need to use the transform for displaying the sagittal and
coronal views. Just set SetSliceOrientationToYZ &
SetSliceOrientationToXZ and set slice.

Jothy

On Tue, Apr 27, 2010 at 6:20 PM, Scott Johnson
<Scott.Johnson at neuwave.com> wrote:
> 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
>
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>



More information about the vtkusers mailing list