<div dir="ltr">Hi Siavash, Christopher, all<div><br></div><div>I have progressed a bit and am able to add two identical images. However, if I take two images which do not &quot;occupy the same physical space&quot;, e.g. due to different voxel spacing etc. it fails.</div>
<div><br></div><div>I think I need to</div><div>- calculate the maximum bounds (/dimensions) of the fused image containing the two individual images</div><div>- resample both images to the combined one which is large enough to contain both other images</div>
<div><br></div><div>Is there any advice how to go from here?</div><div><br></div><div>I have attached my code so far...</div><div><br></div><div>This task must have been solved many times since if you have registered two images using any method, one may want to represent those two images in one image (space)...?</div>
<div><br></div><div>Thanks much,</div><div>Bob</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Sep 17, 2013 at 11:05 PM, Siavash Khallaghi <span dir="ltr">&lt;<a href="mailto:siavashk@ece.ubc.ca" target="_blank">siavashk@ece.ubc.ca</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div>Hi Bob,<br>
      <br>
      You can do this using itk filters in the following order:<br>
      <br>
      1. Use an itk::HistogramMatchingImageFilter to do histogram
      equalization.<br>
      2. Use an itk::ResampleImageFilter to map one volume spatially to
      the other.<br>
      3. Use an itk::AddImageFilter to add the result of Step 2.<br>
      4. Use an itk::MultiplyByConstantImageFilter on the result of Step
      3 to create the average (there may be a filter that combines Steps
      3 and 4).<br>
      <br>
      Siavash<div><div class="h5"><br>
      <br>
      On 17/09/2013 10:46 AM, Christopher Mullins wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">
      <div dir="ltr">Check out the TubeTK MergeAdjacentImages
        application [1].  Looks like this will do several of the tasks
        you&#39;re looking for, and it&#39;s built on top of ITK.
        <div><br>
        </div>
        <div>[1] <a href="https://github.com/TubeTK/TubeTK/tree/master/Applications/MergeAdjacentImages" target="_blank">https://github.com/TubeTK/TubeTK/tree/master/Applications/MergeAdjacentImages</a></div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">On Tue, Sep 17, 2013 at 1:41 PM, Robert
          Manzke <span dir="ltr">&lt;<a href="mailto:paradenker@gmail.com" target="_blank">paradenker@gmail.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hi, </span>
              <div style="font-family:arial,sans-serif;font-size:13px">
                <br>
              </div>
              <div style="font-family:arial,sans-serif;font-size:13px">I
                want to create one single volume from two .mhd files. </div>
              <div style="font-family:arial,sans-serif;font-size:13px">I
                also have a 4x4 transformation matrix which maps one
                volume into another.</div>
              <div style="font-family:arial,sans-serif;font-size:13px"><br>
              </div>
              <div style="font-family:arial,sans-serif;font-size:13px">
                So basically, I need an interpolator and a merge
                function, i.e. average volume 1 and 2, to create a
                single volume.</div>
              <div style="font-family:arial,sans-serif;font-size:13px">The
                single volume will have a larger size than the two
                individual ones, if the transform is not identity.</div>
              <div style="font-family:arial,sans-serif;font-size:13px"><br>
              </div>
              <div style="font-family:arial,sans-serif;font-size:13px">It
                can happen that both images have different gray level
                histograms, so histogram matching before fusion is also
                desirable.</div>
              <div style="font-family:arial,sans-serif;font-size:13px"><br>
              </div>
              <div style="font-family:arial,sans-serif;font-size:13px">Can
                anyone lead me into the right direction how to do this
                with itk?</div>
              <div style="font-family:arial,sans-serif;font-size:13px">
                I would volunteer to post my final code for a small
                how-to, once it works.</div>
              <div style="font-family:arial,sans-serif;font-size:13px"><br>
              </div>
              <div style="font-family:arial,sans-serif;font-size:13px">Thanks,</div>
              <div style="font-family:arial,sans-serif;font-size:13px">
                Bob</div>
            </div>
            <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>
            Kitware offers ITK Training Courses, for more information
            visit:<br>
            <a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
            <br>
            Please keep messages on-topic and check the ITK FAQ at:<br>
            <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>
            <br>
          </blockquote>
        </div>
        <br>
        <br clear="all">
        <div><br>
        </div>
        -- <br>
        Christopher Mullins
        <div>R&amp;D Engineer</div>
        <div>Kitware Inc.,</div>
        <div><a href="tel:919.869.8871" value="+19198698871" target="_blank">919.869.8871</a></div>
      </div>
      <br>
      <fieldset></fieldset>
      <br>
      <pre>_____________________________________
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a>

Visit other Kitware open-source projects at
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a>

Kitware offers ITK Training Courses, for more information visit:
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a>

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>

Follow this link to subscribe/unsubscribe:
<a href="http://www.itk.org/mailman/listinfo/insight-users" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a>
</pre>
    </blockquote>
    <br>
    <br>
    </div></div><span class="HOEnZb"><font color="#888888"><pre cols="72">-- 
PhD Candidate
Robotics and Control Laboratory, Room 3090
Electrical and Computer Engineering, UBC
2332 Main Mall, Vancouver, BC, Canada, V6T 1Z4
<a href="http://www.ece.ubc.ca/~siavashk/" target="_blank">www.ece.ubc.ca/~siavashk/</a>
Tel: <a href="tel:%28604%29822-9215" value="+16048229215" target="_blank">(604)822-9215</a></pre>
  </font></span></div>

<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>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.php" target="_blank">http://www.kitware.com/products/protraining.php</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<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>
<br></blockquote></div><br></div></div>