<div dir="ltr">That will work for the region inside the overlap region, but the region outside the overlap region would then have their value reduced by half.  Is there a filter pre-written that checks for information in the overlap region before doing the scaling?  I have something partially written that does that but it doesn't fix the portion of the image that is cut off because it rotates outside the original image bounds.<div><br></div><div>Thanks for your help.</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><p>--</p><p>AH<br></p><p><br></p><p>-----------------------------------------------------------------------------------------------</p><p><i>This email and any attachments thereto may contain private, confidential, and privileged materials for the sole use of the intended recipient. Any reviewing, copying, or distribution of this email (or any attachments thereto) by other than the intended recipient is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently destroy this email and any attachments thereto.</i></p></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Wed, Feb 15, 2017 at 10:07 AM, ibraheem aldhamari <span dir="ltr"><<a href="mailto:ibr_ex@yahoo.com" target="_blank">ibr_ex@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76450" dir="ltr">save the images in the same datatype then multiply each image by 0.5 before adding </div><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76450" dir="ltr"><a href="https://itk.org/ITKExamples/src/Filtering/ImageIntensity/MultiplyImageByScalar/Documentation.html" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76567" target="_blank">https://itk.org/ITKExamples/<wbr>src/Filtering/ImageIntensity/<wbr>MultiplyImageByScalar/<wbr>Documentation.html</a> <br></div><span class=""><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76577"><br></div><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76577"><br></div><div class="m_3995185206049327119signature" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76452">Best regards and have a nice day!<div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76453"><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76455"><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76454">Ibraheem </div><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76464"> </div></div></div></div><div class="m_3995185206049327119qtdSeparateBR" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76462"><br></div></span><div class="m_3995185206049327119yahoo_quoted" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76763" style="display:block">  <div style="font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76762"> <div style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76761"> <div dir="ltr" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76760"> <font size="2" face="Arial" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76759"><span class=""> <hr size="1"> <b><span style="font-weight:bold">From:</span></b> Andrew Harris <<a href="mailto:aharr8@uwo.ca" target="_blank">aharr8@uwo.ca</a>><br> </span><b><span style="font-weight:bold">To:</span></b> ibraheem aldhamari <<a href="mailto:ibr_ex@yahoo.com" target="_blank">ibr_ex@yahoo.com</a>> <br><b id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76758"><span style="font-weight:bold" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76757">Cc:</span></b> Insight-users <<a href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>><br> <b id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76765"><span style="font-weight:bold" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76764">Sent:</span></b> Wednesday, February 15, 2017 4:01 PM<br> <b id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76767"><span style="font-weight:bold" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76766">Subject:</span></b> Re: [ITK-users] [ITK] Combining two images after registration<br> </font> </div> <div class="m_3995185206049327119y_msg_container" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76768"><br><div id="m_3995185206049327119yiv0261559290"><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76770"><div><div class="h5"><div dir="ltr" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76769">Thanks for getting back to me,<div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76771">I looked at that filter and it has a warning that said “No numeric overflow checking is performed in this filter”, so I assumed that meant that if I put an image through it there would be a simple addition pixelwise across the image.  That would make the overlap region brighter than the non-overlap region which I was trying to avoid. </div></div></div></div><div class="m_3995185206049327119yiv0261559290gmail_extra" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76772"><div><div class="h5"><br clear="all"><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76782"><div class="m_3995185206049327119yiv0261559290gmail_signature" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76781"><div dir="ltr" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76780"><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76779"><div dir="ltr" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76778"><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76777"><div dir="ltr" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76776"><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76775"><div dir="ltr" id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76774"><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76773">--</div><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76783">AH<br clear="none"></div><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76784"><br clear="none"></div><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76785">------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>-----</div><div id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76787"><i id="m_3995185206049327119yui_3_16_0_ym19_1_1487147375528_76786">This email and any attachments thereto may contain private, confidential, and privileged materials for the sole use of the intended recipient. Any reviewing, copying, or distribution of this email (or any attachments thereto) by other than the intended recipient is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently destroy this email and any attachments thereto.</i></div></div></div></div></div></div></div></div></div></div>
<br clear="none"></div></div><div class="m_3995185206049327119yiv0261559290yqt7093524573" id="m_3995185206049327119yiv0261559290yqt33556"><div class="m_3995185206049327119yiv0261559290gmail_quote"><div><div class="h5">On Wed, Feb 15, 2017 at 9:42 AM, ibraheem aldhamari <span dir="ltr"><<a rel="nofollow" shape="rect" href="mailto:ibr_ex@yahoo.com" target="_blank">ibr_ex@yahoo.com</a>></span> wrote:<br clear="none"></div></div><blockquote class="m_3995185206049327119yiv0261559290gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div><div class="h5"><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64594"><span id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64675">Hey, </span></div><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64594"><span>In Slicer you can use Add Scalar Volume plugin.  </span></div><div></div><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64479">In itk use this :</div><div dir="ltr" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64479">    <a rel="nofollow" shape="rect" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64680" href="https://itk.org/Doxygen/html/classitk_1_1AddImageFilter.html" target="_blank">https://itk.org/Doxygen/ html/classitk_1_ 1AddImageFilter.html</a></div><div dir="ltr" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64725">    <a rel="nofollow" shape="rect" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64729" href="https://itk.org/Wiki/ITK/Examples/ImageProcessing/AddImageFilter" target="_blank">https://itk.org/Wiki/ITK/ Examples/ImageProcessing/ AddImageFilter</a><br clear="none"></div><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64888"><br clear="none"></div><div class="m_3995185206049327119yiv0261559290m_-5347015155408266877signature" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64438">Best regards and have a nice day!<div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64437">Ibraheem </div></div><div class="m_3995185206049327119yiv0261559290m_-5347015155408266877qtdSeparateBR" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64614"><br clear="none"><br clear="none"></div></div></div><div class="m_3995185206049327119yiv0261559290m_-5347015155408266877yahoo_quoted" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64563" style="display:block">  <div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64562" style="font-family:HelveticaNeue-Light,Helvetica Neue Light,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"> <div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64561" style="font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:16px"><div><div class="h5"> <div dir="ltr" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64565"> <font id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64564" size="2" face="Arial"> </font><hr id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64615" size="1"> <b><span style="font-weight:bold">From:</span></b> Andrew Harris <<a rel="nofollow" shape="rect" href="mailto:aharr8@uwo.ca" target="_blank">aharr8@uwo.ca</a>><br clear="none"> <b><span style="font-weight:bold">To:</span></b> Insight-users <<a rel="nofollow" shape="rect" href="mailto:insight-users@itk.org" target="_blank">insight-users@itk.org</a>> <br clear="none"> <b><span style="font-weight:bold">Sent:</span></b> Wednesday, February 15, 2017 3:39 PM<br clear="none"> <b id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64567"><span id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64566" style="font-weight:bold">Subject:</span></b> [ITK-users] [ITK] Combining two images after registration<br clear="none">  </div> </div></div><div class="m_3995185206049327119yiv0261559290m_-5347015155408266877y_msg_container" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_64560"><div><div class="h5"><div><div class="m_3995185206049327119yiv0261559290h5"><br clear="none"><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yiv8885273116"><div dir="ltr" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65107">Hello,<div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65116">Hopefully someone can point me in the right direction.  I have a successful image registration between two images of the same size I have confirmed by outputting two .mha files and blending them in Slicer.  What I would like to be able to do is to combine them within C++ and output a single .mha file. As a further complication, part of the moving image gets left off because the image rotates outside the bounds of the original image size, and it would be preferable if I could figure out how to pad the moving image automatically in the dimensions necessary to prevent this from happening.</div><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65115"><br clear="none"></div><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65106">Any thoughts are welcome.<br clear="all"><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65105"><div class="m_3995185206049327119yiv0261559290m_-5347015155408266877yiv8885273116gmail_signature" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65104"><div dir="ltr" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65103"><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65102"><div dir="ltr" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65101"><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65100"><div dir="ltr" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65099"><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65098"><div dir="ltr" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65097"><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65114">--</div><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65113">AH<br clear="none"></div><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65112"><br clear="none"></div><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65111">------------------------------ ------------------------------ ------------------------------ -----</div><div id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65096"><i id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65095">This email and any attachments thereto may contain private, confidential, and privileged materials for the sole use of the intended recipient. Any reviewing, copying, or distribution of this email (or any attachments thereto) by other than the intended recipient is strictly prohibited. If you are not the intended recipient, please contact the sender immediately and permanently destroy this email and any attachments thereto.</i></div></div></div></div></div></div></div></div></div></div>
</div></div></div><br clear="none"></div></div></div></div>______________________________ _______<span class=""><br clear="none">Powered by <a rel="nofollow" shape="rect" href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br clear="none"><br clear="none">Visit other Kitware open-source projects at<br clear="none"><a rel="nofollow" shape="rect" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65120" href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/ opensource/opensource.html</a><br clear="none"><br clear="none">Kitware offers ITK Training Courses, for more information visit:<br clear="none"><a rel="nofollow" shape="rect" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65121" href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/ products/protraining.php</a><br clear="none"><br clear="none">Please keep messages on-topic and check the ITK FAQ at:<br clear="none"><a rel="nofollow" shape="rect" id="m_3995185206049327119yiv0261559290m_-5347015155408266877yui_3_16_0_ym19_1_1487147375528_65122" href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_ FAQ</a><br clear="none"><br clear="none">Follow this link to subscribe/unsubscribe:<br clear="none"><a rel="nofollow" shape="rect" href="http://public.kitware.com/mailman/listinfo/insight-users" target="_blank">http://public.kitware.com/ mailman/listinfo/insight-users</a><br clear="none"><br clear="none"><br clear="none"></span></div> </div> </div>  </div></div></div></blockquote></div></div><br clear="none"></div></div></div><br><br></div> </div> </div>  </div></div></div></blockquote></div><br></div>