Problems with vtk3.1
Patrick de Koning
patrick at lkeb.azl.nl
Tue Mar 28 01:51:06 EST 2000
Tian-Qing Ye wrote:
>
> Hi
>
> I have an application which was working with vtk2.4.
> Today I have installed the vtk3.1 and recompile my
> application. Then it doesn't work correctly anymore!
>
> With vtk2.4 I have vtkStrucuturedPoints as the
> input for the vtkImageViewer. With vtk3.1 it doesn't
> like the vtkStructuredPoints as input. Ok, I have changed
> it (simplly substituted the vtkStructuredPoints by vtkImageData)
> to use vtkImageData as the input for vtkImageViewer.
> Then I, instead of getting an image, just got a black
> viewer!
>
> My scheme is something like the following:
>
> First created a vtkScalars scalars;
> Then:
> vtkImageData vol->SetDimensions(img.imgsize, img.imgsize, img.imgsize);
> vol->SetOrigin(0., 0., 0.);
> vol->SetSpacing(1.0, 1.0, 1.0);
> vol->GetPointData()->SetScalars(scalars);
> vtkImageViewer viewer->SetInput(vol);
> viewer->SetZSlice(index);
> vtkActor2D *imgActor = viewer->GetActor2D();
> rend->AddActor2D(imgActor);
> renW->Render();
>
> Anyone can kindly point out why it doesn't work anymore?
> As I said, it worked fine with vtk2.4(with StructuredPoints instead of
> ImageData)!
>
I hav had the same problems, and I solved it by inserting the line:
vol->SetUpdateExtent(0, img.imgsize-1, 0, img.imgsize-1, 0,
img.imgsize-1);
Hope it works.
> Thanks!
>
> T. Ye
--------------------------------------------------------------------
Ir. P.J.H. de Koning Leiden University Medical Center
Department of Radiology, C2S Division of Image Processing
P.O. Box 9600 2300 RC LEIDEN
the Netherlands Tel. +31-71-5266206
Fax +31-71-5266801 Email patrick at lkeb.azl.nl
"He who laughs last, thinks slowest"
bumper sticker
--------------------------------------------------------------------
This is the private VTK discussion list. Please keep messages on-topic.
Check the FAQ at: <http://public.kitware.com/cgi-bin/vtkfaq>
To UNSUBSCRIBE, send message body containing "unsubscribe vtkusers" to
<majordomo at public.kitware.com>. For help, send message body containing
"info vtkusers" to the same address.
--------------------------------------------------------------------
More information about the vtkusers
mailing list