<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; color: rgb(0, 0, 0); font-size: 14px; font-family: Calibri, sans-serif;">
<div>
<div>
<div>Ryan,</div>
<div><br>
</div>
<div>Have you tried applying the inverse of the rigid transform defined by landmarks?</div>
<div><br>
</div>
<div>A common mistake is apply the transform that works for aligning landmarks points to an image.  They are inverse problems.  The transform that is applied to align landmarks is the inverse of the transform that is needed to resample images.</div>
<div><br>
</div>
<div>Hans</div>
<div><br>
</div>
<div>
<div id="MAC_OUTLOOK_SIGNATURE">
<div>
<div>-- </div>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
<div><br>
</div>
<span id="OLK_SRC_BODY_SECTION">
<div style="font-family:Calibri; font-size:12pt; text-align:left; color:black; BORDER-BOTTOM: medium none; BORDER-LEFT: medium none; PADDING-BOTTOM: 0in; PADDING-LEFT: 0in; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; BORDER-RIGHT: medium none; PADDING-TOP: 3pt">
<span style="font-weight:bold">From: </span>Insight-users <<a href="mailto:insight-users-bounces@itk.org">insight-users-bounces@itk.org</a>> on behalf of "Young, Ryan" <<a href="mailto:Ryan.Young@seattlechildrens.org">Ryan.Young@seattlechildrens.org</a>><br>
<span style="font-weight:bold">Date: </span>Thursday, February 11, 2016 at 7:00 PM<br>
<span style="font-weight:bold">To: </span>"<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>" <<a href="mailto:insight-users@itk.org">insight-users@itk.org</a>><br>
<span style="font-weight:bold">Subject: </span>[ITK-users] rigid landmark registartion simpleITK (python)<br>
</div>
<div><br>
</div>
<div dir="ltr"><style id="owaParaStyle" type="text/css">P {margin-top:0;margin-bottom:0;}</style>
<div ocsi="0" fpstyle="1">
<div style="direction: ltr;font-family: Tahoma;color: #000000;font-size: 10pt;">Hello,<br>
<br>
I am trying to rigidly align a group of landmarked samples.  I have calculated a rigid transformation matrix.  When I apply this to the sample (see code below) is sample is commonly clipped.  It seems like the transformation is pushing the sample out out its
 physically defined space and the data is lost.  How should I set things up to that large translations and rotations do not result in parts of the image being lost.<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
affine_center = (0,0,0)<br>
affine_translation =translation<br>
<br>
affine_matrix =T.flatten(order='C')       <br>
affine = sitk.AffineTransform(affine_matrix, affine_translation, affine_center)<br>
<br>
imAffine = sitk.Resample(im, imRef, affine,sitk.sitkLinear, sitk.sitkUInt32)<br>
</div>
CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and may contain confidential and privileged information protected by law. Any unauthorized review, use, disclosure or distribution is prohibited.
 If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message.
</div>
</div>
</span>
</body>
</html>