<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:14pt"><DIV>hello Luis;</DIV>
<DIV>I prepared following code to resampling moving image after the implementation of Point set to image registration. Could you please check it for me,Is there a logic situation problem?</DIV>
<DIV>.</DIV>
<DIV>.</DIV>
<DIV>.</DIV>
<DIV><FONT size=2>TransformType::Pointer finalTransform = TransformType::New();</DIV>
<DIV>
<P>finalTransform->SetParameters( finalParameters );</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>char</FONT><FONT size=2> OutputPixelType;</P></FONT><FONT color=#008000 size=2>
<P> <FONT color=#000000>typedef itk::Image< MovingImageType, Dimension > MovingImageType;</FONT></P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::Image< OutputPixelType, Dimension > OutputImageType;</P>
<P></P>
<P> </P>
<P> </P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::ResampleImageFilter<MovingImageType,OutputImageType> FilterType;</P>
<P>FilterType::Pointer resample = FilterType::New();</P>
<P>resample->SetTransform( finalTransform );</P>
<P></FONT><FONT color=#008000 size=2><FONT color=#000000>resample->SetInput( movingImageReader->GetOutput() );</FONT></P></FONT><FONT size=2>
<P></FONT><FONT color=#008000 size=2>// defining spacing, origin and size (The parameters of the output image are taken from the input image.)</P></FONT><FONT size=2>
<P>rawreader->Update();</P>
<P></FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> MovingImageType::SpacingType&</P>
<P>spacing = rawreader->GetOutput()->GetSpacing();</P>
<P></FONT><FONT color=#0000ff size=2>const</FONT><FONT size=2> MovingImageType::PointType&</P>
<P>origin = rawreader->GetOutput()->GetOrigin();</P>
<P>MovingImageType::SizeType size = </P>
<P>rawreader->GetOutput()->GetLargestPossibleRegion().GetSize();</P>
<P>resample->SetOutputOrigin( origin );</P>
<P>resample->SetOutputSpacing( spacing );</P>
<P>resample->SetSize( size );</P>
<P></P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>unsigned</FONT><FONT size=2> </FONT><FONT color=#0000ff size=2>char</FONT><FONT size=2> OutputPixelType;</P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::Image< OutputPixelType, Dimension > OutputImageType;</P>
<P></P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::CastImageFilter< </P>
<P>MovingImageType,</P>
<P>OutputImageType > CastFilterType;</P>
<P></P>
<P></FONT><FONT color=#0000ff size=2>typedef</FONT><FONT size=2> itk::ImageFileWriter< OutputImageType > WriterType;</P>
<P> </P>
<P>WriterType::Pointer writer = WriterType::New();</P>
<P>CastFilterType::Pointer caster = CastFilterType::New();</P>
<P> </P>
<P>writer->SetFileName(</FONT><FONT color=#800000 size=2>"result_of_registration"</FONT><FONT size=2>);</P>
<P></P></FONT><FONT color=#000000 size=2>
<P>caster->SetInput( resample->GetOutput() );</P></FONT><FONT size=2>
<P>writer->SetInput( caster->GetOutput() );</P>
<P>writer->Update();</P>
<P> </P>
<P>Tony</P></FONT></DIV></div><br>
<hr size=1><a href="http://us.rd.yahoo.com/evt=49938/*http://tools.search.yahoo.com/toolbar/features/mail/">Never miss an email again!<br>Yahoo! Toolbar</a> alerts you the instant new Mail arrives.<a href="
http://us.rd.yahoo.com/evt=49937/*http://tools.search.yahoo.com/toolbar/features/mail/"> Check it out.</a></body></html>