<span class="gmail_quote"><br></span>Hi Luis,<br><br>I read about your lectures about registration and want to plot the metric. There is an error&nbsp; :(&nbsp; What&#39;s wrong?<br><br>error LNK2001: Nichtaufgeloestes externes Symbol &quot;protected: virtual void __thiscall itk::CostFunction::PrintSelf(class std::basic_ostream&lt;char,struct std::char_traits&lt;char&gt; &gt; &amp;,class itk::Indent)const &quot; (?PrintSelf@CostFunction@itk@@MBEXAAV?$basic_ostream@DU?$char_traits@D@std@@@std@@VIndent@2@@Z)<br>

<br><br>I add ITKCommon and ITKIO in the library<br>TARGET_LINK_LIBRARIES(HelloWorld ITKCommon ITKIO)<br><br>--program--<br><br>#include &quot;itkImage.h&quot;<br>#include &quot;itkImageFileReader.h&quot;<br>#include &quot;itkMeanSquaresImageToImageMetric.h&quot;<br>

#include &quot;itkMattesMutualInformationImageToImageMetric.h&quot;<br>#include &quot;itkLinearInterpolateImageFunction.h&quot;<br>#include &quot;itkTranslationTransform.h&quot;<br>#include &lt;iostream&gt;<br><br>int main()<br>

{<br>&nbsp;&nbsp;&nbsp; const&nbsp;&nbsp;&nbsp; unsigned int&nbsp;&nbsp;&nbsp; ImageDimension = 2;<br>&nbsp;&nbsp;&nbsp; typedef&nbsp; unsigned char&nbsp;&nbsp; PixelType;<br>&nbsp;&nbsp;&nbsp; typedef itk::Image&lt; PixelType, ImageDimension &gt;&nbsp;&nbsp; ImageType;<br>&nbsp;&nbsp;&nbsp; typedef itk::ImageFileReader&lt; ImageType &gt;&nbsp; ReaderType;<br>

<br>&nbsp;&nbsp;&nbsp; ReaderType::Pointer ImageReader = ReaderType::New();<br>&nbsp;&nbsp;&nbsp; ImageReader-&gt;SetFileName( &quot;leber1.TIF&quot;);<br>&nbsp;&nbsp;&nbsp; ImageReader-&gt;Update();<br>&nbsp;&nbsp;&nbsp; ImageType::Pointer input = ImageReader-&gt;GetOutput();<br>

<br>&nbsp;&nbsp;&nbsp; typedef itk::LinearInterpolateImageFunction&lt; ImageType, double &gt; InterpolatorType;<br>&nbsp;&nbsp;&nbsp; InterpolatorType::Pointer interpolator = InterpolatorType::New();<br><br><br>&nbsp;&nbsp;&nbsp; typedef itk::TranslationTransform&lt; double, ImageDimension &gt;&nbsp; TransformType;<br>

&nbsp;&nbsp;&nbsp; TransformType::Pointer transform = TransformType::New();<br><br>&nbsp;&nbsp;&nbsp; typedef itk::MeanSquaresImageToImageMetric&lt; ImageType, ImageType &gt;&nbsp; MetricType;<br>&nbsp;&nbsp;&nbsp; MetricType::Pointer metric = MetricType::New();<br><br>
&nbsp;&nbsp;&nbsp; metric-&gt;SetInterpolator( interpolator );<br>
&nbsp;&nbsp;&nbsp; metric-&gt;SetTransform( transform );<br><br>&nbsp;&nbsp;&nbsp; metric-&gt;SetFixedImage(&nbsp; input&nbsp; );<br>&nbsp;&nbsp;&nbsp; metric-&gt;SetMovingImage( input );<br><br>&nbsp;&nbsp;&nbsp; MetricType::TransformParametersType translation( ImageDimension );<br><br>&nbsp;&nbsp;&nbsp; double value[21][21];<br>

<br>&nbsp;&nbsp;&nbsp; for( int dx = 0; dx &lt;= 20; dx++) <br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; for( int dy = 0; dy &lt;= 20; dy++)<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; translation[0] = dx;<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; translation[1] = dy;<br><br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; value[dx][dy] = metric-&gt;GetValue( translation );<br>

&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; }<br><br>}<br><br><br>Thanks and have nice weekend!<br><br>Sophie<br>