<!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> </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> </DIV>
<DIV><FONT face=Arial size=2></FONT><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>vtkImageInterpolate.h</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>#ifndef __VTK_IMAGE_INTERPOLATE_H<BR>#define
__VTK_IMAGE_INTERPOLATE_H</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>#include "vtkPointSet.h"<BR>#include
"vtkImageSource.h"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>class VTK_EXPORT vtkImageInterpolate : public
vtkImageSource {<BR> public:<BR> static vtkImageInterpolate
*New();<BR> vtkTypeMacro(vtkImageInterpolate, vtkImageSource);<BR>
void PrintSelf(ostream& os, vtkIndent indent);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> vtkSetMacro(NumberOfXPoints,int);<BR>
vtkGetMacro(NumberOfXPoints,int);<BR>
vtkSetMacro(NumberOfYPoints,int);<BR>
vtkGetMacro(NumberOfYPoints,int);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> vtkSetMacro(DeltaX,int);<BR>
vtkGetMacro(DeltaX,int);<BR> vtkSetMacro(DeltaY,int);<BR>
vtkGetMacro(DeltaY,int);<BR> <BR>
vtkSetMacro(OriginX,float);<BR> vtkGetMacro(OriginX,float);<BR>
vtkSetMacro(OriginY,float);<BR> vtkGetMacro(OriginY,float);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> void SetInput(vtkPointSet *in);<BR>
vtkPointSet *GetInput();<BR> void Execute();<BR> protected:<BR>
vtkImageInterpolate();<BR> virtual ~vtkImageInterpolate();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> int NumberOfXPoints;<BR> int
NumberOfYPoints;<BR> int DeltaX;<BR> int DeltaY;<BR> float
OriginX;<BR> float OriginY;</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> private:<BR> vtkImageInterpolate(const
vtkImageInterpolate&);<BR> operator=(const vtkImageInterpolate
&);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>};</FONT></DIV>
<DIV> </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> this->GetOutput()->SetDimensions(this->NumberOfXPoints -
2, this->NumberOfYPoints - 2,
1);<BR> this->GetOutput()->SetOrigin(pt[1][1].xp, pt[1][1].yp,
0);<BR> this->GetOutput()->SetSpacing(this->DeltaX,
this->DeltaY,
0);<BR> this->GetOutput()->SetScalarTypeToUnsignedChar();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2> for (i = 1; i <= this->NumberOfXPoints
- 2; i++) { <BR> for (j = 1; j <= this->NumberOfYPoints - 2;
j++) {<BR> unsigned char* pixel = (unsigned char*)
this->GetOutput()->GetScalarPointer(i-1,j-1,0);<BR> *pixel
= (unsigned char) pt[i][j].zp;<BR> }<BR> }</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>and here is my tcl script</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </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] >= 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> </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>