<div dir="ltr"><div>Hi,</div><div>Apologies for not working on this before. I have updated the wiki page with the code adapted to the new wrapping. Look at the diff between the 2 versions to see the necessary modifications with the new wrappings.</div><div>I hope this (still) helps,<br></div><div>Simon</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 13, 2019 at 8:03 AM Amarnath S <<a href="mailto:amarnaths161@gmail.com">amarnaths161@gmail.com</a>> wrote:<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 dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hi,<br><div><br></div><div> Thanks for creating the Python version of RTK, and enabling us to get it via pip. I downloaded it yesterday, and successfully ran the First Reconstruction Python example.</div><div><br></div><div> Am now trying to convert the WaterPreCorrection example, which was earlier available using Simple RTK, on this page <a href="http://wiki.openrtk.org/index.php/WaterPreCorrection" target="_blank">http://wiki.openrtk.org/index.php/WaterPreCorrection</a></div><div><br></div><div> Am using the same dataset for this, as available in the archive "beam_hardening.tgz" available on the same page. However, am getting an error while running my code.</div><div><br></div><div>Have created a minimal code in Python, for getting the error, and it is given here.</div><div><div><br></div><div><font face="monospace, monospace" color="#741b47">import sys</font></div><div><font face="monospace, monospace" color="#741b47">import itk</font></div><div><font face="monospace, monospace" color="#741b47">from itk import RTK as rtk</font></div><div><font face="monospace, monospace" color="#741b47">import glob</font></div><div><font face="monospace, monospace" color="#741b47">import os</font></div><div><font face="monospace, monospace" color="#741b47"><br></font></div><div><font face="monospace, monospace" color="#741b47"># Script parameter</font></div><div><font face="monospace, monospace" color="#741b47">dir = "F:\\RTKDir\\output\\"</font></div><div><br></div><div><font face="monospace, monospace" color="#741b47"># List of filenames</font></div><div><font face="monospace, monospace" color="#741b47">fileNames = []</font></div><div><font face="monospace, monospace" color="#741b47">for file in os.listdir(dir):</font></div><div><font face="monospace, monospace" color="#741b47"> if file.startswith("attenuation") and file.endswith(".mha"):</font></div><div><font face="monospace, monospace" color="#741b47"> fileNames.append(dir + file)</font></div><div><font face="monospace, monospace" color="#741b47"><br></font></div><div><font face="monospace, monospace" color="#741b47">projReader = rtk.ProjectionsReader.New()</font></div><div><font face="monospace, monospace" color="#741b47">projReader.SetFileNames(fileNames)</font></div><div><font face="monospace, monospace" color="#741b47">print("Filenames set")</font></div><div><font face="monospace, monospace" color="#741b47"><br></font></div><div><span style="color:rgb(116,27,71);font-family:monospace,monospace">waterPre = rtk.WaterPrecorrectionImageFilter.New();</span><br></div><div><font face="monospace, monospace" color="#741b47">wpcoeffs = [0, 0, 0, 0, 0, 0, 1]</font></div><div><font face="monospace, monospace" color="#741b47">print("Water Pre defined")</font></div><div><font face="monospace, monospace" color="#741b47"><br></font></div><div><font face="monospace, monospace" color="#741b47">waterPre.SetCoefficients(wpcoeffs)</font></div><div><font face="monospace, monospace" color="#741b47">waterPre.SetInput(projReader.GetOutput())</font></div><div><font face="monospace, monospace" color="#741b47">print("Gives error on the above line - Expecting argument of type itkImageF3 or itkImageSourceIF3")</font></div></div><div><br></div><div>It gives error for the line where we set the input to waterPre, the last-but-one line of this script - <span style="color:rgb(116,27,71);font-family:monospace,monospace">waterPre.SetInput(projReader.GetOutput())</span>. The error message is <font face="monospace, monospace" color="#741b47">TypeError: Expecting argument of type itkImageF3 or itkImageSourceIF3.</font> As far as I know, I have replicated the code from the example available for SimpleRTK. Note, I have created a folder called F:\RTKDir\, which has the contents of the archive "beam_hardening.tgz" have been extracted there.</div><div><br></div><div>So, my questions are: </div><div>1. Have the input types been changed for the WaterPreCorrection Filter, since the posting of the earlier example?</div><div>2. If so, how can I specify projections as read in from 360 files as inputs to this filter?</div><div><br></div><div>Any pointers in this regard will be greatly appreciated.</div><div><br></div><div>Thanks and Regards</div><div>- Amarnath</div><div><br></div></div></div></div></div>
_______________________________________________<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="https://public.kitware.com/mailman/listinfo/rtk-users" rel="noreferrer" target="_blank">https://public.kitware.com/mailman/listinfo/rtk-users</a><br>
</blockquote></div>