<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-2">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Please help me with this:</FONT></DIV>
<DIV><FONT face=Arial size=2>I get these error messages, when I'm linking
application under Borland.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2> [Linker Error] Unresolved external
'vtkThinPlateSplineTransform::New()' referenced from C:\PROGRAM
FILES\BORLAND\CBUILDER6\PROJECTS\WARP\UNIT1.OBJ<BR> [Linker Error]
Unresolved external 'vtkThinPlateSplineTransform::SetSourceLandmarks(vtkPoints
*)' referenced from C:\PROGRAM
FILES\BORLAND\CBUILDER6\PROJECTS\WARP\UNIT1.OBJ<BR> [Linker Error]
Unresolved external 'vtkThinPlateSplineTransform::SetTargetLandmarks(vtkPoints
*)' referenced from C:\PROGRAM
FILES\BORLAND\CBUILDER6\PROJECTS\WARP\UNIT1.OBJ<BR> [Linker Error]
Unresolved external 'vtkThinPlateSplineTransform::SetBasis(int)' referenced from
C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\WARP\UNIT1.OBJ<BR> [Linker
Error] Unresolved external 'vtkTransformToGrid::New()' referenced from
C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\WARP\UNIT1.OBJ<BR> [Linker
Error] Unresolved external 'vtkGridTransform::New()' referenced from C:\PROGRAM
FILES\BORLAND\CBUILDER6\PROJECTS\WARP\UNIT1.OBJ<BR> [Linker Error]
Unresolved external 'vtkGridTransform::SetInterpolationMode(int)' referenced
from C:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\WARP\UNIT1.OBJ<BR></DIV></FONT>
<DIV><FONT face=Arial size=2>Where is the problem please?</FONT></DIV>
<DIV><FONT face=Arial size=2>Thanks, Radim</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>Here is my simple code:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>//---------------------------------------------------------------------------<BR>#include
"vtkPolyData.h"<BR>#include "vtkTransform.h"<BR>#include
"vtkTransformPolyDataFilter.h"<BR>#include "vtkWarpScalar.h"<BR>#include
"vtkBMPReader.h"<BR>#include "vtkImageReslice.h"<BR>#include
"vtkGridTransform.h"<BR>#include "vtkTransformToGrid.h"<BR>#include
"vtkThinPlateSplineTransform.h"<BR>#include "vtkPoints.h"<BR>#include
"vtkImageBlend.h"<BR>#include "vtkImageMapToColors.h"<BR>#include
"vtkLookupTable.h"<BR>#include "vtkImageGridSource.h"<BR>#include
"vtkImageViewer.h"</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>#include <stdio.h><BR>#include
<vcl.h><BR>#pragma hdrstop</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial
size=2>//---------------------------------------------------------------------------</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>#pragma argsused<BR>int main(int argc, char*
argv[])<BR>{<BR> //# first, create an
image to warp<BR> vtkImageGridSource
*imageGrid =
vtkImageGridSource::New();<BR>
imageGrid->SetGridSpacing( 16, 16,
0);<BR>
imageGrid->SetGridOrigin( 0, 0, 0
);<BR>
imageGrid->SetDataExtent( 0, 255, 0, 255, 0,
0);<BR>
imageGrid->SetDataScalarTypeToUnsignedChar();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
vtkLookupTable *table =
vtkLookupTable::New();<BR>
table->SetTableRange( 0, 1
);<BR>
table->SetValueRange( 1.0,
0.0);<BR>
table->SetSaturationRange( 0.0,
0.0);<BR>
table->SetHueRange( 0.0, 0.0
);<BR>
table->SetAlphaRange( 0.0, 1.0
);<BR>
table->Build();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
vtkImageMapToColors *alpha =
vtkImageMapToColors::New();<BR>
alpha->SetInput( imageGrid->GetOutput()
);<BR>
alpha->SetLookupTable( table );</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
vtkBMPReader *reader1 =
vtkBMPReader::New();<BR>
reader1->SetFileName( "c:/Data/Retina/3D/105939/L/105939l000.bmp"
);</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
vtkImageBlend *blend =
vtkImageBlend::New();<BR>
blend->SetInput( 0, reader1->GetOutput()
);<BR>
blend->SetInput( 1, alpha->GetOutput() );</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>//# next, create a ThinPlateSpline
transform</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
vtkPoints
*p1=vtkPoints::New();<BR>
p1->SetNumberOfPoints( 8
);<BR>
p1->SetPoint( 0, 0, 0, 0
);<BR>
p1->SetPoint( 1, 0, 255,
0);<BR>
p1->SetPoint( 2, 255, 0, 0
);<BR>
p1->SetPoint( 3, 255, 255, 0
);<BR>
p1->SetPoint( 4, 96, 96, 0
);<BR>
p1->SetPoint( 5, 96, 159, 0
);<BR>
p1->SetPoint( 6, 159, 159, 0
);<BR>
p1->SetPoint( 7, 159, 96, 0 );</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2>
vtkPoints
*p2=vtkPoints::New();<BR>
p2->SetNumberOfPoints( 8
);<BR>
p2->SetPoint( 0, 0, 0, 0
);<BR>
p2->SetPoint( 1, 0, 255,
0);<BR>
p2->SetPoint( 2, 255, 0, 0
);<BR>
p2->SetPoint( 3, 255, 255, 0
);<BR>
p2->SetPoint( 7, 96, 96, 0
);<BR>
p2->SetPoint( 5, 96, 159, 0
);<BR>
p2->SetPoint( 5, 159, 159, 0
);<BR>
p2->SetPoint( 6, 159, 96, 0 );</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV><FONT face=Arial size=2>
<DIV><BR> vtkThinPlateSplineTransform
*thinPlate =
vtkThinPlateSplineTransform::New();<BR>
thinPlate->SetSourceLandmarks( p2
);<BR>
thinPlate->SetTargetLandmarks( p1
);<BR>
thinPlate->SetBasisToR2LogR();</DIV>
<DIV> </DIV>
<DIV>//# convert the thin plate spline into a grid</DIV>
<DIV> </DIV>
<DIV> vtkTransformToGrid
*transformToGrid =
vtkTransformToGrid::New();<BR>
transformToGrid->SetInput( thinPlate
);<BR>
transformToGrid->SetGridSpacing( 16, 16, 1
);<BR>
transformToGrid->SetGridOrigin( -0.5, -0.5, 0
);<BR>
transformToGrid->SetGridExtent(0, 16, 0, 16, 0, 0);</DIV>
<DIV> </DIV>
<DIV> vtkGridTransform *transform =
vtkGridTransform::New();<BR>
transform->SetDisplacementGrid( transformToGrid->GetOutput()
);<BR>
transform->SetInterpolationModeToCubic();</DIV>
<DIV> </DIV>
<DIV> //# you must invert the
transform before passing it to
vtkImageReslice<BR>
transform->Inverse();</DIV>
<DIV> </DIV>
<DIV>//# apply the grid warp to the image</DIV>
<DIV> </DIV>
<DIV> vtkImageReslice *reslice =
vtkImageReslice::New();<BR>
reslice->SetInput( blend->GetOutput()
);<BR>
reslice->SetResliceTransform( transform
);<BR>
reslice->SetInterpolationModeToLinear();</DIV>
<DIV> </DIV>
<DIV>//# set the window/level to 255.0/127.5 to view full
range<BR> vtkImageViewer *viewer =
vtkImageViewer::New();<BR>
viewer->SetInput( reslice->GetOutput()
);<BR>
viewer->SetColorWindow( 255.0
);<BR>
viewer->SetColorLevel( 127.5
);<BR>
viewer->SetZSlice( 0
);<BR>
viewer->Render();<BR>
getchar();</DIV>
<DIV> </DIV>
<DIV><BR> return
0;<BR>}<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>======================================================<BR>Department of
Biomedical Engineering<BR>Faculty of Electrical Engineering and
Communication<BR>Brno University of Technology<BR>Purkynova 118<BR>61200 Brno,
Czech Republic<BR>tel: 541 149 551<BR>fax: 541 149 542<BR>mail: <A
href="mailto:kolarr@feec.vutbr.cz">kolarr@feec.vutbr.cz</A><BR>Visit BIOSIGNAL
2004 web site: <A
href="http://www.feec.vutbr.cz/UBMI/bs2004.html">http://www.feec.vutbr.cz/UBMI/bs2004.html</A><BR>======================================================</FONT></DIV></BODY></HTML>