<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:"맑은 고딕";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:돋움체;
        panose-1:2 11 6 9 0 1 1 1 1 1;}
@font-face
        {font-family:"\@돋움체";
        panose-1:2 11 6 9 0 1 1 1 1 1;}
@font-face
        {font-family:"\@맑은 고딕";
        panose-1:2 11 5 3 2 0 0 2 0 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
span.sewohkoy8cv0oze
        {mso-style-name:sewohkoy8cv0oze;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri","sans-serif";
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri","sans-serif";}
@page WordSection1
        {size:8.5in 11.0in;
        margin:85.05pt 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-US link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Simon,<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Thanks for the good tip. Let me try out your approach too!<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>YangKyun<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=MsoNormal><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> simon.rit@gmail.com [mailto:simon.rit@gmail.com] <b>On Behalf Of </b>Simon Rit<br><b>Sent:</b> Wednesday, September 10, 2014 10:50 AM<br><b>To:</b> Yang Kyun Park<br><b>Cc:</b> Chao Wu; rtk-users@openrtk.org<br><b>Subject:</b> Re: [Rtk-users] coordinates of 3D volume<o:p></o:p></span></p><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>This option works but there is a risk of an additional interpolation by the resampler and it costs some computing time. The other option I suggested requires to modify the transform parameter of the source (in this example, add<br><br>constantImageSource->SetDirection(transform->GetMatrix());<br><br>where transform is that of Yang's example, then use <a href="http://www.itk.org/Doxygen/html/classitk_1_1ChangeInformationImageFilter.html">itk::ChangeImageInformation</a> to reset the transform to identity.<o:p></o:p></p></div><div><p class=MsoNormal><o:p> </o:p></p><div><p class=MsoNormal>On Wed, Sep 10, 2014 at 3:47 PM, Yang Kyun Park <<a href="mailto:theday79@gmail.com" target="_blank">theday79@gmail.com</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in'><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Hi Chao,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I had the same issue on my work and I’ve managed to fix it by the following codes.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>I’m not sure this is the optimal way to do it but at least it worked in my case.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>(Or you can transform it in 3D Slicer.</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>In transform menu, you need to apply the following matrix:</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>0 0 -1 0</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>1 0 0 0</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>0 1 0 0</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>0 0 0 1</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>to the target image, harden the transform then export the image.)</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Best,</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>YangKyun</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:10.0pt;font-family:돋움체;color:#010001'>// OutputImageType = <float, 3></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>//</span><span style='font-size:10.0pt;font-family:돋움체;color:#010001'> streamerBP</span><span style='font-size:10.0pt;font-family:돋움체'>-><span style='color:#010001'>GetOutput</span>(): resultant 3D image from rtkfdk reconstruction</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체;color:green'>//Same image type from original image -3D & float</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>OutputImageType</span>::<span style='color:#010001'>IndexType</span> <span style='color:#010001'>start_trans</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>start_trans</span>[0] = 0;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>start_trans</span>[1] = 0;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>start_trans</span>[2] = 0;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>OutputImageType</span>::<span style='color:#010001'>SizeType</span> <span style='color:#010001'>size_trans</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>size_trans</span>[0] = <span style='color:#010001'>sizeOutput</span>[0]; <span style='color:green'>// X //410</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>size_trans</span>[1] = <span style='color:#010001'>sizeOutput</span>[2]; <span style='color:green'>//Y  // 410</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>size_trans</span>[2] = <span style='color:#010001'>sizeOutput</span>[1]; <span style='color:green'>//Z // 120?</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체;color:green'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>OutputImageType</span>::<span style='color:#010001'>SpacingType</span> <span style='color:#010001'>spacing_trans</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>spacing_trans</span>[0] = <span style='color:#010001'>spacing</span>[0];</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>spacing_trans</span>[1] = <span style='color:#010001'>spacing</span>[2];</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>spacing_trans</span>[2] = <span style='color:#010001'>spacing</span>[1];</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>OutputImageType</span>::<span style='color:#010001'>PointType</span> <span style='color:#010001'>Origin_trans</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>Origin_trans</span>[0] = -0.5* <span style='color:#010001'>size_trans</span>[0]*<span style='color:#010001'>spacing_trans</span>[0];</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>Origin_trans</span>[1] = -0.5* <span style='color:#010001'>size_trans</span>[1]*<span style='color:#010001'>spacing_trans</span>[1];</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>Origin_trans</span>[2] = -0.5* <span style='color:#010001'>size_trans</span>[2]*<span style='color:#010001'>spacing_trans</span>[2];       </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>OutputImageType</span>::<span style='color:#010001'>RegionType</span> <span style='color:#010001'>region_trans</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>region_trans</span>.<span style='color:#010001'>SetSize</span>(<span style='color:#010001'>size_trans</span>);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>region_trans</span>.<span style='color:#010001'>SetIndex</span>(<span style='color:#010001'>start_trans</span>);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:green'>/* 2) Prepare Target image */</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>OutputImageType</span>::<span style='color:#010001'>Pointer</span> <span style='color:#010001'>targetImg</span> = <span style='color:#010001'>streamerBP</span>-><span style='color:#010001'>GetOutput</span>();</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:green'>/* 3) Configure transform */</span>  </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:blue'>typedef</span> <span style='color:#010001'>itk</span>::<span style='color:#010001'>Euler3DTransform</span>< <span style='color:blue'>double</span> > <span style='color:#010001'>TransformType</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>TransformType</span>::<span style='color:#010001'>Pointer</span> <span style='color:#010001'>transform</span> = <span style='color:#010001'>TransformType</span>::<span style='color:#010001'>New</span>();</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>TransformType</span>::<span style='color:#010001'>ParametersType</span> <span style='color:#010001'>param</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>param</span>.<span style='color:#010001'>SetSize</span>(6);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:green'>//MAXIMUM PARAM NUMBER: 6!!!</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>param</span>.<span style='color:#010001'>put</span>(0, 0.0); <span style='color:green'>//rot X // 0.5 = PI/2</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>param</span>.<span style='color:#010001'>put</span>(1,  <span style='color:#010001'>itk</span>::<span style='color:#010001'>Math</span>::<span style='color:#010001'>pi</span>/2.0);<span style='color:green'>//rot Y</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>param</span>.<span style='color:#010001'>put</span>(2,  <span style='color:#010001'>itk</span>::<span style='color:#010001'>Math</span>::<span style='color:#010001'>pi</span>/-2.0);<span style='color:green'>//rot Z</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>param</span>.<span style='color:#010001'>put</span>(3, 0.0); <span style='color:green'>// Trans X mm</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>param</span>.<span style='color:#010001'>put</span>(4, 0.0); <span style='color:green'>// Trans Y mm</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>param</span>.<span style='color:#010001'>put</span>(5, 0.0); <span style='color:green'>// Trans Z mm</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체;color:green'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>TransformType</span>::<span style='color:#010001'>ParametersType</span> <span style='color:#010001'>fixedParam</span>(3); <span style='color:green'>//rotation center</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>fixedParam</span>.<span style='color:#010001'>put</span>(0,0);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>fixedParam</span>.<span style='color:#010001'>put</span>(1,0);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>fixedParam</span>.<span style='color:#010001'>put</span>(2,0);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>transform</span>-><span style='color:#010001'>SetParameters</span>(<span style='color:#010001'>param</span>);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>transform</span>-><span style='color:#010001'>SetFixedParameters</span>(<span style='color:#010001'>fixedParam</span>); <span style='color:green'>//Center of the Transform</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체;color:green'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>cout</span> << <span style='color:#A31515'>"Transform matrix:"</span> << <span style='color:#A31515'>"  "</span> << <span style='color:#010001'>endl</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>cout</span> << <span style='color:#010001'>transform</span>-><span style='color:#010001'>GetMatrix</span>() << <span style='color:#010001'>std</span>::<span style='color:#010001'>endl</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:blue'>typedef</span> <span style='color:#010001'>itk</span>::<span style='color:#010001'>ResampleImageFilter</span><<span style='color:#010001'>OutputImageType</span>, <span style='color:#010001'>OutputImageType</span>> <span style='color:#010001'>ResampleFilterType</span>;   </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>ResampleFilterType</span>::<span style='color:#010001'>Pointer</span> <span style='color:#010001'>resampler</span> = <span style='color:#010001'>ResampleFilterType</span>::<span style='color:#010001'>New</span>(); </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:green'>//OutputImageType::RegionType fixedImg_Region = fixedImg->GetLargestPossibleRegion().GetSize();</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체;color:green'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>resampler</span>-><span style='color:#010001'>SetInput</span>(<span style='color:#010001'>targetImg</span>);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>resampler</span>-><span style='color:#010001'>SetSize</span>(<span style='color:#010001'>size_trans</span>);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>resampler</span>-><span style='color:#010001'>SetOutputOrigin</span>( <span style='color:#010001'>Origin_trans</span>); <span style='color:green'>//Lt Top Inf of Large Canvas</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>resampler</span>-><span style='color:#010001'>SetOutputSpacing</span>( <span style='color:#010001'>spacing_trans</span> ); <span style='color:green'>// 1 1 1 </span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>resampler</span>-><span style='color:#010001'>SetOutputDirection</span>( <span style='color:#010001'>targetImg</span>-><span style='color:#010001'>GetDirection</span>() ); <span style='color:green'>//image normal?</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>resampler</span>-><span style='color:#010001'>SetTransform</span>(<span style='color:#010001'>transform</span>);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:green'>//LR flip</span></span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체;color:green'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>cout</span> << <span style='color:#A31515'>"LR flip filter is being applied"</span> << <span style='color:#010001'>endl</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:blue'>typedef</span> <span style='color:#010001'>itk</span>::<span style='color:#010001'>FlipImageFilter</span>< <span style='color:#010001'>OutputImageType</span> >  <span style='color:#010001'>FilterType</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>FilterType</span>::<span style='color:#010001'>Pointer</span> <span style='color:#010001'>flipFilter</span> = <span style='color:#010001'>FilterType</span>::<span style='color:#010001'>New</span>();</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:blue'>typedef</span> <span style='color:#010001'>FilterType</span>::<span style='color:#010001'>FlipAxesArrayType</span> <span style='color:#010001'>FlipAxesArrayType</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>FlipAxesArrayType</span> <span style='color:#010001'>arrFlipAxes</span>;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>arrFlipAxes</span>[0] = 1;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>arrFlipAxes</span>[1] = 0;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>arrFlipAxes</span>[2] = 0;</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>flipFilter</span>-><span style='color:#010001'>SetFlipAxes</span>(<span style='color:#010001'>arrFlipAxes</span>);</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체'>       <span style='color:#010001'>flipFilter</span>-><span style='color:#010001'>SetInput</span>(<span style='color:#010001'>resampler</span>-><span style='color:#010001'>GetOutput</span>());</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:.5in;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체;color:#010001'>flipFilter->Update();</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:.5in;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체;color:#010001'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto;text-indent:.5in;text-autospace:none'><span style='font-size:10.0pt;font-family:돋움체;color:#010001'>//Use flipFilter->GetOutput() for further process</span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> </span><o:p></o:p></p><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'>From:</span></b><span style='font-size:11.0pt;font-family:"Calibri","sans-serif"'> Rtk-users [mailto:<a href="mailto:rtk-users-bounces@public.kitware.com" target="_blank">rtk-users-bounces@public.kitware.com</a>] <b>On Behalf Of </b>Simon Rit<br><b>Sent:</b> Wednesday, September 10, 2014 8:39 AM<br><b>To:</b> Chao Wu<br><b>Cc:</b> <a href="mailto:rtk-users@openrtk.org" target="_blank">rtk-users@openrtk.org</a><br><b>Subject:</b> Re: [Rtk-users] coordinates of 3D volume</span><o:p></o:p></p><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi,<o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I wish there was a single industrial standard... You have the DICOM standard in mind and I used an IEC standard (see wiki). You can play with the --direction option to orientate the voxel axes of your image (see itk::Image documentation) and then reset the direction of your output image to identity, I think that will do what you want.<o:p></o:p></p></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Simon<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>On Wed, Sep 10, 2014 at 1:35 PM, Chao Wu <<a href="mailto:wuchao04@gmail.com" target="_blank">wuchao04@gmail.com</a>> wrote:<o:p></o:p></p><blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt'><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Hi all,<o:p></o:p></p><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>I see that rtk use certain industrial standard for the coordinates of 2D projections and 3D volumes. However in medical imaging, the xy planes of a volume are usually transaxial slices while the 3rd dimension is aligned with the axis of rotation. I would like to switch to this coordinates in my own code. Is there anyone who can give me some comments and suggestions about where to start? Thanks.<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Regards,<o:p></o:p></p></div><div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'>Chao<o:p></o:p></p></div></div><p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><br>_______________________________________________<br>Rtk-users mailing list<br><a href="mailto:Rtk-users@public.kitware.com" target="_blank">Rtk-users@public.kitware.com</a><br><a href="http://public.kitware.com/mailman/listinfo/rtk-users" target="_blank">http://public.kitware.com/mailman/listinfo/rtk-users</a><o:p></o:p></p></blockquote></div><p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'> <o:p></o:p></p></div></div></div></div></div></blockquote></div><p class=MsoNormal><o:p> </o:p></p></div></div></body></html>