<!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.5730.13" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Dear all,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>I've been trying to apply a metric to a couple of
images but I get an arror when getting the value... I just want to calculate the
metric for the images as they are, so I use an Indentity transform. The error
seems to be handled even with a try/catch. I use the review version of the
registration with multithreading...</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Best!</FONT></DIV>
<DIV><FONT face=Arial size=2>David</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>here is the code</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV>
<P><FONT color=#0000ff size=2>try</FONT><FONT size=2>{</P>
<P>MetricSSD::Pointer metricSSD = MetricSSD::New();</P>
<P>Transform::Pointer transform = Transform::New();</P>
<P>Interpolator::Pointer interpolator = Interpolator::New();</P>
<P>transform->SetIdentity(); </P>
<P>MetricSSD::TransformParametersType param = transform->GetParameters();</P>
<P>std::cout<<</FONT><FONT color=#a31515 size=2>"Params to
metric"</FONT><FONT size=2><<param[0]<<</FONT><FONT color=#a31515
size=2>" "</FONT><FONT size=2><<param[1]<<</FONT><FONT color=#a31515
size=2>" "</FONT><FONT size=2><<param[2]<<</FONT><FONT color=#a31515
size=2>" "</FONT><FONT size=2><<param[3]<<</FONT><FONT color=#a31515
size=2>" "</FONT><FONT size=2><<param[4]<<</FONT><FONT color=#a31515
size=2>" "</FONT><FONT size=2><<param[5]<<std::endl;</P>
<P>metricSSD->SetTransform(transform);</P>
<P>metricSSD->SetInterpolator(interpolator);</P>
<P>metricSSD->SetFixedImage(RegisterFactory::SampleToInternal(fixed));</P>
<P>metricSSD->SetMovingImage(RegisterFactory::SampleToInternal(moving));</P>
<P></FONT><FONT size=2>MetricSSD::TransformParametersType
paramT(metricSSD->GetNumberOfParameters());</P>
<P>paramT[0]=param[0];paramT[1]=param[1];paramT[2]=param[2];</P>
<P>paramT[3]=param[3];paramT[4]=param[4];paramT[5]=param[5];</P>
<P></P>
<P></FONT><FONT size=2>mVal = (</FONT><FONT color=#0000ff
size=2>double</FONT><FONT size=2>)metricSSD->GetValue(paramT);</P>
<P></P>
<P></FONT><FONT size=2>std::cout<<</FONT><FONT color=#a31515
size=2>"Pixels counted "</FONT><FONT size=2>
<<metricSSD->GetNumberOfPixelsCounted()<<std::endl;</P>
<P>}</FONT><FONT color=#0000ff size=2>catch</FONT><FONT
size=2>(itk::ExceptionObject &e){</P>
<P>std::cerr<<</FONT><FONT color=#a31515 size=2>"Error"</FONT><FONT
size=2><<std::endl; </P>
<P>std::cerr<<e<<std::endl;</P>
<P>}</P>
<P></P>
<P><FONT face=Arial></FONT> </P></FONT></DIV></BODY></HTML>