<div dir="ltr"><div>Thanks. This was a multi-threading problem which is now fixed by processing each projection at a time within a thread:</div><div><a href="https://github.com/SimonRit/RTK/commit/a719d8913beb7b6a39da787980ead720b353f545">https://github.com/SimonRit/RTK/commit/a719d8913beb7bé6a39da787980ead720b353f545</a></div><div>I don't really understand the number you gave but they should depend on the number of threads used by ITK. Normally, ITK splits the last dimension (here the number of projections) in almost equal pieces for each thread. So the last dimension of the processed region will depend on this...<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, May 9, 2020 at 11:08 AM Jerome Lesaint <<a href="mailto:lesaint.jerome@gmail.com">lesaint.jerome@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>See the code below.</div><div><br></div><div>I gave you a wrong information. Sorry. My stack has 720 projections and not 360. It actually works fine with 360. But fails with 720 !! <br></div><div>After a few trials, the behavior is really strange. It works with 13, 17, 23, 300, 301, 360, 361, 480. But it fails with 400 (13), 401 (13), 540 (17), 720 (23), 721 (23). In parentheses, the number which triggers the error (no 2s, 3s 5s in the prime decomp).</div><div><br></div><div>Jérome</div><div><br></div><div><br></div><div>-------------------------------------------------------------------</div><div>sid = 500<br>sdd = 1000<br><br>spacing = 1<br>nb_pixels = int(257/spacing)<br>nb_pixels_u = nb_pixels<br>nb_pixels_v = nb_pixels_u<br><br>geo_0 = rtk.ThreeDCircularProjectionGeometry.New()<br>for i in range(nprojs_0) :<br>    geo_0.AddProjection(sid,sdd,i)<br><br>ImageType = itk.Image[itk.F, 3]<br>const = rtk.ConstantImageSource[ImageType].New()<br>const.SetConstant(0.)<br>const.SetSpacing([spacing,spacing,spacing])<br>const.SetSize([nb_pixels_u,nb_pixels_v,len(geo_0.GetGantryAngles())])<br>const.SetOrigin(-0.5*spacing*(np.array(const.GetSize())-1))<br>sl = rtk.SheppLoganPhantomFilter[ImageType,ImageType].New()<br>sl.SetInput(const.GetOutput())<br>sl.SetGeometry(geo_0)<br>sl.SetPhantomScale(60)<br>        <br>sl.Update()<br><br>#weights = rtk.FDKWeightProjectionFilter[ImageType].New()<br>#weights.SetGeometry(geo_0)<br>#weights.SetInput(sl.GetOutput())<br>#weights.SetNumberOfWorkUnits(1)<br>#weights.InPlaceOff()<br><br>ramp = rtk.FFTRampImageFilter[ImageType,ImageType,itk.D].New()<br>ramp.SetInput(sl.GetOutput())<br>ramp.Update()<br></div><div><br></div><div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le ven. 8 mai 2020 à 22:15, Simon Rit <<a href="mailto:simon.rit@creatis.insa-lyon.fr" target="_blank">simon.rit@creatis.insa-lyon.fr</a>> a écrit :<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>Hi,</div><div>I cannot reproduce the issue with this code</div><div><br></div><div>import itk<br>from itk import RTK as rtk<br><br>ImageType = itk.Image[itk.F,3]<br><br>constantImageSource = rtk.ConstantImageSource[ImageType].New()<br>constantImageSource.SetOrigin( [ -127.875, -127.875, 0. ] )<br>constantImageSource.SetSpacing( [ .25 ] *3 )<br>constantImageSource.SetSize( [ 1024, 512, 360 ] )<br>constantImageSource.SetConstant(1.)<br><br>ramp = rtk.FFTRampImageFilter[ImageType, ImageType, itk.D].New()<br>ramp.SetInput(constantImageSource.GetOutput())<br>ramp.Update()</div><div><br></div><div>Can you tell me more on the pipeline you're using?</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, May 8, 2020 at 9:36 AM Jerome Lesaint <<a href="mailto:lesaint.jerome@gmail.com" target="_blank">lesaint.jerome@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">Salut,<br><div><br></div><div>thanks again for the answer. The streaming workaround seems to work.</div><div>As for the second solution you mentioned : actually there are 360 projections in my stack (not 23). 360 has only 2s, 3s and 5s in its prime decomp. Of course, 23 does not. But where this 23 comes form ???</div><div><br></div><div>Anyway, it works fine now. Thank you.</div><div>Jérome</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le jeu. 7 mai 2020 à 20:48, Simon Rit <<a href="mailto:simon.rit@creatis.insa-lyon.fr" target="_blank">simon.rit@creatis.insa-lyon.fr</a>> a écrit :<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>Hi,</div><div>Nope, sorry. We can't distribute the package with FFTW because its license does not allow it. What you can do is put an itkStreamingImageFilter after the fft ramp to process one projection at a time. Or add one empty projection after you 23d.</div><div>Let me know if we can help with one of the two options.</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, May 7, 2020 at 7:24 PM Jerome Lesaint <<a href="mailto:lesaint.jerome@gmail.com" target="_blank">lesaint.jerome@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">Hi,<div><br></div><div>I am trying to use the ramp filter FFTRampImageFilter and it fails at Update time with the error message :</div><div><br></div><div>itk::ERROR: VnlRealToHalfHermitianForwardFFTImageFilter(00000230EC986BA0): Cannot compute FFT of image with size [1024, 512, 23]. VnlRealToHalfHermitianForwardFFTImageFilter operates only on images whose size in each dimension has a prime factorization consisting of only 2s, 3s, or 5s.<br></div><div><br></div><div>I already read Simon's answer to a previous similar issue, saying that he recommends using FFTW by turning <span style="color:rgb(0,0,0);white-space:pre-wrap">ITK_USE_FFTW when building ITK. But I did not compile ITK (on this computer). I simply installed the pre-compiled Python package.</span></div><div><font color="#000000"><span style="white-space:pre-wrap">My question : can I turn any parameter in Python to force the ramp filter to use this library ?</span></font></div><div><br></div><div>Thanks in advance for your help,</div><div><br></div><div>Jérome </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>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>