<br>Hi Sabine<br><br>It looks like what you need is the <br><br> itk::PasteImageFilter<br><a href="http://public.kitware.com/Insight/Doxygen/html/classitk_1_1PasteImageFilter.html">http://public.kitware.com/Insight/Doxygen/html/classitk_1_1PasteImageFilter.html</a><br>
<br><br>Unless you are not just copying a region, but <br>also applying a geometrical transformation <br>such as rotation or scaling.<br><br><br>Please let us know,<br><br><br> Thanks<br><br><br> Luis<br><br>
<br>--------------------------------------------------------<br><div class="gmail_quote">On Wed, Feb 25, 2009 at 11:09 AM, slorentz <span dir="ltr"><<a href="mailto:professor_rumsdiegeige@yahoo.com">professor_rumsdiegeige@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hello!<br>
<br>
I try to do the following:I have two images. The first one is called<br>
"ResultImage", and the second one is called "ImageToAdd". I want to add<br>
everything of "ImageToAdd" that is not visible in the first frame to<br>
"ResultImage". So, first I compute the registration parameters:<br>
<br>
// compute optimal registration parameters<br>
registration->SetFixedImage( ResultImage );<br>
registration->SetMovingImage( ImageToAdd );<br>
registration->SetInitialTransformParameters( initialParameters );<br>
registration->Update();<br>
<br>
ParametersType finalParameters = registration->GetLastTransformParameters();<br>
<br>
<br>
<br>
Then I'd like to copy the new part of the image "ImageToAdd" in order to<br>
have "ResultImage" + the new part of "ImageToAdd"... I tried this:<br>
<br>
ImageType::SizeType S = (ResultImage->GetLargestPossibleRegion()).GetSize();<br>
ImageType::PointType O = ResultImage->GetOrigin(); //O[0] -= 40;<br>
resampler->SetSize( size );<br>
resampler->SetInput( Y );<br>
resampler->SetTransform( registration->GetOutput()->Get() );<br>
resampler->SetOutputOrigin( O );<br>
resampler->SetOutputSpacing( ResultImage->GetSpacing() );<br>
resampler->SetDefaultPixelValue( 50 );<br>
<br>
// this should be the new, stitched image<br>
ImageType::Pointer Z = resampler->GetOutput();<br>
<br>
// write the result to a file<br>
typedef itk::ImageFileWriter< ImageType > WriterType;<br>
WriterType::Pointer wt = WriterType::New();<br>
wt->SetFileName("test.bmp");<br>
wt->SetInput( Z );<br>
wt->Update();<br>
<br>
<br>
but it doesn't really work.... Is the way to use the resampling filter<br>
correct at all?<br>
<br>
<br>
Regards,<br>
Sabine Lorentz<br>
<br>
<br>
<br>
_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
</blockquote></div><br>