<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">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>