[vtkusers] Problem connecting vtkImageData with vtImageWrapPad in VTK 5.0

Merchan, Alejandro Alejandro.Merchan at sulzer.com
Mon May 26 12:37:42 EDT 2008


Hi vtkusers

I'm updating a vtk-application from version 4.2 to 5.0 and I'm having
some problems connecting  an instance of vtkImageData with an instance
of vtkImageWrapPad in VTK 5.0.  VTK 5.0 does accept my vtkImageData as
Input and does not complain about it, anyhow it produces a different
result than VTK 4.2. I could not load the whole Example because it was
bigger than 100 KB.

After Reading a VTK-file (with Dataset Format structured points)  I
extract a Volume of Interest with extractPlane (an instance of
vtkExtractVOI) and set some scalars of it to an instance of
vtkImageData. (I used SetInputConnection and GetOutputPort for VTK 5.0)

vtkStructuredPointsReader reader
reader SetFileName "/data/home/vm/Documents/extractedConcentration.vtk"
reader UpdateWholeExtent

vtkExtractVOI extractPlane
  #extractPlane DebugOn
  extractPlane SetInput [reader GetOutput]
  extractPlane SetVOI 0 201 0 201 1 1
  extractPlane UpdateWholeExtent

vtkImageData imagePlane
imagePlane SetDimensions 200 200 1
[imagePlane GetPointData] SetScalars [[[extractPlane GetOutput]
GetCellData] GetScalars]

 Till this point everything works fine and both VTK 4.2 and 5.0 produce
the same results. The problem appears in the next step when passing
imagePlane as input to an instance of vtkImageWrapPad.

 vtkImageWrapPad imageWrap
  imageWrap SetInput imagePlane
  #imageWrap SetOutputWholeExtent 0 [expr $power2x - 1] 0 [expr $power2y
- 1] 0 0
  imageWrap UpdateWholeExtent

Since imagePlane as an instance of vtkImageData does not have an output
or outputport directly I try to pass it to imageWrap using the SetInput
method just like it worked on our program with VTK 4.2 . VTK 5.0
actually accepts this and does not complain about it, however it
produces a different result than VTK 4.2 does. Since I saw on the
examples of VTK that imageWrap should be actually used with
SetInputConnection and GetOuputPort I tried passing imagePlane to other
graphic Filters bevor passing it to vtkImageWrapPad ( For example here
VTK 4 syntax )

vtkImageMagnify mag
 mag SetInput ImagePlane
 mag SetMagnificationFactors 1 1 1
 mag UpdateWholeExtent

vtkImageWrapPad imageWrap
  imageWrap SetInput [mag GetOutput]
  #imageWrap SetOutputWholeExtent 0 [expr $power2x - 1] 0 [expr $power2y
- 1] 0 0
  imageWrap UpdateWholeExtent
 
But it also only worked as expected on VTK 4.2.  The only solution that
actually kind of worked was writing imagePlane (vtkImageData) in a
temporary file with vtkStructuredPointsWriter and passing the Output of
a vtkStructuredPointsReader (which reads the file produced by
vtkStructuredPointsWriter) to vtkImageWrapPad. It worked in such a way,
that  the right image is shown well in the render Window, but it changes
the behaviour of my programm, so that other function which are based on
the Output of vtkImageWrapPad are not working anymore (neither on vtk
4.2 nor in 5.0).

Has anybody of you had such kind of problems?. Isn't it possible anymore
to connect a vtkImageData with vtkImageWrapPad directly so that it just
works the way it did in VTK 4.2? 

Thanks for any help!

Alejandro 




CONFIDENTIALITY NOTICE
The information in this email may be confidential and/or privileged. 
This email is intended to be reviewed by only the addressee(s) named 
above. If you are not the intended recipient, you are hereby notified 
that any review, dissemination, copying, use or storage of this email 
and its attachments, if any, or the information contained herein is 
prohibited. If you have received this email in error, please 
immediately notify the sender by return email and delete this email 
from your system. Thank you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080526/dba2a13f/attachment.htm>


More information about the vtkusers mailing list