<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1106" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>I have a big problem while executing a vtk 
pipieline... I have done my own class and i try to execute it. The problem is 
that before the Write i have the correct number of points in the output but 
after i have no more points and no image. i don't understand why there is an 
error.... I have done some tests that let's me think that the error come from 
the fact i am using the output....</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>If you want more precisions don't hesitate, contact 
me. Below are my files</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>vtkImageInterpolate.h</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#ifndef __VTK_IMAGE_INTERPOLATE_H<BR>#define 
__VTK_IMAGE_INTERPOLATE_H</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#include "vtkPointSet.h"<BR>#include 
"vtkImageSource.h"</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>class VTK_EXPORT vtkImageInterpolate : public 
vtkImageSource {<BR>&nbsp;public:<BR>&nbsp; static vtkImageInterpolate 
*New();<BR>&nbsp; vtkTypeMacro(vtkImageInterpolate, vtkImageSource);<BR>&nbsp; 
void PrintSelf(ostream&amp; os, vtkIndent indent);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; vtkSetMacro(NumberOfXPoints,int);<BR>&nbsp; 
vtkGetMacro(NumberOfXPoints,int);<BR>&nbsp; 
vtkSetMacro(NumberOfYPoints,int);<BR>&nbsp; 
vtkGetMacro(NumberOfYPoints,int);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; vtkSetMacro(DeltaX,int);<BR>&nbsp; 
vtkGetMacro(DeltaX,int);<BR>&nbsp; vtkSetMacro(DeltaY,int);<BR>&nbsp; 
vtkGetMacro(DeltaY,int);<BR>&nbsp; <BR>&nbsp; 
vtkSetMacro(OriginX,float);<BR>&nbsp; vtkGetMacro(OriginX,float);<BR>&nbsp; 
vtkSetMacro(OriginY,float);<BR>&nbsp; vtkGetMacro(OriginY,float);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; void SetInput(vtkPointSet *in);<BR>&nbsp; 
vtkPointSet *GetInput();<BR>&nbsp; void Execute();<BR>&nbsp;protected:<BR>&nbsp; 
vtkImageInterpolate();<BR>&nbsp; virtual ~vtkImageInterpolate();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp; int NumberOfXPoints;<BR>&nbsp; int 
NumberOfYPoints;<BR>&nbsp; int DeltaX;<BR>&nbsp; int DeltaY;<BR>&nbsp; float 
OriginX;<BR>&nbsp; float OriginY;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;private:<BR>&nbsp; vtkImageInterpolate(const 
vtkImageInterpolate&amp;);<BR>&nbsp; operator=(const vtkImageInterpolate 
&amp;);</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>};</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>#endif<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>end of </FONT></DIV>
<DIV><FONT face=Arial size=2><BR>void vtkImageInterpolate::Execute() 
{</FONT></DIV>
<DIV><FONT face=Arial 
size=2>&nbsp;this-&gt;GetOutput()-&gt;SetDimensions(this-&gt;NumberOfXPoints - 
2, this-&gt;NumberOfYPoints - 2, 
1);<BR>&nbsp;this-&gt;GetOutput()-&gt;SetOrigin(pt[1][1].xp, pt[1][1].yp, 
0);<BR>&nbsp;this-&gt;GetOutput()-&gt;SetSpacing(this-&gt;DeltaX, 
this-&gt;DeltaY, 
0);<BR>&nbsp;this-&gt;GetOutput()-&gt;SetScalarTypeToUnsignedChar();</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;for (i = 1; i &lt;= this-&gt;NumberOfXPoints 
- 2; i++) { <BR>&nbsp;&nbsp;for (j = 1; j &lt;= this-&gt;NumberOfYPoints - 2; 
j++) {<BR>&nbsp;&nbsp;&nbsp;unsigned char* pixel = (unsigned char*) 
this-&gt;GetOutput()-&gt;GetScalarPointer(i-1,j-1,0);<BR>&nbsp;&nbsp;&nbsp;*pixel 
= (unsigned char) pt[i][j].zp;<BR>&nbsp;&nbsp;}<BR>&nbsp;}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>and here is my tcl script</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2><FONT size=2>
<P>package require vtklocal</P>
<P>proc read_xyz {data filename delim} {</P>
<P>vtkPoints points</P>
<P>set FILE [open $filename "r"]</P>
<P>while {![eof $FILE]} {</P>
<P>gets $FILE line</P>
<P>set toks [split $line $delim]</P>
<P>#puts $toks</P>
<P>if {[llength $toks] &gt;= 3} {</P>
<P>#puts $toks</P>
<P>points InsertNextPoint [lindex $toks 0] [lindex $toks 1] [lindex $toks 2]</P>
<P>}</P>
<P>}</P>
<P>$data SetPoints points</P>
<P>}</P>
<P>puts "is anyone out there?"</P>
<P>vtkPolyData d</P>
<P>read_xyz d "C:/Documents and Settings/thomas/My 
Documents/thomas/tfe/points.csv" ","</P>
<P>puts [d GetNumberOfPoints]</P>
<P>d Print</P>
<P>vtkImageInterpolate interper</P>
<P>interper SetNumberOfXPoints 1000</P>
<P>interper SetNumberOfYPoints 1000</P>
<P>interper SetOriginX 3703530</P>
<P>interper SetOriginY 486907</P>
<P>interper SetDeltaX 3140</P>
<P>interper SetDeltaY 4259</P>
<P>interper SetInput d</P>
<P>interper Execute</P>
<P>[interper GetOutput] Print</P>
<P>&nbsp;</P>
<P>vtkTIFFWriter w</P>
<P>w SetInput [interper GetOutput]</P>
<P>w SetFileName "plaq.tiff"</P>
<P>puts [[interper GetOutput] GetNumberOfPoints]</P>
<P>w Write</P>
<P>puts [[interper GetOutput] 
GetNumberOfPoints]</P></FONT></DIV></FONT></BODY></HTML>