<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;" class="">
<div class="">You are missing that application of your image’s orientation/direction cosine matrix.</div>
<div class=""><br class="">
</div>
<div class="">I’d recommend computing the center index (as a ContinuousIndex type), and then using the Image::TransformContinuousIndexToPhysicalPoint[1] method.</div>
<div class=""><br class="">
</div>
<div class="">HTH,</div>
<div class="">Brad</div>
<div class=""><br class="">
</div>
<div class="">[1] <a href="https://itk.org/Doxygen/html/classitk_1_1ImageBase.html#ad3965f819b7d61e34605dc0331df0751" class="">https://itk.org/Doxygen/html/classitk_1_1ImageBase.html#ad3965f819b7d61e34605dc0331df0751</a></div>
<br class="">
<div>
<blockquote type="cite" class="">
<div class="">On Mar 5, 2017, at 6:48 PM, Dženan Zukić <<a href="mailto:dzenanz@gmail.com" class="">dzenanz@gmail.com</a>> wrote:</div>
<br class="Apple-interchange-newline">
<div class="">
<div dir="ltr" class="">
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
Hi Fabio,</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
<br class="">
</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
that sound right.</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
<br class="">
</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
Regards,</div>
<div class="gmail_default" style="font-family:verdana,sans-serif;font-size:small">
Dženan</div>
</div>
<div class="gmail_extra"><br class="">
<div class="gmail_quote">On Sun, Mar 5, 2017 at 5:14 PM, D'Isidoro Fabio <span dir="ltr" class="">
<<a href="mailto:fisidoro@ethz.ch" target="_blank" class="">fisidoro@ethz.ch</a>></span> wrote:<br class="">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="DE-CH" link="#0563C1" vlink="#954F72" class="">
<div class="m_1598015235479384987WordSection1">
<p class="MsoNormal"><span lang="EN-US" class="">Hi,<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" class="">since the image origin is defined in the middle of the “first” voxel and not at the very corner of the CT scan, I would calculate the image centre as:<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" class=""> img_centre[0] = origin[0] + spacing[0] * static_cast<double>(size[0]) / 2.0 - spacing[0] / 2.;<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" class="">Is that right?<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" class=""><u class=""></u> <u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" class="">Thank you<u class=""></u><u class=""></u></span></p>
<p class="MsoNormal"><span lang="EN-US" class=""><u class=""></u> <u class=""></u></span></p>
</div>
</div>
<br class="">
______________________________<wbr class="">_______<br class="">
Powered by <a href="http://www.kitware.com/" rel="noreferrer" target="_blank" class="">
www.kitware.com</a><br class="">
<br class="">
Visit other Kitware open-source projects at<br class="">
<a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank" class="">http://www.kitware.com/<wbr class="">opensource/opensource.html</a><br class="">
<br class="">
Kitware offers ITK Training Courses, for more information visit:<br class="">
<a href="http://www.kitware.com/products/protraining.php" rel="noreferrer" target="_blank" class="">http://www.kitware.com/<wbr class="">products/protraining.php</a><br class="">
<br class="">
Please keep messages on-topic and check the ITK FAQ at:<br class="">
<a href="http://www.itk.org/Wiki/ITK_FAQ" rel="noreferrer" target="_blank" class="">http://www.itk.org/Wiki/ITK_<wbr class="">FAQ</a><br class="">
<br class="">
Follow this link to subscribe/unsubscribe:<br class="">
<a href="http://public.kitware.com/mailman/listinfo/insight-users" rel="noreferrer" target="_blank" class="">http://public.kitware.com/<wbr class="">mailman/listinfo/insight-users</a><br class="">
<br class="">
</blockquote>
</div>
<br class="">
</div>
_____________________________________<br class="">
Powered by <a href="http://www.kitware.com" class="">www.kitware.com</a><br class="">
<br class="">
Visit other Kitware open-source projects at<br class="">
<a href="http://www.kitware.com/opensource/opensource.html" class="">http://www.kitware.com/opensource/opensource.html</a><br class="">
<br class="">
Kitware offers ITK Training Courses, for more information visit:<br class="">
http://www.kitware.com/products/protraining.php<br class="">
<br class="">
Please keep messages on-topic and check the ITK FAQ at:<br class="">
http://www.itk.org/Wiki/ITK_FAQ<br class="">
<br class="">
Follow this link to subscribe/unsubscribe:<br class="">
http://public.kitware.com/mailman/listinfo/insight-users<br class="">
</div>
</blockquote>
</div>
<br class="">
</body>
</html>