<div dir="ltr"><div><div>Hi,<br></div>GetImageFromArray seems to be the good solution. Can you give the code that doesn't work (instead of copy pasting what works from the wiki)?<br></div>Simon<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 16, 2017 at 10:27 PM, sare Borhani <span dir="ltr"><<a href="mailto:sareh.borhani@gmail.com" target="_blank">sareh.borhani@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Dear RTK.User,<div><br></div><div><div style="font-size:12.800000190734863px">I'm using python wrapped version of RTK.<br><div><br></div><div>I used the only example of that for reconstruction.It works perfectly.</div><div><span style="color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:13px">The problem is that I need to simulate an artifact on projection 2D images, so first I got each 2D images of stack reiImage by <b>srtk.GetArrayFromImage(reiI<wbr>mage) </b>and then I applied a polynomial on that to simulate an artifact.NOW need to extract these artifacted-images again to the simpleRTK image to be able to reconstruct it at the end. I thought maybe <b>srtk.GetImageFromArray</b> w<wbr>orks, but it doesn't.Can you pls help me.I'm really hopeless.</span><br></div><div><span style="color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:13px"><br></span></div><div><span style="color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:13px">Here is the Example;</span></div><div><pre class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-de1" style="white-space:pre-wrap;font-size:14px;padding:0px;border:0px none white;color:rgb(0,0,0);line-height:1.2em;margin-top:0px;margin-bottom:0px;background-image:none;vertical-align:top;font-family:monospace,'courier new'"><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">from</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw3" style="color:rgb(220,20,60)">__future__</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">import</span> print_function
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">import</span> SimpleRTK <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">as</span> srtk
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">import</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw3" style="color:rgb(220,20,60)">sys</span>
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">import</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw3" style="color:rgb(220,20,60)">os</span>
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">import</span> matplotlib.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">pyplot</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">as</span> plt
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">import</span> matplotlib.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">cm</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">as</span> cm
 
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">if</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw2" style="color:rgb(0,128,0)">len</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw3" style="color:rgb(220,20,60)">sys</span>.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">argv</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)"><</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">2</span>:
    <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">print</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-st0" style="color:rgb(72,61,139)">"Usage: RTKFirstReconstruction <output>"</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
    <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw3" style="color:rgb(220,20,60)">sys</span>.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">exit</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">1</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
 
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-co1" style="color:rgb(128,128,128);font-style:italic"># Defines the RTK geometry object</span>
geometry <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> srtk.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">ThreeDCircularProjectionG<wbr>eometry</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
numberOfProjections <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">360</span>
firstAngle <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0</span>
angularArc <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">360</span>
sid <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">600</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-co1" style="color:rgb(128,128,128);font-style:italic"># source to isocenter distance in mm</span>
sdd <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">1200</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-co1" style="color:rgb(128,128,128);font-style:italic"># source to detector distance in mm</span>
isox <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-co1" style="color:rgb(128,128,128);font-style:italic"># X coordinate on the projection image of isocenter</span>
isoy <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-co1" style="color:rgb(128,128,128);font-style:italic"># Y coordinate on the projection image of isocenter</span>
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">for</span> x <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">in</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw2" style="color:rgb(0,128,0)">range</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span>numberOfProjections<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>:
  angle <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> firstAngle + x * angularArc / numberOfProjections
  geometry.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">AddProjection</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span>sid<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span>sdd<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)"><wbr>,</span>angle<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span>isox<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span>isoy<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
 
constantImageSource <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> srtk.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">ConstantImageSource</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
origin <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">[</span> -<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">127.5</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> -<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">127.5</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0</span>. <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">]</span>
sizeOutput <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">[</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">256</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">256</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span>  numberOfProjections <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">]</span>
spacing <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">[</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">1.0</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">1.0</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">1.0</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">]</span>
constantImageSource.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetOrigin</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span> origin <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
constantImageSource.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetSpacing</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0"><wbr>(</span> spacing <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
constantImageSource.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetSize</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span> sizeOutput <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
constantImageSource.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetConstan<wbr>t</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0.0</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
source <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> constantImageSource.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">Execute</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
 
rei <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> srtk.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">RayEllipsoidIntersectionI<wbr>mageFilter</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
semiprincipalaxis <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">[</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">50</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">50</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">50</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">]</span>
center <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">[</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">]</span>
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-co1" style="color:rgb(128,128,128);font-style:italic"># Set GrayScale value, axes, center...</span>
rei.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetDensity</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">20</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
rei.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetAngle</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
rei.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetCenter</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span>center<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
rei.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetAxis</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span>semiprincipalaxis<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
rei.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetGeometry</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span> geometry <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
reiImage <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> rei.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">Execute</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span>source<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
 
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-co1" style="color:rgb(128,128,128);font-style:italic"># Create reconstructed image</span>
constantImageSource2 <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> srtk.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">ConstantImageSource</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
origin <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">[</span> -<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">63.5</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> -<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">63.5</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> -<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">63.5</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">]</span>
sizeOutput <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">[</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">128</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">128</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">128</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">]</span>
constantImageSource2.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetOrigin</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0"><wbr>(</span> origin <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
constantImageSource2.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetSpacin<wbr>g</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span> spacing <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
constantImageSource2.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetSize</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span> sizeOutput <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
constantImageSource2.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetConsta<wbr>nt</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0.0</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
source2 <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> constantImageSource2.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">Execute</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
 
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">print</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-st0" style="color:rgb(72,61,139)">"Performing reconstruction"</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
feldkamp <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> srtk.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">FDKConeBeamReconstruction<wbr>Filter</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
feldkamp.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetGeometry</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span> geometry <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">;</span>
feldkamp.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetTruncationCorrecti<wbr>on</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0.0</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">;</span>
feldkamp.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetHannCutFrequency</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">0<wbr>.0</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">;</span>
image <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> feldkamp.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">Execute</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span>source2<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span>reiIm<wbr>age<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span> 
 
<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw1" style="color:rgb(255,119,0);font-weight:bold">print</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-st0" style="color:rgb(72,61,139)">"Masking field-of-view"</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
fov <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> srtk.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">FieldOfViewImageFilter</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
fov.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetGeometry</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span>geometry<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
fov.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetProjectionsStack</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span>reiIma<wbr>ge<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
image <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> fov.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">Execute</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span>image<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
 
plt.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">imshow</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span>srtk.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">GetArrayFromIm<wbr>age</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span>image<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">[</span>:<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">64</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span>:<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">]</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">,</span> cmap <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> cm.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">Greys_r</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
plt.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">show</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
 
writer <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">=</span> srtk.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">ImageFileWriter</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
writer.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">SetFileName</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-kw3" style="color:rgb(220,20,60)">sys</span>.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">argv</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">[</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-nu0" style="color:rgb(255,69,0)">1</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">]</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span>
writer.<span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-me1">Execute</span> <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">(</span> image <span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-br0">)</span><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)">;</span></pre><pre class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-de1" style="white-space:pre-wrap;font-size:14px;padding:0px;border:0px none white;color:rgb(0,0,0);line-height:1.2em;margin-top:0px;margin-bottom:0px;background-image:none;vertical-align:top;font-family:monospace,'courier new'"><span class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-sy0" style="color:rgb(102,204,102)"><a href="http://wiki.openrtk.org/index.php/SimpleRTK" target="_blank">http://wiki.openrtk.org/index.<wbr>php/SimpleRTK</a><br></span></pre><pre class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-de1" style="white-space:pre-wrap;font-size:14px;padding:0px;border:0px none white;color:rgb(0,0,0);line-height:1.2em;margin-top:0px;margin-bottom:0px;background-image:none;vertical-align:top;font-family:monospace,'courier new'"><br></pre><pre class="m_530373467652274592gmail-m_8473466661053406696gmail-m_4744435712807139958gmail-de1" style="white-space:pre-wrap;font-size:14px;padding:0px;border:0px none white;color:rgb(0,0,0);line-height:1.2em;margin-top:0px;margin-bottom:0px;background-image:none;vertical-align:top;font-family:monospace,'courier new'">Thank you in advance.</pre></div></div><div style="font-size:12.800000190734863px"><span style="color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:13px"><br></span></div><div style="font-size:12.800000190734863px"><span style="color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:13px">Best regards,</span></div><div style="font-size:12.800000190734863px"><span style="color:rgb(36,39,41);font-family:arial,'helvetica neue',helvetica,sans-serif;font-size:13px">Sareh Borhani</span></div></div></div>
<br>______________________________<wbr>_________________<br>
Rtk-users mailing list<br>
<a href="mailto:Rtk-users@public.kitware.com">Rtk-users@public.kitware.com</a><br>
<a href="http://public.kitware.com/mailman/listinfo/rtk-users" rel="noreferrer" target="_blank">http://public.kitware.com/<wbr>mailman/listinfo/rtk-users</a><br>
<br></blockquote></div><br></div>