<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7652.24">
<TITLE>Problem connecting vtkImageData with vtImageWrapPad in VTK 5.0</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->

<P><FONT FACE="Times New Roman">Hi vtkusers</FONT>
</P>

<P><FONT FACE="Times New Roman">I'm updating a vtk-application from version 4.2 to 5.0 and I'm having some problems connecting&nbsp; an instance of vtkImageData with an instance of vtkImageWrapPad in VTK 5.0.&nbsp; 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.</FONT></P>

<P><FONT FACE="Times New Roman">After Reading a VTK-file (with Dataset Format structured points)&nbsp; 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)</FONT></P>

<P><FONT FACE="Times New Roman">vtkStructuredPointsReader reader</FONT>

<BR><FONT FACE="Times New Roman">reader SetFileName &quot;/data/home/vm/Documents/extractedConcentration.vtk&quot;</FONT>

<BR><FONT FACE="Times New Roman">reader UpdateWholeExtent</FONT>
</P>

<P><FONT FACE="Times New Roman">vtkExtractVOI extractPlane</FONT>

<BR><FONT FACE="Times New Roman">&nbsp; #extractPlane DebugOn</FONT>

<BR><FONT FACE="Times New Roman">&nbsp; extractPlane SetInput [reader GetOutput]</FONT>

<BR><FONT FACE="Times New Roman">&nbsp; extractPlane SetVOI 0 201 0 201 1 1</FONT>

<BR><FONT FACE="Times New Roman">&nbsp; extractPlane UpdateWholeExtent</FONT>
</P>

<P><FONT FACE="Times New Roman">vtkImageData imagePlane</FONT>

<BR><FONT FACE="Times New Roman">imagePlane SetDimensions 200 200 1</FONT>

<BR><FONT FACE="Times New Roman">[imagePlane GetPointData] SetScalars [[[extractPlane GetOutput] GetCellData] GetScalars]</FONT>
</P>

<P><FONT FACE="Times New Roman">&nbsp;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.</FONT></P>

<P><FONT FACE="Times New Roman">&nbsp;vtkImageWrapPad imageWrap</FONT>

<BR><FONT FACE="Times New Roman">&nbsp; imageWrap SetInput imagePlane</FONT>

<BR><FONT FACE="Times New Roman">&nbsp; #imageWrap SetOutputWholeExtent 0 [expr $power2x - 1] 0 [expr $power2y - 1] 0 0</FONT>

<BR><FONT FACE="Times New Roman">&nbsp; imageWrap UpdateWholeExtent</FONT>
</P>

<P><FONT FACE="Times New Roman">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 )</FONT></P>

<P><FONT FACE="Times New Roman">vtkImageMagnify mag</FONT>

<BR><FONT FACE="Times New Roman">&nbsp;mag SetInput ImagePlane</FONT>

<BR><FONT FACE="Times New Roman">&nbsp;mag SetMagnificationFactors 1 1 1</FONT>

<BR><FONT FACE="Times New Roman">&nbsp;mag UpdateWholeExtent</FONT>
</P>

<P><FONT FACE="Times New Roman">vtkImageWrapPad imageWrap</FONT>

<BR><FONT FACE="Times New Roman">&nbsp; imageWrap SetInput [mag GetOutput]</FONT>

<BR><FONT FACE="Times New Roman">&nbsp; #imageWrap SetOutputWholeExtent 0 [expr $power2x - 1] 0 [expr $power2y - 1] 0 0</FONT>

<BR><FONT FACE="Times New Roman">&nbsp; imageWrap UpdateWholeExtent</FONT>

<BR><FONT FACE="Times New Roman">&nbsp;</FONT>

<BR><FONT FACE="Times New Roman">But it also only worked as expected on VTK 4.2.&nbsp; 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&nbsp; 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).</FONT></P>

<P><FONT FACE="Times New Roman">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? </FONT></P>

<P><FONT FACE="Times New Roman">Thanks for any help!</FONT>
</P>

<P><FONT FACE="Times New Roman">Alejandro</FONT> 
</P>
<BR>

<p></p><FONT face=Tahoma size=2> <FONT color=#0000ff>  <P>   <FONT face=Arial color=#000000 size=1>CONFIDENTIALITY NOTICE <BR></FONT>   <FONT face=Arial color=#000000 size=1>The information in this email may be confidential and/or privileged.<BR></FONT>   <FONT face=Arial color=#000000 size=1>This email is intended to be reviewed by only the addressee(s) named<BR></FONT>   <FONT face=Arial color=#000000 size=1>above. If you are not the intended recipient, you are hereby notified<BR></FONT>   <FONT face=Arial color=#000000 size=1>that any review, dissemination, copying, use or storage of this email<BR></FONT>   <FONT face=Arial color=#000000 size=1>and its attachments, if any, or the information contained herein is<BR></FONT>   <FONT face=Arial color=#000000 size=1>prohibited. If you have received this email in error, please<BR></FONT>   <FONT face=Arial color=#000000 size=1>immediately notify the sender by return email and delete this email<BR></FONT>   <FONT face=Arial color=#000000 size=1>from your system. Thank you.<BR></FONT>   </FONT>  </P> </FONT></FONT></BODY>
</HTML>