[vtkusers] [VtkEdge] trying vtkKWEStructuredGridLIC2D

Rocco Gasteiger post at rocco-gasteiger.de
Tue Feb 17 07:27:30 EST 2009


Hi Fabio,

I've tried vtkKWEStructuredGridLIC2D class by my own and find no bug. Errors
occur only as I give wrong input to this class. I attached my example to
this mail, so you can follow the right connections. The code is not
commented and some lines are not necessary but the rest is quite simple to
understand. You can ignore the code snippets for reading a structured grid.
I generate an example structured grid and add a computed vector field to it.


By the way...the output of vtkKWEStructuredGridLIC2D is a structured grid. 

Hope this is helpful for you.

Best regards, Rocco

 It's a little bit tricky to find the correct input an
-----Original Message-----
From: vtkedge-bounces at vtkedge.org [mailto:vtkedge-bounces at vtkedge.org] On
Behalf Of Fabio Meneghini
Sent: Tuesday, February 17, 2009 12:39 PM
To: vtkedge at vtkedge.org
Subject: Re: [VtkEdge] trying vtkKWEStructuredGridLIC2D

HI,
It becomes to seem there's a bug in the vtkKWEStructuredGridLIC2D class.
In the manual it is written that "The input on port 0 is an
vtkImageData with extents of a 2D image."
But on runtime, I get this error:
"Input for connection index 0 on input port index 0 for algorithm
vtkKWEStructuredGridLIC2D(0x1162290) is of type vtkImageData, but a
vtkStructuredGrid is required."
Furthermore, I still can't understand which output type is returned by
this class, and how to visualize it.
Thanks for the help

Fabio

2009/2/17 Fabio Meneghini <fab.meneghini at gmail.com>:
> Please, correct me if I am wrong, but it seems to me that
> vtkKWEStructuredGridLIC2D gives a vtkStructuredGrid as outputs??
> If this is the case, how am I supposed to render it?
> thanks
>
> Fabio
>
>
> ---------- Forwarded message ----------
> From: Fabio Meneghini <fab.meneghini at gmail.com>
> Date: 2009/2/17
> Subject: trying vtkKWEStructuredGridLIC2D
> To: vtkedge at vtkedge.org
>
>
> Hi, I'm trying to work with the vtkKWEStructuredGridLIC2D class, but I
> got no results. I feel like I screw up something about the
> vtkImageViewer2....Actually I don't know if the following code is
> "conceptually" valid:
>
> Note that piano->GetOutput()  is a vtkImageData (since "piano" is an
> instance of the vtkImageReslice class...)
>
> vtkKWEStructuredGridLIC2D *lic = vtkKWEStructuredGridLIC2D::New();
>       lic->SetInput(piano->GetOutput());
>       lic->SetSteps(40));
>       lic->SetStepSize(0.4));
>       lic->SetMagnification(1));
>
> vtkImageViewer2 *viewer = vtkImageViewer2::New();
>       viewer->SetInputConnection(lic->GetOutputPort());
>
> vtkRenderWindowInteractor *rwi = vtkRenderWindowInteractor::New();
>       viewer->SetupInteractor(rwi);
>       viewer->Render();
>
> The program execution gives me no errors at all, but no Render window
> is neither opened...
> Is there something wrong?
> Any hint will be very appreciated, thanks
>
> Fabio
>
_______________________________________________
VtkEdge mailing list
VtkEdge at vtkedge.org
http://public.kitware.com/cgi-bin/mailman/listinfo/vtkedge
-------------- next part --------------
A non-text attachment was scrubbed...
Name: LICStructuredVTKEdge.zip
Type: application/x-zip-compressed
Size: 3054 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20090217/08936fca/attachment.bin>


More information about the vtkusers mailing list