<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><DIV>Hello </DIV>
<DIV>I need really urgent help, here is my code about pointset to image registration. I comleted ,it seems that everything ok,but when run it i gives <EM>break</EM> or <EM>continue</EM> error. The reason of this code is the lastest line "<SPAN lang=EN-GB style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: DE-AT; mso-bidi-language: AR-SA; mso-no-proof: yes">registrationMethod-&gt;StartRegistration();". <FONT color=#ff0000 size=3>How can understand if the registration works correctly? It seems everthing is ok? Please help me..</FONT></SPAN></DIV>
<DIV><SPAN lang=EN-GB style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-GB; mso-fareast-language: DE-AT; mso-bidi-language: AR-SA; mso-no-proof: yes"></SPAN>Here is my code:</DIV>
<DIV><FONT color=#008000 size=2>
<P>// Registration part</P>
<P>&nbsp;</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> Dimension = 3;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>float</FONT><FONT size=2> PixelType;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::PointSet&lt; PixelType, Dimension &gt; FixedPointSetType;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::Image&lt; PixelType, Dimension &gt; MovingImageType;</P>
<P></P></FONT><FONT color=#0000ff size=2>
<P></FONT><FONT size=2>&nbsp;</P></FONT><FONT color=#0000ff size=2>
<P></FONT><FONT size=2>&nbsp;</P>
<P></P>
<P></FONT><FONT color=#008000 size=2>//-----------------------------------------------------------</P>
<P>// Set up a Transform</P>
<P>//-----------------------------------------------------------</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2> CoordinateRepresentationType;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::TranslationTransform&lt; </P>
<P>CoordinateRepresentationType, </P>
<P>Dimension &gt; TransformType;</P>
<P>TransformType::Pointer transform = TransformType::New();</P>
<P>&nbsp;</P></FONT><FONT color=#008000 size=2>
<P>//------------------------------------------------------------</P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>// Optimizer Type</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::RegularStepGradientDescentOptimizer OptimizerType;</P>
<P>OptimizerType::Pointer optimizer = OptimizerType::New();</P></FONT><FONT color=#008000 size=2>
<P>//-----------------------------------------------------------</P>
<P>// Set up Metric</P>
<P>//-----------------------------------------------------------</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::NormalizedCorrelationPointSetToImageMetric&lt; </P>
<P>FixedPointSetType, </P>
<P>MovingImageType &gt; MetricType;</P>
<P></P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> MetricType::TransformType TransformBaseType;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> TransformBaseType::ParametersType ParametersType;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> TransformBaseType::JacobianType JacobianType;</P>
<P>MetricType::Pointer metric = MetricType::New();</P></FONT><FONT color=#008000 size=2>
<P>//------------------------------------------------------------</P>
<P>// Set up an Interpolator</P>
<P>//------------------------------------------------------------</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::LinearInterpolateImageFunction&lt; </P>
<P>MovingImageType,</P>
<P></FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2> &gt; InterpolatorType;</P>
<P>InterpolatorType::Pointer interpolator = InterpolatorType::New();</P></FONT><FONT color=#008000 size=2>
<P>//------------------------------------------------------------</P>
<P>//RegistrationMethod</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::PointSetToImageRegistrationMethod&lt; </P>
<P>FixedPointSetType,</P>
<P>MovingImageType &gt; RegistrationType;</P>
<P>RegistrationType::Pointer registrationMethod = RegistrationType::New();</P>
<P></FONT><FONT color=#008000 size=2>&nbsp;</P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>// Scale the translation components of the Transform in the Optimizer</P></FONT><FONT size=2>
<P>OptimizerType::ScalesType scales( transform-&gt;GetNumberOfParameters() );</P>
<P>scales.Fill( 1.0 );</P>
<P></FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>long</FONT><FONT size=2> numberOfIterations = 50;</P>
<P></FONT><FONT color=#008000 size=2>//double translationScale = 1.0; // not used</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2> maximumStepLenght = 1.0; </FONT><FONT color=#008000 size=2>// no step will be larger than this</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2> minimumStepLenght = 0.01; </FONT><FONT color=#008000 size=2>// convergence criterion</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>double</FONT><FONT size=2> gradientTolerance = 1e-6; </FONT><FONT color=#008000 size=2>// convergence criterion</P></FONT><FONT size=2>
<P>optimizer-&gt;SetScales( scales );</P>
<P>optimizer-&gt;SetNumberOfIterations( numberOfIterations );</P>
<P>optimizer-&gt;SetMinimumStepLength( minimumStepLenght );</P>
<P>optimizer-&gt;SetMaximumStepLength( maximumStepLenght );</P>
<P>optimizer-&gt;SetGradientMagnitudeTolerance( gradientTolerance );</P>
<P>optimizer-&gt;MinimizeOn();</P>
<P></FONT><FONT color=#008000 size=2>// Start from an Identity transform (in a normal case, the user </P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>// can probably provide a better guess than the identity...</P></FONT><FONT size=2>
<P>transform-&gt;SetIdentity();</P>
<P>registrationMethod-&gt;SetInitialTransformParameters( transform-&gt;GetParameters() );</P>
<P></FONT><FONT color=#008000 size=2>//Reading .RAW dataSet</P></FONT><FONT color=#0000ff size=2>
<P>typedef</FONT><FONT size=2> itk::ImageFileReader&lt; MovingImageType &gt; ReaderType;</P></FONT><FONT color=#0000ff size=2>
<P>typedef</FONT><FONT size=2> itk::RawImageIO&lt;PixelType,Dimension&gt; ImageIOType;</P>
<P>ImageIOType::Pointer RawIO = ImageIOType::New();</P>
<P>ReaderType::Pointer rawreader = ReaderType::New();</P>
<P>rawreader-&gt;SetFileName(filename);</P></FONT><FONT color=#008000 size=2>
<P>// Connect all the components required for Registration</P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>//------------------------------------------------------</P></FONT><FONT size=2>
<P></P>
<P>registrationMethod-&gt;SetMetric( metric );</P>
<P>registrationMethod-&gt;SetOptimizer( optimizer );</P>
<P>registrationMethod-&gt;SetTransform( transform );</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#000000>registrationMethod-&gt;SetFixedPointSet(mesh.GetPointer());</FONT></P></FONT><FONT size=2>
<P>registrationMethod-&gt;SetMovingImage(rawreader-&gt;GetOutput());</P>
<P>registrationMethod-&gt;SetInterpolator(interpolator);</P>
<P></FONT><FONT color=#008000 size=2>//------------------------------------------------------------</P>
<P>// Set up transform parameters</P>
<P>//------------------------------------------------------------</P></FONT><FONT size=2>
<P>ParametersType parameters( transform-&gt;GetNumberOfParameters() );</P></FONT><FONT color=#008000 size=2>
<P>// initialize the offset/vector part</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>for</FONT><FONT size=2>( </FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> k = 0; k &lt;Dimension; k++ )</P>
<P>{</P>
<P>parameters[k]= 0.0f;</P>
<P>}</P>
<P>registrationMethod-&gt;StartRegistration(); //<FONT color=#ff0000 size=4>Here gives break or continue error and it also says:</P>
<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-GB style="mso-ansi-language: EN-GB"><FONT size=3><FONT color=#ff0000>Unhandled exception at 0x7c812a5b in nfinity.exe: Microsoft C++ exception: itk::ExceptionObject at memory location 0x0012ea7c..<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></FONT></FONT></SPAN></P></FONT></FONT></DIV></div><br>

<hr size=1>Be a PS3 game guru.<br>Get your game face on with <a href="http://us.rd.yahoo.com/evt=49936/*http://videogames.yahoo.com">the latest PS3 news and previews at Yahoo! Games.</a></body></html>