<div dir="ltr"><div dir="ltr"><div>Before I run the script, I installed itk and itk-rtk using pip.<div>and then I copied

and pasted

 the whole script in FirstReconstruction.py in a jupyter notebook cell.<br>Do I need any additional installation to use rtk?</div><div><br></div><div>Thank you for your answer of second question.</div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2020년 4월 21일 (화) 오후 5:27, Aurélien Coussat <<a href="mailto:aurelien.coussat@creatis.insa-lyon.fr">aurelien.coussat@creatis.insa-lyon.fr</a>>님이 작성:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>On Tue, 2020-04-21 at 17:15 +0900, 나윤호 wrote:</div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div dir="ltr">Thank you for replying.<div><br>I'm pretty sure that I haven't changed anything in the example script.</div><div>What I just did is copy and paste and run it.</div></div></div></blockquote><div><br></div><div>What process did you follow in order to run it? Are you running it from a shell command line (as in "python FirstReconstruction.py") or from a Python command line (running "python" then copy-pasting everything) ? Could you provide the exact steps you followed in order to reproduce the problem?</div><div><br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div>and could you explain me how to translate(?) does documents into pythonic way?</div><div>(I don't know much about Clang)</div><div><br></div><div>for example, in the link you gave me it says </div><div><br></div><div><b><font size="4"><span style="color:rgb(0,0,0);font-family:Roboto,sans-serif;background-color:rgb(249,250,252)">rtk::FDKConeBeamReconstructionFilter< TInputImage, TOutputImage, TFFTPrecision > Class Template Reference</span>  </font></b><br></div><div><b><font size="4"><br></font></b></div><div>I empirically know that in python I have to type something like</div><div><br></div><div><b>rtk.FDKConeBeamReconstructionFilter[InputImage, OutputImage, FFTPrecision]</b></div><div><b><br></b></div><div>Am I right??</div></div></div></blockquote><div><br></div><div>Almost, but your intuition is correct! From rtkFDKConeBeamReconstructionFilter header file (<a href="http://www.openrtk.org/Doxygen/rtkFDKConeBeamReconstructionFilter_8h_source.html" target="_blank">http://www.openrtk.org/Doxygen/rtkFDKConeBeamReconstructionFilter_8h_source.html</a>), you can see that default values are already provided for TOutputImage and TFFTPrecision. From Python's point of view only a single argument is therefore required (TInputImage). You can see an example of FDKConeBeamReconstructionFilter starting from the 65th line of FirstReconstruction.py.</div><div><br></div><div>Good luck!</div><div><br></div><div>Aurélien.</div><div><br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">2020년 4월 21일 (화) 오후 4:58, Aurélien Coussat <<a href="mailto:aurelien.coussat@creatis.insa-lyon.fr" target="_blank">aurelien.coussat@creatis.insa-lyon.fr</a>>님이 작성:<br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div><div>Hi,</div><div><br></div><div>Your first error is really strange. The "geometry" variable is supposed to be typed as rtkThreeDCircularProjectionGeometry (defined line 14), while according to your error message it is of type rtkFDKConeBeamReconstructionFilter. Are you sure you haven't somehow altered the example script?</div><div><br></div><div>About your second question, you can use rtkFDKConeBeamReconstructionFilter and provide it a parallel geometry. See the documentation for more details : <a href="http://www.openrtk.org/Doxygen/classrtk_1_1FDKConeBeamReconstructionFilter.html" target="_blank">http://www.openrtk.org/Doxygen/classrtk_1_1FDKConeBeamReconstructionFilter.html</a>.</div><div><br></div><div>Don't hesitate if something remains unclear!</div><div><br></div><div>Aurélien.</div><div><br></div><div>On Tue, 2020-04-21 at 12:06 +0900, 나윤호 wrote:</div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><div dir="ltr"><font size="3">Hi.</font><div><font size="3">I'm a newbie to ITK and RTK.</font></div><div><font size="3">I'm currently using python not C++</font></div><div><font size="3"><br></font></div><div><font size="3">so I installed ITK package and RTK package using</font></div><div><br></div><div>pip install itk</div><div>pip install itk-rtk</div><div><br></div><div>using ITK seems OK,  but I'm having difficulties with RTK.</div><div><br></div><div>When I run the ITK example code, It worked well. </div><div>but when I tried to run the FirstReconstruction.py in the github,</div><div>error occurrs.</div><div><br></div><blockquote type="cite" style="margin:0px 0px 0px 0.8ex;border-left:2px solid rgb(114,159,207);padding-left:1ex"><pre style="box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;color:rgb(0,0,0);word-break:break-all;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><pre style="box-sizing:border-box;overflow:auto;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-break:break-all;border:0px;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><span style="box-sizing:border-box;color:rgb(178,43,49);font-weight:bold">---------------------------------------------------------------------------</span>
<span style="box-sizing:border-box;color:rgb(178,43,49);font-weight:bold">AttributeError</span>                            Traceback (most recent call last)
<span style="box-sizing:border-box;color:rgb(0,116,39);font-weight:bold"><ipython-input-1-be2ee9c70d3d></span> in <span style="box-sizing:border-box;color:rgb(96,198,200)"><module></span>
<span style="box-sizing:border-box;color:rgb(0,162,80)">     19</span> <span style="box-sizing:border-box;color:rgb(0,116,39);font-weight:bold">for</span> x <span style="box-sizing:border-box;color:rgb(0,116,39);font-weight:bold">in</span> range<span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">(</span><span style="box-sizing:border-box;color:rgb(37,143,143);font-weight:bold">0</span><span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">,</span>numberOfProjections<span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">)</span><span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">:</span>
<span style="box-sizing:border-box;color:rgb(0,162,80)">     20</span>   angle <span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">=</span> firstAngle <span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">+</span> x <span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">*</span> angularArc <span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">/</span> numberOfProjections
<span style="box-sizing:border-box;color:rgb(0,116,39);font-weight:bold">---> 21</span><span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">   </span>geometry<span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">.</span>AddProjection<span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">(</span>sid<span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">,</span>sdd<span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">,</span>angle<span style="box-sizing:border-box;color:rgb(178,125,18);font-weight:bold">)</span>
<span style="box-sizing:border-box;color:rgb(0,162,80)">     22</span> 
<span style="box-sizing:border-box;color:rgb(0,162,80)">     23</span> <span style="box-sizing:border-box;color:rgb(178,43,49);font-weight:bold"># Writing the geometry to disk</span>

<span style="box-sizing:border-box;color:rgb(178,43,49);font-weight:bold">AttributeError</span>: 'rtkFDKConeBeamReconstructionFilterIF3' object has no attribute 'AddProjection'</pre></pre><br></blockquote><div> </div><div>How can I fix this problem?</div><div><br></div><div>and I have another question.</div><div>I want the reconstruct the sinogram image to phantom.</div><div><br></div><div>usually what I did was using skimage.transform.iradon().</div><div>what should I use in RTK to do Inverse radon transform or Filtered back projection method?</div><div> </div><img width="0" height="0" alt="" style="display: flex;"></div>
<pre>_______________________________________________
Rtk-users mailing list
<a href="mailto:Rtk-users@public.kitware.com" target="_blank">Rtk-users@public.kitware.com</a>
<a href="https://public.kitware.com/mailman/listinfo/rtk-users" target="_blank">https://public.kitware.com/mailman/listinfo/rtk-users</a>
</pre></blockquote></div></blockquote></div><img width="0" height="0" alt="" style="display: flex;" src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"></div>
</blockquote></div></blockquote></div><img width="0" height="0" class="mailtrack-img" alt="" style="display:flex" src="https://mailtrack.io/trace/mail/2e489f9ef8f1dd25abfc2284627f031d61d8b75b.png?u=4672561"></div>