<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Kevin, <br>
<br>
To the best of my knowledge the class is doing the right thing and so
is your code, (you've swapped the moving and fixed landmark roles). <br>
Lines 86-87 of your code should read as, which is what you had earlier.<br>
&nbsp;&nbsp;&nbsp; initializer-&gt;SetFixedLandmarks( fixedLandmarks );<br>
&nbsp;&nbsp;&nbsp; initializer-&gt;SetMovingLandmarks( movingLandmarks );<br>
<br>
With the following command line args: I get the second cow to overlap
pretty well with the <br>
<pre wrap=""><a class="moz-txt-link-freetext"
 href="http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/cow_0.jpeg">http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/cow_0.jpeg</a> </pre>
<blockquote type="cite">11:06AM $ ./itk_landmark_transform cow_0.mhd
cow_1.mhd transformed_cow.mhd 97 245 331 61 88 240 334
74&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
</blockquote>
&nbsp; Fixed Landmark: [97, 245] Moving landmark
[88, 240] Transformed fixed Landmark : [87.6235, 240.254]<br>
&nbsp; Fixed Landmark: [331, 61] Moving landmark [334, 74] Transformed fixed
Landmark : [334.377, 73.7459]<br>
<br>
Possible sources of confusion are:<br>
<br>
1. The fixed landmarks after transformation through the transform
produced should have the same values as the moving landmarks. Not the
other way around.<br>
2. Use InsightApplications/ImageViewer to view your .mhd output. The
y-axis you are looking at might be flipped with respect to the image
co-ordinates. It helps to use a viewer built using ITK, so you never
have any co-ordinate confusion.<br>
<br>
karthik<br>
<br>
<br>
Kevin H. Hobbs wrote:
<blockquote cite="mid1116944368.30941.27.camel@gargon.hooperlab"
 type="cite">
  <pre wrap="">On Mon, 2005-05-23 at 06:49 -0400, Karthik Krishnan wrote:
  </pre>
  <blockquote type="cite">
    <pre wrap="">Kevin:

The class supports the Rigid2DTransform as well as the
VersorRigid3DTransform now. Please update your cvs repository. For usage,
please see the test
Testing/Code/Common/itkLandmarkBasedTransformInitializerTest.cxx

Thanks
Regards
Karthik
    </pre>
  </blockquote>
  <pre wrap=""><!---->

I've put up a bit of code using the new
itkLandmarkBasedTransformInitializer.

<a class="moz-txt-link-freetext" href="http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/itk_landmark_transform.cxx">http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/itk_landmark_transform.cxx</a>

It's mostly cobbled together from 
Insight/Examples/Filtering/ResampleImageFilter6.cxx and
Testing/Code/Common/itkLandmarkBasedTransformInitializerTest.cxx

The transform seems to have rotated the moving image in the wrong
direction.
Fixed image:
  <a class="moz-txt-link-freetext" href="http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/cow_0.jpeg">http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/cow_0.jpeg</a> 
Moving image:
  <a class="moz-txt-link-freetext" href="http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/cow_1.jpeg">http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/cow_1.jpeg</a>
Difference of fixed and moving image:
  <a class="moz-txt-link-freetext" href="http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/cow_diff_0_1.jpeg">http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/cow_diff_0_1.jpeg</a>
Difference of fixed and translated moving image:
  <a class="moz-txt-link-freetext" href="http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/cow_diff_0_trans_1.jpeg">http://crab-lab.zool.ohiou.edu/kevin/Slice_Landmark_Registration/cow_diff_0_trans_1.jpeg</a>

Did I mess something up with the transform, centers of rotation and the
like?
  </pre>
</blockquote>
</body>
</html>