Thanks so much for this, Brian.<div><br></div><div>I have no doubt that the ITK manual has the same content, but your explanation clarified the process for me.</div><div><br></div><div>Much appreciated!</div><div><br></div>
<div>Tim<br><br>On Monday, December 9, 2013, brian avants  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Tim <div><br></div><div>We can tell you with absolute certainty that all deformable mappings in ITKv4, by default, map the moving image into the fixed image space.  This is achieved by, as Hans said, pulling ... i.e. identifying vectors *in the fixed space* that "point at" the moving image space.  This *pulls* the moving image into the fixed image configuration.  If you think of this as mapping points, then this same field would *push* points from the fixed image space to the moving image space.  The point would then identify its new intensity, from the moving image, and then come back to its original position in the fixed space.  This is what WarpImageFilter does.  </div>


</div><div class="gmail_extra"><br clear="all"><div><div><br></div>brian<br><div><br></div><div><br></div></div>
<br><br><div>On Mon, Dec 9, 2013 at 11:54 AM, Tim Bhatnagar <span dir="ltr"><<a>tim.bhatnagar@gmail.com</a>></span> wrote:<br><blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div dir="ltr"><div><div><div>Hey Yago,<br><br></div>Thanks for the work you did for me!<br><br></div>For my work, it's not the actual visualization that I can't achieve.. it's not being able to know (for certain) which 'direction' my displacement field maps my data. <br>



<br></div><div>BUT, you don't seem to do any 'scaling' of your deformation field before you visualize it in Paraview.. so is it safe to say that the displacementfield.vtk file I output from my registration process, will be visualized correctly (no need to 'flip' axes, etc) in Paraview? Even knowing that for sure would definitely help!<br>



<br></div><div>Also, did you just generate a deformation field, or is it a result of a registration process?<br><br>Thanks so much!<span><font color="#888888"><br><br>Tim<br></font></span></div></div><div>

<div><div><br><br><div>On Mon, Dec 9, 2013 at 8:42 AM, Yago Diez <span dir="ltr"><<a>yagodiezdonoso@gmail.com</a>></span> wrote:<br>


<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><br><div><div dir="ltr">Tim,<br><div><br>I did a small test visualizing 2D deformation fields in <span>paraview</span>, I used .vtk files but .mhd files should also work fine.<br>



<br>You can use <span>paraview</span> to visualize deformation fields.  You have a description on how to do this in the 8.15 section of the itk guide (Visualizing Deformation fields).<br>
<br>Mainly you have to:<br><br>1) open the file with paraview<br>
2) Open a calculator with the following formula: <br>
<br>scalars_X*iHat+scalars_Y*jHat+0*kHat<br><div><br>The idea here is to
 obtain a 3D vector with z component =0 and the other components the 
deformation components. For 3D you probably want to represent all 
components using something like (not tested!) -> 
scalars_X*iHat+scalars_Y*jHat+scalars_Z*kHat<br>
<br>3) In order to visualize this, you have to use a "gliph", here you 
can control the number of points that you represent and so on, you 
obtain something like the "campDefDemons" attached file.<br></div><br><div></div><div>Hope this helps<span><font color="#888888"><span><font color="#888888"><br>
</font></span></font></span></div><span><font color="#888888"><span><font color="#888888"><div>
Yago<br></div></font></span></font></span><div><div><div>
<br></div><div><br><div><div><div>On Sun, Dec 8, 2013 at 6:07 AM, Matt McCormick <span dir="ltr"><<a>matt.mccormick@kitware.com</a>></span> wrote:<br>




</div></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>Hi Tim,<br>
<div><br>
On Sat, Dec 7, 2013 at 11:36 PM, Tim Bhatnagar <<a>tim.bhatnagar@gmail.com</a>> wrote:<br>
> Hey Matt,<br>
><br>
> Sorry to re-visit this specific email... in your message, you said:<br>
><br>
> "The displacement fields output of ITK's deformable image registration<br>
> represent the displacement of a point in the FixedImage to a point in<br>
> the MovingImage.  Therefore overlaying the displacement field vector<br>
> glyphs on the FixedImage should give the correct visualization.  The<br>
> start of the arrow sits on its location in the input FixedImage, and<br>
> the tip of the arrow glyphs are directed towards where a given pixel<br>
> in the FixedImage will move to in the MovingImage."<br>
><br>
> However, in the Demons examples that are built with the ITK package, an<br>
> 'output' image from the registration is produced by passing the movingImage<br>
> into the WarpImageFilter, and utilizing the newly created deformation field.<br>
> This makes it seem like the deformation field actually takes the movingImage<br>
> form into the fixedImage form, not the other way around.<br>
<br>
</div>Yes, it is true that the WarpImageFilter takes the movingImage and<br>
transforms it to the fixedImage space.  Different perspectives could<br>
be taken on what is moving or how it is moving, but all of the above<br>
is correct.<br>
<br>
Hope this helps,<br>
Matt<br>
</div></div><div><div><div>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank"></a></div></div></div></blockquote></div></div></div></div></div></div></div></div></blockquote></div></div></div></div></blockquote></div></div>
</blockquote></div><br><br>-- <br>Tim Bhatnagar<br>PhD Candidate<br>Orthopaedic Injury Biomechanics Group<br>Department of Mechanical Engineering<br>University of British Columbia<br><br>Rm 5000 - 818 West 10th Ave.<br>Vancouver, BC<br>
Canada<br>V5Z 1M9<br><br>Ph: (604) 675-8845<br>Fax: (604) 675-8820<br>Web: <a href="http://oibg.mech.ubc.ca" target="_blank">oibg.mech.ubc.ca</a><br><br>