From Yannick.Grondin at surgiqual-institute.com Mon May 4 03:39:58 2020 From: Yannick.Grondin at surgiqual-institute.com (Yannick Grondin) Date: Mon, 4 May 2020 09:39:58 +0200 Subject: [Rtk-users] problem with installing RTK and Python In-Reply-To: References: <005801d617ec$9cf85750$d6e905f0$@surgiqual-institute.com> Message-ID: <004101d621e7$37769a90$a663cfb0$@surgiqual-institute.com> Hi Simon, Thanks a lot, but it seems that you don?t have the wheel available for Windows OS ? Thanks, Yannick De : Simon Rit [mailto:simon.rit at creatis.insa-lyon.fr] Envoy? : mercredi 29 avril 2020 00:38 ? : Yannick Grondin Cc : rtk-users Objet : Re: [Rtk-users] problem with installing RTK and Python Hi Yannick, I have added 3.8 in a new PR . Our continuous integration has produced a python package which is available here . It seems to work and it depends on the new ITK 5.1 python package (which has not even been announced yet!). I hope this helps, Simon On Tue, Apr 28, 2020 at 5:17 PM Simon Rit wrote: Hi Yannick, Sorry for the late reply. Actually, we do not have a python 3.8 itk-rtk release yet. That's probably the problem here... We'll try to provide one asap! Simon On Tue, Apr 21, 2020 at 6:09 PM Yannick Grondin wrote: Hi all, I have a problem with installing ITK / RTK with Python I have done: pip install itk pip install itk-rtk (Python 3.8, sys 64 bits) I got the following output or error: pip list Package Version ---------------- ------- itk 5.0.1 itk-core 5.0.1 itk-filtering 5.0.1 itk-io 5.0.1 itk-numerics 5.0.1 itk-registration 5.0.1 itk-segmentation 5.0.1 numpy 1.18.3 packaging 20.3 pip 20.0.2 pyparsing 2.4.7 scikit-build 0.10.0 setuptools 41.2.0 six 1.14.0 wheel 0.34.2 PS C:\WINDOWS\system32> python -m pip install itk-rtk Collecting itk-rtk Using cached itk-rtk-2.0.1.zip (2.1 MB) ERROR: Command errored out with exit status 1: command: 'C:\Python38-x64\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\myUser\\AppData\\Local\\Temp\\pip-install-9fmwt65s\\itk-rtk\\setup.py'"'"'; __file__='"'"'C:\\Users\\myUser\\AppData\\Local\\Temp\\pip-install-9fmwt65s\\itk-rtk\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info' cwd: C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\ Complete output (8 lines): running egg_info creating C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info writing C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info\PKG-INFO writing dependency_links to C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info\dependency_links.txt writing requirements to C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info\requires.txt writing top-level names to C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info\top_level.txt writing manifest file 'C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info\SOURCES.txt' error: package directory 'itk' does not exist ---------------------------------------- ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. Can you see something wrong? Thanks, Y ____________________________ SQI_Logo_Mail Yannick Grondin, PhD Radiation Physics R&D Engineer http://www.surgiqual-institute.com/ +33 (0) 4 58 00 38 08 _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 22222 bytes Desc: not available URL: From lesaint.jerome at gmail.com Tue May 5 08:59:29 2020 From: lesaint.jerome at gmail.com (Jerome Lesaint) Date: Tue, 5 May 2020 14:59:29 +0200 Subject: [Rtk-users] Python Wrapping Message-ID: Dear all, I have build ITK with the ModuleRTK and ITK_WRAP_PYTHON flags set to ON. Everything seems to work fine except that some RTK filters are missing. E.G ADMMTotalVariationConeBeamReconstructionFilter is not available. Is it expected behavior ? Or have I missed something in the build process ? Far less critical : once the submodule RTK is loaded in python, the first call to any RTK object takes quiet a long time to execute. I also have a few warnings (like the one below) when this first call runs. Template itk::PyBuffer,2>> already defined as is redefined as Thanks in advance for your help, J?rome -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 5 09:30:00 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 5 May 2020 15:30:00 +0200 Subject: [Rtk-users] Python Wrapping In-Reply-To: References: Message-ID: Hi J?r?me, Not everything is wrapped in Python yet. To know if a filter should be wrapped, you can check if there is a corresponding file in the wrapping subdirectory. You can try to create one rtkADMMTotalVariationConeBeamReconstructionFilter.wrap file by copying rtkADMMWaveletsConeBeamReconstructionFilter.wrap and to just change the filter name. This wrapping could be tricky so let us know if does not work directly. It it does, please create a pull request! Cheers, Simon On Tue, May 5, 2020 at 3:00 PM Jerome Lesaint wrote: > Dear all, > > I have build ITK with the ModuleRTK and ITK_WRAP_PYTHON flags set to ON. > Everything seems to work fine except that some RTK filters are missing. > E.G ADMMTotalVariationConeBeamReconstructionFilter is not available. > > Is it expected behavior ? Or have I missed something in the build process ? > > Far less critical : once the submodule RTK is loaded in python, the first > call to any RTK object takes quiet a long time to execute. I also have a > few warnings (like the one below) when this first call runs. > > Template itk::PyBuffer,2>> > > already defined as > > is redefined as > > > Thanks in advance for your help, > > > J?rome > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 5 15:53:00 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 5 May 2020 21:53:00 +0200 Subject: [Rtk-users] Python Wrapping In-Reply-To: References: Message-ID: In my experience, it does not recompile everything but it does recompile a significant part but that's very variable depending on how much you change. If you want a better answer, I think you can ask what to expect to ITK guys on discourse . On Tue, May 5, 2020 at 3:48 PM Jerome Lesaint wrote: > Thanks Simon for the quick response. > One question before I give it a try : when re-building after creating the > .wrap file, does it only compiles the desired file or does it rebuild the > whole ITK again ? Sorry in advance for this probably stupid question, but > quite a different game... > In other words, can I try on one file or should I first check all the > missing filters that I need to recompile only once. > > Thanks, > J?rome > > Le mar. 5 mai 2020 ? 15:28, Simon Rit a > ?crit : > >> Hi J?r?me, >> Not everything is wrapped in Python yet. To know if a filter should be >> wrapped, you can check if there is a corresponding file in the wrapping >> subdirectory. You >> can try to create one >> rtkADMMTotalVariationConeBeamReconstructionFilter.wrap file by copying >> rtkADMMWaveletsConeBeamReconstructionFilter.wrap >> >> and to just change the filter name. This wrapping could be tricky so let us >> know if does not work directly. It it does, please create a pull request! >> Cheers, >> Simon >> >> >> On Tue, May 5, 2020 at 3:00 PM Jerome Lesaint >> wrote: >> >>> Dear all, >>> >>> I have build ITK with the ModuleRTK and ITK_WRAP_PYTHON flags set to ON. >>> Everything seems to work fine except that some RTK filters are missing. >>> E.G ADMMTotalVariationConeBeamReconstructionFilter is not available. >>> >>> Is it expected behavior ? Or have I missed something in the build >>> process ? >>> >>> Far less critical : once the submodule RTK is loaded in python, the >>> first call to any RTK object takes quiet a long time to execute. I also >>> have a few warnings (like the one below) when this first call runs. >>> >>> Template itk::PyBuffer,2>> >>> >>> already defined as >>> >>> is redefined as >>> >>> >>> Thanks in advance for your help, >>> >>> >>> J?rome >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at public.kitware.com >>> https://public.kitware.com/mailman/listinfo/rtk-users >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhehao.zhang at wustl.edu Tue May 5 18:01:50 2020 From: zhehao.zhang at wustl.edu (Zhang, Zhehao) Date: Tue, 5 May 2020 22:01:50 +0000 Subject: [Rtk-users] Trouble on the FirstReconstruction example Message-ID: Dear all, Hi! I am new to RTK and want to use it on Python. So I installed RTK through pip, like pip install itk pip install itk-rtk I think the examples for ITK work well. However, when I tried to run the FirstReconstruction example for RTK, some trouble have stopped me for a while. I used the order ?python FirstReconstruction.py test.mha geometry.xml? to run the given Python code, but I continued to get the error Traceback (most recent call last): File "FirstReconstruction.py", line 88, in writer.Update() RuntimeError: C:\P\IPP\standalone-build\ITKs\Modules\Core\Common\src\itkProcessObject.cxx:1400: itk::ERROR: FieldOfViewImageFilter(000001C546A88980): Input Primary is required but not set. Additionally, this ?Input Primary is required but not set? error also occurred in some other examples, on both Windows and Ubuntu systems. I have no idea how to solve it. Could you please help me out? Thank you very much. Sincerely, Zhehao -------------- next part -------------- An HTML attachment was scrubbed... URL: From aurelien.coussat at creatis.insa-lyon.fr Wed May 6 03:27:04 2020 From: aurelien.coussat at creatis.insa-lyon.fr (=?ISO-8859-1?Q?Aur=E9lien?= Coussat) Date: Wed, 06 May 2020 09:27:04 +0200 Subject: [Rtk-users] Trouble on the FirstReconstruction example In-Reply-To: References: Message-ID: <1588750024.3209.1.camel@creatis.insa-lyon.fr> Hi, I cannot reproduce the problem. Are you sure you haven't altered FirstReconstruction.py in any way? Could you provide the exact content of the file? Thank you! Aur?lien. On Tue, 2020-05-05 at 22:01 +0000, Zhang, Zhehao wrote: > Dear all, > > Hi! I am new to RTK and want to use it on Python. So I installed RTK > through pip, like > pip install itk > pip install itk-rtk > > I think the examples for ITK work well. However, when I tried to run > the FirstReconstruction example for RTK, some trouble have stopped me > for a while. > I used the order ?python FirstReconstruction.py test.mha > geometry.xml? to run the given Python code, but I continued to get > the error > > Traceback (most recent call last): > File "FirstReconstruction.py", line 88, in > writer.Update() > RuntimeError: C:\P\IPP\standalone- > build\ITKs\Modules\Core\Common\src\itkProcessObject.cxx:1400: > itk::ERROR: FieldOfViewImageFilter(000001C546A88980): Input Primary > is required but not set. > > Additionally, this ?Input Primary is required but not set? error also > occurred in some other examples, on both Windows and Ubuntu systems. > I have no idea how to solve it. Could you please help me out? > > > Thank you very much. > > Sincerely, > Zhehao > > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Wed May 6 04:11:38 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 6 May 2020 10:11:38 +0200 Subject: [Rtk-users] Trouble on the FirstReconstruction example In-Reply-To: <1588750024.3209.1.camel@creatis.insa-lyon.fr> References: <1588750024.3209.1.camel@creatis.insa-lyon.fr> Message-ID: Hi, Thanks for the report, I can reproduce the problem. Actually, ITK recently updated their packages and it seems that our old packages are not compatible with the new ones. We will release new ones soon but in the mean time, you should use an older version of ITK packages (5.0.1) or use a package built by our CI, e.g. one those available here: https://dev.azure.com/simonrit/RTK/_build/results?buildId=477&view=artifacts&type=publishedArtifacts Best regards, Simon On Wed, May 6, 2020 at 9:27 AM Aur?lien Coussat < aurelien.coussat at creatis.insa-lyon.fr> wrote: > Hi, > > I cannot reproduce the problem. Are you sure you haven't altered > FirstReconstruction.py in any way? Could you provide the exact content of > the file? > > Thank you! > > Aur?lien. > > On Tue, 2020-05-05 at 22:01 +0000, Zhang, Zhehao wrote: > > Dear all, > > > > Hi! I am new to RTK and want to use it on Python. So I installed RTK > through pip, like > > pip install itk > > pip install itk-rtk > > > > I think the examples for ITK work well. However, when I tried to run the > FirstReconstruction example for RTK, some trouble have stopped me for a > while. > > I used the order ?python FirstReconstruction.py test.mha geometry.xml? to > run the given Python code, but I continued to get the error > > > > Traceback (most recent call last): > > File "FirstReconstruction.py", line 88, in > > writer.Update() > > RuntimeError: > C:\P\IPP\standalone-build\ITKs\Modules\Core\Common\src\itkProcessObject.cxx:1400: > > itk::ERROR: FieldOfViewImageFilter(000001C546A88980): Input Primary is > required but not set. > > > > Additionally, this ?Input Primary is required but not set? error also > occurred in some other examples, on both Windows and Ubuntu systems. I have > no idea how to solve it. Could you please help me out? > > > > Thank you very much. > > > > Sincerely, > > Zhehao > > > > _______________________________________________ > Rtk-users mailing listRtk-users at public.kitware.comhttps://public.kitware.com/mailman/listinfo/rtk-users > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lesaint.jerome at gmail.com Wed May 6 04:19:05 2020 From: lesaint.jerome at gmail.com (Jerome Lesaint) Date: Wed, 6 May 2020 10:19:05 +0200 Subject: [Rtk-users] Python Wrapping In-Reply-To: References: Message-ID: Ok, thanks! Just to let you know : I only added a rtkADMMTV[...].wrap file and built. It recompiles ALL the wrappings but ONLY them. As you suspected, the guy is a tricky one. It failed to compile with the attached log. Should I log anything to put this in the development pipeline ? Thanks again for your help, J?rome Le mar. 5 mai 2020 ? 21:51, Simon Rit a ?crit : > In my experience, it does not recompile everything but it does recompile a > significant part but that's very variable depending on how much you change. > If you want a better answer, I think you can ask what to expect to ITK guys > on discourse . > > On Tue, May 5, 2020 at 3:48 PM Jerome Lesaint > wrote: > >> Thanks Simon for the quick response. >> One question before I give it a try : when re-building after creating the >> .wrap file, does it only compiles the desired file or does it rebuild the >> whole ITK again ? Sorry in advance for this probably stupid question, but >> quite a different game... >> In other words, can I try on one file or should I first check all the >> missing filters that I need to recompile only once. >> >> Thanks, >> J?rome >> >> Le mar. 5 mai 2020 ? 15:28, Simon Rit a >> ?crit : >> >>> Hi J?r?me, >>> Not everything is wrapped in Python yet. To know if a filter should be >>> wrapped, you can check if there is a corresponding file in the wrapping >>> subdirectory. >>> You can try to create one >>> rtkADMMTotalVariationConeBeamReconstructionFilter.wrap file by copying >>> rtkADMMWaveletsConeBeamReconstructionFilter.wrap >>> >>> and to just change the filter name. This wrapping could be tricky so let us >>> know if does not work directly. It it does, please create a pull request! >>> Cheers, >>> Simon >>> >>> >>> On Tue, May 5, 2020 at 3:00 PM Jerome Lesaint >>> wrote: >>> >>>> Dear all, >>>> >>>> I have build ITK with the ModuleRTK and ITK_WRAP_PYTHON flags set to ON. >>>> Everything seems to work fine except that some RTK filters are missing. >>>> E.G ADMMTotalVariationConeBeamReconstructionFilter is not available. >>>> >>>> Is it expected behavior ? Or have I missed something in the build >>>> process ? >>>> >>>> Far less critical : once the submodule RTK is loaded in python, the >>>> first call to any RTK object takes quiet a long time to execute. I also >>>> have a few warnings (like the one below) when this first call runs. >>>> >>>> Template itk::PyBuffer,2>> >>>> >>>> already defined as >>>> >>>> is redefined as >>>> >>>> >>>> Thanks in advance for your help, >>>> >>>> >>>> J?rome >>>> _______________________________________________ >>>> Rtk-users mailing list >>>> Rtk-users at public.kitware.com >>>> https://public.kitware.com/mailman/listinfo/rtk-users >>>> >>> -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: log Type: application/octet-stream Size: 11402 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Wed May 6 10:16:49 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 6 May 2020 16:16:49 +0200 Subject: [Rtk-users] problem with installing RTK and Python In-Reply-To: <004101d621e7$37769a90$a663cfb0$@surgiqual-institute.com> References: <005801d617ec$9cf85750$d6e905f0$@surgiqual-institute.com> <004101d621e7$37769a90$a663cfb0$@surgiqual-institute.com> Message-ID: Hi Yannick, I have managed to compile them for Windows, available here: https://dev.azure.com/simonrit/RTK/_build/results?buildId=477&view=artifacts&type=publishedArtifacts Can you let me know if they are functional? I don't have a Windows machine with me... Thanks, Simon On Mon, May 4, 2020 at 9:49 AM Yannick Grondin < Yannick.Grondin at surgiqual-institute.com> wrote: > Hi Simon, > > > > Thanks a lot, but it seems that you don?t have the wheel available for > Windows OS ? > > > > Thanks, > > > > Yannick > > > > *De :* Simon Rit [mailto:simon.rit at creatis.insa-lyon.fr] > *Envoy? :* mercredi 29 avril 2020 00:38 > *? :* Yannick Grondin > *Cc :* rtk-users > *Objet :* Re: [Rtk-users] problem with installing RTK and Python > > > > Hi Yannick, > > I have added 3.8 in a new PR . > Our continuous integration has produced a python package which is available > here > . > It seems to work and it depends on the new ITK 5.1 python package (which > has not even been announced yet!). > > I hope this helps, > > Simon > > > > On Tue, Apr 28, 2020 at 5:17 PM Simon Rit > wrote: > > Hi Yannick, > > Sorry for the late reply. Actually, we do not have a python 3.8 itk-rtk > release yet. That's probably the problem here... > > We'll try to provide one asap! > > Simon > > > > On Tue, Apr 21, 2020 at 6:09 PM Yannick Grondin < > Yannick.Grondin at surgiqual-institute.com> wrote: > > Hi all, > > I have a problem with installing ITK / RTK with Python > > > > I have done: > > pip install itk > > pip install itk-rtk > > (Python 3.8, sys 64 bits) > > > > I got the following output or error: > > > > pip list > > Package Version > > ---------------- ------- > > itk 5.0.1 > > itk-core 5.0.1 > > itk-filtering 5.0.1 > > itk-io 5.0.1 > > itk-numerics 5.0.1 > > itk-registration 5.0.1 > > itk-segmentation 5.0.1 > > numpy 1.18.3 > > packaging 20.3 > > pip 20.0.2 > > pyparsing 2.4.7 > > scikit-build 0.10.0 > > setuptools 41.2.0 > > six 1.14.0 > > wheel 0.34.2 > > > > PS C:\WINDOWS\system32> python -m pip install itk-rtk > > Collecting itk-rtk > > Using cached itk-rtk-2.0.1.zip (2.1 MB) > > ERROR: Command errored out with exit status 1: > > command: 'C:\Python38-x64\python.exe' -c 'import sys, setuptools, > tokenize; sys.argv[0] = > '"'"'C:\\Users\\myUser\\AppData\\Local\\Temp\\pip-install-9fmwt65s\\itk-rtk\\setup.py'"'"'; > __file__='"'"'C:\\Users\\myUser\\AppData\\Local\\Temp\\pip-install-9fmwt65s\\itk-rtk\\setup.py'"'"';f=getattr(tokenize, > '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', > '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' > egg_info --egg-base > 'C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info' > > cwd: > C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\ > > Complete output (8 lines): > > running egg_info > > creating > C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info > > writing > C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info\PKG-INFO > > writing dependency_links to > C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info\dependency_links.txt > > writing requirements to > C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info\requires.txt > > writing top-level names to > C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info\top_level.txt > > writing manifest file > 'C:\Users\myUser\AppData\Local\Temp\pip-install-9fmwt65s\itk-rtk\pip-egg-info\itk_rtk.egg-info\SOURCES.txt' > > error: package directory 'itk' does not exist > > ---------------------------------------- > > ERROR: Command errored out with exit status 1: python setup.py egg_info > Check the logs for full command output. > > > > Can you see something wrong? > > Thanks, > > Y > > ____________________________ > > [image: SQI_Logo_Mail] > > *Yannick Grondin, PhD* > > *Radiation Physics R&D Engineer* > > http://www.surgiqual-institute.com/ > > +33 (0) 4 58 00 38 08 > > > > > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 22222 bytes Desc: not available URL: From zhehao.zhang at wustl.edu Wed May 6 19:30:47 2020 From: zhehao.zhang at wustl.edu (Zhang, Zhehao) Date: Wed, 6 May 2020 23:30:47 +0000 Subject: [Rtk-users] Trouble on the FirstReconstruction example In-Reply-To: References: <1588750024.3209.1.camel@creatis.insa-lyon.fr>, Message-ID: Hi, thank you so much for your kind help. Now I can run the example successfully after reinstalling itk-rtk with the given wheel. Best, Zhehao From: Simon Rit Sent: Wednesday, May 6, 2020 3:11:38 AM To: Aur?lien Coussat Cc: Zhang, Zhehao ; rtk-users at public.kitware.com Subject: Re: [Rtk-users] Trouble on the FirstReconstruction example Hi, Thanks for the report, I can reproduce the problem. Actually, ITK recently updated their packages and it seems that our old packages are not compatible with the new ones. We will release new ones soon but in the mean time, you should use an older version of ITK packages (5.0.1) or use a package built by our CI, e.g. one those available here: https://dev.azure.com/simonrit/RTK/_build/results?buildId=477&view=artifacts&type=publishedArtifacts Best regards, Simon On Wed, May 6, 2020 at 9:27 AM Aur?lien Coussat > wrote: Hi, I cannot reproduce the problem. Are you sure you haven't altered FirstReconstruction.py in any way? Could you provide the exact content of the file? Thank you! Aur?lien. On Tue, 2020-05-05 at 22:01 +0000, Zhang, Zhehao wrote: Dear all, Hi! I am new to RTK and want to use it on Python. So I installed RTK through pip, like pip install itk pip install itk-rtk I think the examples for ITK work well. However, when I tried to run the FirstReconstruction example for RTK, some trouble have stopped me for a while. I used the order ?python FirstReconstruction.py test.mha geometry.xml? to run the given Python code, but I continued to get the error Traceback (most recent call last): File "FirstReconstruction.py", line 88, in writer.Update() RuntimeError: C:\P\IPP\standalone-build\ITKs\Modules\Core\Common\src\itkProcessObject.cxx:1400: itk::ERROR: FieldOfViewImageFilter(000001C546A88980): Input Primary is required but not set. Additionally, this ?Input Primary is required but not set? error also occurred in some other examples, on both Windows and Ubuntu systems. I have no idea how to solve it. Could you please help me out? Thank you very much. Sincerely, Zhehao _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users From: Simon Rit Sent: Wednesday, May 6, 2020 3:10 AM Subject: Re: [Rtk-users] Trouble on the FirstReconstruction example Hi, Thanks for the report, I can reproduce the problem. Actually, ITK recently updated their packages and it seems that our old packages are not compatible with the new ones. We will release new ones soon but in the mean time, you should use an older version of ITK packages (5.0.1) or use a package built by our CI, e.g. one those available here: https://dev.azure.com/simonrit/RTK/_build/results?buildId=477&view=artifacts&type=publishedArtifacts Best regards, Simon On Wed, May 6, 2020 at 9:27 AM Aur?lien Coussat > wrote: Hi, I cannot reproduce the problem. Are you sure you haven't altered FirstReconstruction.py in any way? Could you provide the exact content of the file? Thank you! Aur?lien. On Tue, 2020-05-05 at 22:01 +0000, Zhang, Zhehao wrote: Dear all, Hi! I am new to RTK and want to use it on Python. So I installed RTK through pip, like pip install itk pip install itk-rtk I think the examples for ITK work well. However, when I tried to run the FirstReconstruction example for RTK, some trouble have stopped me for a while. I used the order ?python FirstReconstruction.py test.mha geometry.xml? to run the given Python code, but I continued to get the error Traceback (most recent call last): File "FirstReconstruction.py", line 88, in writer.Update() RuntimeError: C:\P\IPP\standalone-build\ITKs\Modules\Core\Common\src\itkProcessObject.cxx:1400: itk::ERROR: FieldOfViewImageFilter(000001C546A88980): Input Primary is required but not set. Additionally, this ?Input Primary is required but not set? error also occurred in some other examples, on both Windows and Ubuntu systems. I have no idea how to solve it. Could you please help me out? Thank you very much. Sincerely, Zhehao _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: FFC5EAA3D8CE4B95A2F42B05276E3605.png Type: image/png Size: 143 bytes Desc: FFC5EAA3D8CE4B95A2F42B05276E3605.png URL: From yoonho94.na at gmail.com Thu May 7 03:36:55 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Thu, 7 May 2020 16:36:55 +0900 Subject: [Rtk-users] RTK installation problem Message-ID: Hi, RTK Users. I have problem with installing RTK I downloaded zip file from Github. and while I tried to configure with Cmake, It gets error. I do not know how to solve this problem. In the cmake option ITK_DIR the value is where my ITK binarys are at. [image: cmake.jpg] -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: cmake.jpg Type: image/jpeg Size: 147520 bytes Desc: not available URL: From andreasga22 at gmail.com Thu May 7 04:58:16 2020 From: andreasga22 at gmail.com (Andreas Andersen) Date: Thu, 7 May 2020 10:58:16 +0200 Subject: [Rtk-users] RTK installation problem In-Reply-To: References: Message-ID: Looks like an encoding problem to me. Try replacing backslashes (\) with forward slashes (/), for ITK_DIR, it looks strange in your image. Also, it's much easier to compile RTK as part of ITK, with "Module_RTK" set to "ON". Instead of configuring and compiling them separately. /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Thu, 7 May 2020 at 09:37, ??? wrote: > Hi, RTK Users. > > I have problem with installing RTK > > I downloaded zip file from Github. > > and while I tried to configure with Cmake, It gets error. > > I do not know how to solve this problem. > > In the cmake option ITK_DIR the value is where my ITK binarys are at. > > > [image: cmake.jpg] > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: cmake.jpg Type: image/jpeg Size: 147520 bytes Desc: not available URL: From lesaint.jerome at gmail.com Thu May 7 13:24:08 2020 From: lesaint.jerome at gmail.com (Jerome Lesaint) Date: Thu, 7 May 2020 19:24:08 +0200 Subject: [Rtk-users] Error in the FFTRampImpageFilter Message-ID: Hi, I am trying to use the ramp filter FFTRampImageFilter and it fails at Update time with the error message : 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. I already read Simon's answer to a previous similar issue, saying that he recommends using FFTW by turning ITK_USE_FFTW when building ITK. But I did not compile ITK (on this computer). I simply installed the pre-compiled Python package. My question : can I turn any parameter in Python to force the ramp filter to use this library ? Thanks in advance for your help, J?rome -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 7 14:50:33 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 7 May 2020 20:50:33 +0200 Subject: [Rtk-users] Error in the FFTRampImpageFilter In-Reply-To: References: Message-ID: Hi, 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. Let me know if we can help with one of the two options. Simon On Thu, May 7, 2020 at 7:24 PM Jerome Lesaint wrote: > Hi, > > I am trying to use the ramp filter FFTRampImageFilter and it fails at > Update time with the error message : > > 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. > > I already read Simon's answer to a previous similar issue, saying that he > recommends using FFTW by turning ITK_USE_FFTW when building ITK. But I > did not compile ITK (on this computer). I simply installed the pre-compiled > Python package. > My question : can I turn any parameter in Python to force the ramp filter > to use this library ? > > Thanks in advance for your help, > > J?rome > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From lesaint.jerome at gmail.com Fri May 8 03:35:46 2020 From: lesaint.jerome at gmail.com (Jerome Lesaint) Date: Fri, 8 May 2020 09:35:46 +0200 Subject: [Rtk-users] Error in the FFTRampImpageFilter In-Reply-To: References: Message-ID: Salut, thanks again for the answer. The streaming workaround seems to work. 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 ??? Anyway, it works fine now. Thank you. J?rome Le jeu. 7 mai 2020 ? 20:48, Simon Rit a ?crit : > Hi, > 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. > Let me know if we can help with one of the two options. > Simon > > On Thu, May 7, 2020 at 7:24 PM Jerome Lesaint > wrote: > >> Hi, >> >> I am trying to use the ramp filter FFTRampImageFilter and it fails at >> Update time with the error message : >> >> 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. >> >> I already read Simon's answer to a previous similar issue, saying that he >> recommends using FFTW by turning ITK_USE_FFTW when building ITK. But I >> did not compile ITK (on this computer). I simply installed the pre-compiled >> Python package. >> My question : can I turn any parameter in Python to force the ramp filter >> to use this library ? >> >> Thanks in advance for your help, >> >> J?rome >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> https://public.kitware.com/mailman/listinfo/rtk-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 8 16:16:42 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 8 May 2020 22:16:42 +0200 Subject: [Rtk-users] Error in the FFTRampImpageFilter In-Reply-To: References: Message-ID: Hi, I cannot reproduce the issue with this code import itk from itk import RTK as rtk ImageType = itk.Image[itk.F,3] constantImageSource = rtk.ConstantImageSource[ImageType].New() constantImageSource.SetOrigin( [ -127.875, -127.875, 0. ] ) constantImageSource.SetSpacing( [ .25 ] *3 ) constantImageSource.SetSize( [ 1024, 512, 360 ] ) constantImageSource.SetConstant(1.) ramp = rtk.FFTRampImageFilter[ImageType, ImageType, itk.D].New() ramp.SetInput(constantImageSource.GetOutput()) ramp.Update() Can you tell me more on the pipeline you're using? Simon On Fri, May 8, 2020 at 9:36 AM Jerome Lesaint wrote: > Salut, > > thanks again for the answer. The streaming workaround seems to work. > 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 ??? > > Anyway, it works fine now. Thank you. > J?rome > > > Le jeu. 7 mai 2020 ? 20:48, Simon Rit a > ?crit : > >> Hi, >> 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. >> Let me know if we can help with one of the two options. >> Simon >> >> On Thu, May 7, 2020 at 7:24 PM Jerome Lesaint >> wrote: >> >>> Hi, >>> >>> I am trying to use the ramp filter FFTRampImageFilter and it fails at >>> Update time with the error message : >>> >>> 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. >>> >>> I already read Simon's answer to a previous similar issue, saying that >>> he recommends using FFTW by turning ITK_USE_FFTW when building ITK. But >>> I did not compile ITK (on this computer). I simply installed the >>> pre-compiled Python package. >>> My question : can I turn any parameter in Python to force the ramp >>> filter to use this library ? >>> >>> Thanks in advance for your help, >>> >>> J?rome >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at public.kitware.com >>> https://public.kitware.com/mailman/listinfo/rtk-users >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoonho94.na at gmail.com Sat May 9 21:13:29 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Sun, 10 May 2020 10:13:29 +0900 Subject: [Rtk-users] first time building rtk Message-ID: Hi everyone. I'm trying to build RTK. My ITK version is v5.1.0 when I build the ITK, also checked the Moduel_RTK to get the RTK module. and this is the error what I got. how can I fix this problem?? Error MSB6006 "CL.exe" exited with code 2. rtkcheckimagequality Microsoft.CppCommon.targets Error C2039 'verbose_flag': is not a member of 'args_info_rtkcheckimagequality' rtkcheckimagequality rtkGgoArgsInfoManager.h -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Sun May 10 04:25:18 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 10 May 2020 10:25:18 +0200 Subject: [Rtk-users] first time building rtk In-Reply-To: References: Message-ID: Hi, There was a problem indeed when compiling with the RTK_PROBE_EACH_FILTER option. This has been fixed in a commit following the one in ITK. Either deactivate this option or set Module_RTK_GIT_TAG to the master HEAD (currently 6c5d5c2a25a2dd15d3b5ae1d2b9e6f8360b2208d). Simon On Sun, May 10, 2020 at 3:14 AM ??? wrote: > Hi everyone. > I'm trying to build RTK. > My ITK version is v5.1.0 > > when I build the ITK, also checked the Moduel_RTK to get the RTK module. > and this is the error what I got. > how can I fix this problem?? > > Error MSB6006 "CL.exe" exited with code 2. > rtkcheckimagequality > Microsoft.CppCommon.targets > Error C2039 'verbose_flag': is not a member of > 'args_info_rtkcheckimagequality' rtkcheckimagequality > rtkGgoArgsInfoManager.h > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoonho94.na at gmail.com Mon May 11 00:50:51 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Mon, 11 May 2020 13:50:51 +0900 Subject: [Rtk-users] building FirstConstruction Message-ID: Hi. I have installed ITK and RTK. and I want to do the first reconstruction example. I already made CMakeLists.txt and FirstReconstruction.cxx in one directory. and than use Cmake to get binary. when I opened FirstReconstruction.sln and build it, It didn't get any output from it. doesn't it has to get an output named output.mha? Yoonho. -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoonho94.na at gmail.com Mon May 11 01:51:01 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Mon, 11 May 2020 14:51:01 +0900 Subject: [Rtk-users] building FirstConstruction In-Reply-To: References: Message-ID: I just found out that FirstReconstruction.exe immediately closes as soon as I open it. why is this happening? 2020? 5? 11? (?) ?? 1:50, ??? ?? ??: > Hi. > I have installed ITK and RTK. > and I want to do the first reconstruction example. > > I already made CMakeLists.txt and FirstReconstruction.cxx in one directory. > and than use Cmake to get binary. > > when I opened FirstReconstruction.sln and build it, It didn't get any > output from it. > doesn't it has to get an output named output.mha? > > > Yoonho. > [image: image.gif] > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.gif Type: image/gif Size: 42 bytes Desc: not available URL: From yoonho94.na at gmail.com Mon May 11 03:44:09 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Mon, 11 May 2020 16:44:09 +0900 Subject: [Rtk-users] what does ggo file do? Message-ID: in the RTK git hub there is a file, RTK/applications/rtkforwardprojections/rtkforwardprojections.ggo I don't know how to use this. what I'm guessing is in the rtkforwardprojections.cxx, there is a script written like this GGO(rtkforwardprojections, args_info); and it is something to do with that script. what actually does that file do? -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 11 03:48:18 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 11 May 2020 09:48:18 +0200 Subject: [Rtk-users] building FirstConstruction In-Reply-To: References: Message-ID: Hi, This is a command line tool, run it from a shell and you'll get usage information. Simon On Mon, May 11, 2020 at 7:51 AM ??? wrote: > I just found out that FirstReconstruction.exe immediately closes as soon > as I open it. > > why is this happening? > > > > 2020? 5? 11? (?) ?? 1:50, ??? ?? ??: > >> Hi. >> I have installed ITK and RTK. >> and I want to do the first reconstruction example. >> >> I already made CMakeLists.txt and FirstReconstruction.cxx in one >> directory. >> and than use Cmake to get binary. >> >> when I opened FirstReconstruction.sln and build it, It didn't get any >> output from it. >> doesn't it has to get an output named output.mha? >> >> >> Yoonho. >> [image: image.gif] >> > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.gif Type: image/gif Size: 42 bytes Desc: not available URL: From simon.rit at creatis.insa-lyon.fr Mon May 11 03:49:37 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 11 May 2020 09:49:37 +0200 Subject: [Rtk-users] what does ggo file do? In-Reply-To: References: Message-ID: This is a parameter file for gengetopt which is a tool for parsing the command line. See here . GGO is a macro which groups a number of commands that are systematically applied to RTK command line tools. Simon On Mon, May 11, 2020 at 9:44 AM ??? wrote: > in the RTK git hub > there is a file, > > RTK/applications/rtkforwardprojections/rtkforwardprojections.ggo > > I don't know how to use this. > > what I'm guessing is in the rtkforwardprojections.cxx, there is a script > written like this > > GGO(rtkforwardprojections, args_info); > > and it is something to do with that script. > > what actually does that file do? > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 11 09:23:00 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Mon, 11 May 2020 15:23:00 +0200 Subject: [Rtk-users] Python Wrapping In-Reply-To: References: Message-ID: Thanks. I have fixed the issues which came from the fact we never built it with the double type and it was not working as expected. The patch is here and the python packages are available here . On Wed, May 6, 2020 at 10:19 AM Jerome Lesaint wrote: > Ok, thanks! > > Just to let you know : I only added a rtkADMMTV[...].wrap file and built. > It recompiles ALL the wrappings but ONLY them. > As you suspected, the guy is a tricky one. It failed to compile with the > attached log. > > Should I log anything to put this in the development pipeline ? > Thanks again for your help, > J?rome > > > > Le mar. 5 mai 2020 ? 21:51, Simon Rit a > ?crit : > >> In my experience, it does not recompile everything but it does recompile >> a significant part but that's very variable depending on how much you >> change. If you want a better answer, I think you can ask what to expect to >> ITK guys on discourse . >> >> On Tue, May 5, 2020 at 3:48 PM Jerome Lesaint >> wrote: >> >>> Thanks Simon for the quick response. >>> One question before I give it a try : when re-building after creating >>> the .wrap file, does it only compiles the desired file or does it rebuild >>> the whole ITK again ? Sorry in advance for this probably stupid question, >>> but quite a different game... >>> In other words, can I try on one file or should I first check all the >>> missing filters that I need to recompile only once. >>> >>> Thanks, >>> J?rome >>> >>> Le mar. 5 mai 2020 ? 15:28, Simon Rit >>> a ?crit : >>> >>>> Hi J?r?me, >>>> Not everything is wrapped in Python yet. To know if a filter should be >>>> wrapped, you can check if there is a corresponding file in the wrapping >>>> subdirectory. >>>> You can try to create one >>>> rtkADMMTotalVariationConeBeamReconstructionFilter.wrap file by copying >>>> rtkADMMWaveletsConeBeamReconstructionFilter.wrap >>>> >>>> and to just change the filter name. This wrapping could be tricky so let us >>>> know if does not work directly. It it does, please create a pull request! >>>> Cheers, >>>> Simon >>>> >>>> >>>> On Tue, May 5, 2020 at 3:00 PM Jerome Lesaint >>>> wrote: >>>> >>>>> Dear all, >>>>> >>>>> I have build ITK with the ModuleRTK and ITK_WRAP_PYTHON flags set to >>>>> ON. >>>>> Everything seems to work fine except that some RTK filters are >>>>> missing. E.G ADMMTotalVariationConeBeamReconstructionFilter is not >>>>> available. >>>>> >>>>> Is it expected behavior ? Or have I missed something in the build >>>>> process ? >>>>> >>>>> Far less critical : once the submodule RTK is loaded in python, the >>>>> first call to any RTK object takes quiet a long time to execute. I also >>>>> have a few warnings (like the one below) when this first call runs. >>>>> >>>>> Template itk::PyBuffer,2>> >>>>> >>>>> already defined as >>>>> >>>>> is redefined as >>>>> >>>>> >>>>> Thanks in advance for your help, >>>>> >>>>> >>>>> J?rome >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at public.kitware.com >>>>> https://public.kitware.com/mailman/listinfo/rtk-users >>>>> >>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Tue May 12 19:09:11 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 13 May 2020 01:09:11 +0200 Subject: [Rtk-users] Error in the FFTRampImpageFilter In-Reply-To: References: Message-ID: Thanks. This was a multi-threading problem which is now fixed by processing each projection at a time within a thread: https://github.com/SimonRit/RTK/commit/a719d8913beb7b?6a39da787980ead720b353f545 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... On Sat, May 9, 2020 at 11:08 AM Jerome Lesaint wrote: > See the code below. > > 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 !! > 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). > > J?rome > > > ------------------------------------------------------------------- > sid = 500 > sdd = 1000 > > spacing = 1 > nb_pixels = int(257/spacing) > nb_pixels_u = nb_pixels > nb_pixels_v = nb_pixels_u > > geo_0 = rtk.ThreeDCircularProjectionGeometry.New() > for i in range(nprojs_0) : > geo_0.AddProjection(sid,sdd,i) > > ImageType = itk.Image[itk.F, 3] > const = rtk.ConstantImageSource[ImageType].New() > const.SetConstant(0.) > const.SetSpacing([spacing,spacing,spacing]) > const.SetSize([nb_pixels_u,nb_pixels_v,len(geo_0.GetGantryAngles())]) > const.SetOrigin(-0.5*spacing*(np.array(const.GetSize())-1)) > sl = rtk.SheppLoganPhantomFilter[ImageType,ImageType].New() > sl.SetInput(const.GetOutput()) > sl.SetGeometry(geo_0) > sl.SetPhantomScale(60) > > sl.Update() > > #weights = rtk.FDKWeightProjectionFilter[ImageType].New() > #weights.SetGeometry(geo_0) > #weights.SetInput(sl.GetOutput()) > #weights.SetNumberOfWorkUnits(1) > #weights.InPlaceOff() > > ramp = rtk.FFTRampImageFilter[ImageType,ImageType,itk.D].New() > ramp.SetInput(sl.GetOutput()) > ramp.Update() > > > Le ven. 8 mai 2020 ? 22:15, Simon Rit a > ?crit : > >> Hi, >> I cannot reproduce the issue with this code >> >> import itk >> from itk import RTK as rtk >> >> ImageType = itk.Image[itk.F,3] >> >> constantImageSource = rtk.ConstantImageSource[ImageType].New() >> constantImageSource.SetOrigin( [ -127.875, -127.875, 0. ] ) >> constantImageSource.SetSpacing( [ .25 ] *3 ) >> constantImageSource.SetSize( [ 1024, 512, 360 ] ) >> constantImageSource.SetConstant(1.) >> >> ramp = rtk.FFTRampImageFilter[ImageType, ImageType, itk.D].New() >> ramp.SetInput(constantImageSource.GetOutput()) >> ramp.Update() >> >> Can you tell me more on the pipeline you're using? >> Simon >> >> On Fri, May 8, 2020 at 9:36 AM Jerome Lesaint >> wrote: >> >>> Salut, >>> >>> thanks again for the answer. The streaming workaround seems to work. >>> 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 ??? >>> >>> Anyway, it works fine now. Thank you. >>> J?rome >>> >>> >>> Le jeu. 7 mai 2020 ? 20:48, Simon Rit >>> a ?crit : >>> >>>> Hi, >>>> 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. >>>> Let me know if we can help with one of the two options. >>>> Simon >>>> >>>> On Thu, May 7, 2020 at 7:24 PM Jerome Lesaint >>>> wrote: >>>> >>>>> Hi, >>>>> >>>>> I am trying to use the ramp filter FFTRampImageFilter and it fails at >>>>> Update time with the error message : >>>>> >>>>> 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. >>>>> >>>>> I already read Simon's answer to a previous similar issue, saying that >>>>> he recommends using FFTW by turning ITK_USE_FFTW when building ITK. >>>>> But I did not compile ITK (on this computer). I simply installed the >>>>> pre-compiled Python package. >>>>> My question : can I turn any parameter in Python to force the ramp >>>>> filter to use this library ? >>>>> >>>>> Thanks in advance for your help, >>>>> >>>>> J?rome >>>>> _______________________________________________ >>>>> Rtk-users mailing list >>>>> Rtk-users at public.kitware.com >>>>> https://public.kitware.com/mailman/listinfo/rtk-users >>>>> >>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhehao.zhang at wustl.edu Wed May 13 02:07:35 2020 From: zhehao.zhang at wustl.edu (Zhang, Zhehao) Date: Wed, 13 May 2020 06:07:35 +0000 Subject: [Rtk-users] 4D Phase-correlated Reconstruction Message-ID: Dear all, I am trying to do the 4D phase-correlated CBCT reconstruction under Python environment. What I have are the projection data(.mha), geometry info(.xml) and the repiratory info(.txt). You can check the attachment for the phase file. I want just to simply ?divide? the projections and geometry into different bins according to the phase information and perform FDK recon separately, to get several different 3D images with streaks artifacts of course. The Rooster is not necessary for me. I have spent lot of time on the given ?4DROOSTERReconstruction? example. I think it used the ReorderProjectionsImageFilter order to do the separation. However, I am stuck on how to perform it for Python since I didn?t figure out how to read the phase.txt. Could you please give me some hints and is it correct to call this order to achieve my goals? Additionally, I also saw another test example(https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) which seems using ?PhasesToInterpolationWeights? , ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am confused I should follow which way. And I also want to make sure why here using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. Sorry for these cumbersome questions. Really hope to get some help, which means a lot for me. Thank you very much. Sincerely, Zhehao -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- An embedded and charset-unspecified text was scrubbed... Name: phase.txt URL: From simon.rit at creatis.insa-lyon.fr Wed May 13 05:01:05 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Wed, 13 May 2020 11:01:05 +0200 Subject: [Rtk-users] 4D Phase-correlated Reconstruction In-Reply-To: References: Message-ID: Hi, I think you should look at rtkfourdfdk which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will select the projections for you. Can you try to reimplement this in Python? We'll help if you're stuck but this is the right file to use as a basis for your dev. Simon On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao wrote: > > > Dear all, > > > > I am trying to do the 4D phase-correlated CBCT reconstruction under Python > environment. What I have are the projection data(.mha), geometry info(.xml) > and the repiratory info(.txt). You can check the attachment for the phase > file. I want just to simply ?divide? the projections and geometry into > different bins according to the phase information and perform FDK recon > separately, to get several different 3D images with streaks artifacts of > course. The Rooster is not necessary for me. > > > > I have spent lot of time on the given ?4DROOSTERReconstruction? example. I > think it used the ReorderProjectionsImageFilter order to do the separation. > However, I am stuck on how to perform it for Python since I didn?t figure > out how to read the phase.txt. Could you please give me some hints and is > it correct to call this order to achieve my goals? > > > > Additionally, I also saw another test example( > https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) > which seems using ?PhasesToInterpolationWeights? , > ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am > confused I should follow which way. And I also want to make sure why here > using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. > > > > Sorry for these cumbersome questions. Really hope to get some help, which > means a lot for me. Thank you very much. > > > > Sincerely, > > Zhehao > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhehao.zhang at wustl.edu Thu May 14 02:13:10 2020 From: zhehao.zhang at wustl.edu (Zhang, Zhehao) Date: Thu, 14 May 2020 06:13:10 +0000 Subject: [Rtk-users] 4D Phase-correlated Reconstruction In-Reply-To: References: , Message-ID: Hi, First, thank you for your reply. I am following the rtkfourdfdk to do the phase-correlated recon now. However, the result is not desirable and I am wondering whether the bad results result from too few projections for each phase. If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, it only select one projection from per respiratory cycle for each phase. So if 20 projections were acquired per respiratory cycle and I want to reconstruct 10 phases, only half projections will be used, right? I don?t know why we abandon some projections and is there some way I can use all the data? That?s to say, select 2 projections for each one of total 10 phases per respiratory cycle. I also put my Python code and used data here( https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). Thank you again. Zhehao From: Simon Rit Sent: Wednesday, May 13, 2020 3:59 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, I think you should look at rtkfourdfdk which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will select the projections for you. Can you try to reimplement this in Python? We'll help if you're stuck but this is the right file to use as a basis for your dev. Simon On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: Dear all, I am trying to do the 4D phase-correlated CBCT reconstruction under Python environment. What I have are the projection data(.mha), geometry info(.xml) and the repiratory info(.txt). You can check the attachment for the phase file. I want just to simply ?divide? the projections and geometry into different bins according to the phase information and perform FDK recon separately, to get several different 3D images with streaks artifacts of course. The Rooster is not necessary for me. I have spent lot of time on the given ?4DROOSTERReconstruction? example. I think it used the ReorderProjectionsImageFilter order to do the separation. However, I am stuck on how to perform it for Python since I didn?t figure out how to read the phase.txt. Could you please give me some hints and is it correct to call this order to achieve my goals? Additionally, I also saw another test example(https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) which seems using ?PhasesToInterpolationWeights? , ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am confused I should follow which way. And I also want to make sure why here using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. Sorry for these cumbersome questions. Really hope to get some help, which means a lot for me. Thank you very much. Sincerely, Zhehao _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Thu May 14 03:18:42 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Thu, 14 May 2020 09:18:42 +0200 Subject: [Rtk-users] 4D Phase-correlated Reconstruction In-Reply-To: References: Message-ID: Hi, Yes, you understood correctly. Adding projections will not fix the problem of angular gaps but will add some motion blur. This is, in my experience, the best way to proceed but you're free to do otherwise. I can't access your link, it seems to be protected. Can you provide just one snapshot of your result? Simon On Thu, May 14, 2020 at 8:13 AM Zhang, Zhehao wrote: > Hi, > > > > First, thank you for your reply. I am following the rtkfourdfdk to do the > phase-correlated recon now. However, the result is not desirable and I am > wondering whether the bad results result from too few projections for each > phase. > > If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, > it only select one projection from per respiratory cycle for each phase. So > if 20 projections were acquired per respiratory cycle and I want to > reconstruct 10 phases, only half projections will be used, right? I don?t > know why we abandon some projections and is there some way I can use all > the data? That?s to say, select 2 projections for each one of total 10 > phases per respiratory cycle. > > I also put my Python code and used data here( > https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). > > > > > Thank you again. > > Zhehao > > > > > > *From: *Simon Rit > *Sent: *Wednesday, May 13, 2020 3:59 AM > *To: *Zhang, Zhehao > *Cc: *rtk-users at public.kitware.com > *Subject: *Re: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Hi, > > I think you should look at rtkfourdfdk > > which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will > select the projections for you. Can you try to reimplement this in Python? > We'll help if you're stuck but this is the right file to use as a basis for > your dev. > > Simon > > > > On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: > > > > Dear all, > > > > I am trying to do the 4D phase-correlated CBCT reconstruction under Python > environment. What I have are the projection data(.mha), geometry info(.xml) > and the repiratory info(.txt). You can check the attachment for the phase > file. I want just to simply ?divide? the projections and geometry into > different bins according to the phase information and perform FDK recon > separately, to get several different 3D images with streaks artifacts of > course. The Rooster is not necessary for me. > > > > I have spent lot of time on the given ?4DROOSTERReconstruction? example. I > think it used the ReorderProjectionsImageFilter order to do the separation. > However, I am stuck on how to perform it for Python since I didn?t figure > out how to read the phase.txt. Could you please give me some hints and is > it correct to call this order to achieve my goals? > > > > Additionally, I also saw another test example( > https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) > which seems using ?PhasesToInterpolationWeights? , > ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am > confused I should follow which way. And I also want to make sure why here > using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. > > > > Sorry for these cumbersome questions. Really hope to get some help, which > means a lot for me. Thank you very much. > > > > Sincerely, > > Zhehao > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhehao.zhang at wustl.edu Thu May 14 17:58:22 2020 From: zhehao.zhang at wustl.edu (Zhang, Zhehao) Date: Thu, 14 May 2020 21:58:22 +0000 Subject: [Rtk-users] 4D Phase-correlated Reconstruction In-Reply-To: References: , , Message-ID: Hi, Sorry for my fault, I think I have made that link public this time. The results are also uploaded. The attachment is my phase-correlated reconstruction result (the first phase of total five phases). Thank you. BTW, if I need to utilize more projections for each phase, is there some integrated method in RTK to do so? Or you mean that I need to handle it by myself? Best regards, Zhehao From: Simon Rit Sent: Thursday, May 14, 2020 2:17 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, Yes, you understood correctly. Adding projections will not fix the problem of angular gaps but will add some motion blur. This is, in my experience, the best way to proceed but you're free to do otherwise. I can't access your link, it seems to be protected. Can you provide just one snapshot of your result? Simon On Thu, May 14, 2020 at 8:13 AM Zhang, Zhehao > wrote: Hi, First, thank you for your reply. I am following the rtkfourdfdk to do the phase-correlated recon now. However, the result is not desirable and I am wondering whether the bad results result from too few projections for each phase. If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, it only select one projection from per respiratory cycle for each phase. So if 20 projections were acquired per respiratory cycle and I want to reconstruct 10 phases, only half projections will be used, right? I don?t know why we abandon some projections and is there some way I can use all the data? That?s to say, select 2 projections for each one of total 10 phases per respiratory cycle. I also put my Python code and used data here( https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). Thank you again. Zhehao From: Simon Rit Sent: Wednesday, May 13, 2020 3:59 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, I think you should look at rtkfourdfdk which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will select the projections for you. Can you try to reimplement this in Python? We'll help if you're stuck but this is the right file to use as a basis for your dev. Simon On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: Dear all, I am trying to do the 4D phase-correlated CBCT reconstruction under Python environment. What I have are the projection data(.mha), geometry info(.xml) and the repiratory info(.txt). You can check the attachment for the phase file. I want just to simply ?divide? the projections and geometry into different bins according to the phase information and perform FDK recon separately, to get several different 3D images with streaks artifacts of course. The Rooster is not necessary for me. I have spent lot of time on the given ?4DROOSTERReconstruction? example. I think it used the ReorderProjectionsImageFilter order to do the separation. However, I am stuck on how to perform it for Python since I didn?t figure out how to read the phase.txt. Could you please give me some hints and is it correct to call this order to achieve my goals? Additionally, I also saw another test example(https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) which seems using ?PhasesToInterpolationWeights? , ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am confused I should follow which way. And I also want to make sure why here using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. Sorry for these cumbersome questions. Really hope to get some help, which means a lot for me. Thank you very much. Sincerely, Zhehao _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users From: Zhang, Zhehao Sent: Thursday, May 14, 2020 2:38 AM To: Simon Rit Cc: rtk-users at public.kitware.com Subject: RE: [Rtk-users] 4D Phase-correlated Reconstruction Sorry for my fault, I think I have made that link public this time. The results are also there. I attached two results, the better one is conventional FDK where also projections are used (no separate phase) and another one is phase-correlated recon (the shown is the first of five phases). BTW, if I need to utilize more projections for each phase, is there some integrated method in RTK to do so? Or you mean that I need to handle it by myself? Best regards, Zhehao From: Simon Rit Sent: Thursday, May 14, 2020 2:17 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, Yes, you understood correctly. Adding projections will not fix the problem of angular gaps but will add some motion blur. This is, in my experience, the best way to proceed but you're free to do otherwise. I can't access your link, it seems to be protected. Can you provide just one snapshot of your result? Simon On Thu, May 14, 2020 at 8:13 AM Zhang, Zhehao > wrote: Hi, First, thank you for your reply. I am following the rtkfourdfdk to do the phase-correlated recon now. However, the result is not desirable and I am wondering whether the bad results result from too few projections for each phase. If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, it only select one projection from per respiratory cycle for each phase. So if 20 projections were acquired per respiratory cycle and I want to reconstruct 10 phases, only half projections will be used, right? I don?t know why we abandon some projections and is there some way I can use all the data? That?s to say, select 2 projections for each one of total 10 phases per respiratory cycle. I also put my Python code and used data here( https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). Thank you again. Zhehao From: Simon Rit Sent: Wednesday, May 13, 2020 3:59 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, I think you should look at rtkfourdfdk which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will select the projections for you. Can you try to reimplement this in Python? We'll help if you're stuck but this is the right file to use as a basis for your dev. Simon On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: Dear all, I am trying to do the 4D phase-correlated CBCT reconstruction under Python environment. What I have are the projection data(.mha), geometry info(.xml) and the repiratory info(.txt). You can check the attachment for the phase file. I want just to simply ?divide? the projections and geometry into different bins according to the phase information and perform FDK recon separately, to get several different 3D images with streaks artifacts of course. The Rooster is not necessary for me. I have spent lot of time on the given ?4DROOSTERReconstruction? example. I think it used the ReorderProjectionsImageFilter order to do the separation. However, I am stuck on how to perform it for Python since I didn?t figure out how to read the phase.txt. Could you please give me some hints and is it correct to call this order to achieve my goals? Additionally, I also saw another test example(https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) which seems using ?PhasesToInterpolationWeights? , ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am confused I should follow which way. And I also want to make sure why here using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. Sorry for these cumbersome questions. Really hope to get some help, which means a lot for me. Thank you very much. Sincerely, Zhehao _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: 4DFDK.png Type: image/png Size: 175502 bytes Desc: 4DFDK.png URL: From yoonho94.na at gmail.com Fri May 15 00:30:22 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Fri, 15 May 2020 13:30:22 +0900 Subject: [Rtk-users] Few questions about FirstReconstruction.cxx Message-ID: Hi everyone. I am studying RTK with FirstReconstruction.cxx. right now I am visualizing every step to understand it. (visualize using view from itkwidgets) and I have few questions about it. first, when I visualized ConstantImageSource I could see rectangular shape by clicking X, Y, Z plane. but I couldn't see in 3d volume shape. Is it a bug? and second, what is RayEllipsiodIntersectionImageFilter? I visualized the output after constantimagesource going through RayEllipsoidIntersectionImageFilter. the shape was like a curved cylinder. I also saw docs but I still don't get it. someone give me an intuition please. Best regards. Yoonho. -------------- next part -------------- An HTML attachment was scrubbed... URL: From gabriele.belotti.bergamo at gmail.com Fri May 15 04:03:52 2020 From: gabriele.belotti.bergamo at gmail.com (gabriele.belotti.bergamo at gmail.com) Date: Fri, 15 May 2020 10:03:52 +0200 Subject: [Rtk-users] Add noise to projections Message-ID: <002701d62a8f$5fbc6380$1f352a80$@gmail.com> Dear RTK users and developers, I'm creating a CBCT dataset from existing CTs and would like to introduce noise into the generated projections before reconstruction. Is there an RTK implementation for this feature? Or is there any software, to you knowledge, that would efficiently add this noise (in terms of computation time)? Thanks in advance, Gabriele Belotti -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 15 04:46:10 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 15 May 2020 10:46:10 +0200 Subject: [Rtk-users] Add noise to projections In-Reply-To: <002701d62a8f$5fbc6380$1f352a80$@gmail.com> References: <002701d62a8f$5fbc6380$1f352a80$@gmail.com> Message-ID: Hi, There is an AdditiveGaussianNoiseImageFilter . In practice, I personally do it in numpy with the python wrappings, see this article where I used this code: I0=1e7 dH2O=0.01879 #mm^-1 at 75 keV if I0!=0: slarray = rtk.GetArrayFromImage(sl) slarray = I0*np.exp(-1.*dH2O*slarray) slarray = np.maximum(np.random.poisson(slarray), 1) slarray = np.log(I0/slarray)/dH2O slarray = rtk.GetImageFromArray(slarray.astype(np.float32)) slarray.CopyInformation(sl) sl = slarray and wrote "The same simulations were repeated with Poisson noise. The Shepp Logan densities were weighted by 0.01879 mm ?1 , i.e., the linear attenuation coefficient of water at 75 keV. The number of photons received per detector pixel without object in the beam was constant for all pixels in both geometries and equal to 10^7 ." Simon On Fri, May 15, 2020 at 10:04 AM wrote: > Dear RTK users and developers, > > I?m creating a CBCT dataset from existing CTs and would like to introduce > noise into the generated projections before reconstruction. > Is there an RTK implementation for this feature? Or is there any software, > to you knowledge, that would efficiently add this noise (in terms of > computation time)? > > > > Thanks in advance, > Gabriele Belotti > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 15 04:53:54 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 15 May 2020 10:53:54 +0200 Subject: [Rtk-users] Few questions about FirstReconstruction.cxx In-Reply-To: References: Message-ID: Hi, No, this is not a bug. This image is filled with 0 values so that's what you expect. This is the input image in which you are going to reconstruct. RayEllipsoidImageFitler calculates analytically the intersection between an ellipsoid defined by it's semi axes and it's density and the rays defined by a stack of projections and a geometry file. You should therefore get a stack of projections of an ellipsoid. Simon On Fri, May 15, 2020 at 6:31 AM ??? wrote: > Hi everyone. > > I am studying RTK with FirstReconstruction.cxx. > > right now I am visualizing every step to understand it. > (visualize using view from itkwidgets) > > and I have few questions about it. > > first, > when I visualized ConstantImageSource I could see rectangular shape > by clicking X, Y, Z plane. but I couldn't see in 3d volume shape. > Is it a bug? > > and second, > what is RayEllipsiodIntersectionImageFilter? > I visualized the output after constantimagesource > going through RayEllipsoidIntersectionImageFilter. > the shape was like a curved cylinder. > I also saw docs > but > I still don't get it. > someone give me an intuition please. > > Best regards. > > Yoonho. > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Fri May 15 05:23:03 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Fri, 15 May 2020 11:23:03 +0200 Subject: [Rtk-users] 4D Phase-correlated Reconstruction In-Reply-To: References: Message-ID: Hi, Congratulations on this code translation. Only 17 cycles according to your phase.txt file is very few. But there seems to be something else going one. I would suggest to remove the parker weights because RTK might detect a short scan since you have large gaps between projections in the same cycle. Or set the angular threshold to a larger value to be sure that it does not apply any such weight, the default is pi/9 and not large enough in your case. Simon On Thu, May 14, 2020 at 11:58 PM Zhang, Zhehao wrote: > Hi, > > Sorry for my fault, I think I have made that link public this time. The > results are also uploaded. > > The attachment is my phase-correlated reconstruction result (the first > phase of total five phases). Thank you. > > BTW, if I need to utilize more projections for each phase, is there some > integrated method in RTK to do so? Or you mean that I need to handle it by > myself? > > > > Best regards, > > Zhehao > > *From: *Simon Rit > *Sent: *Thursday, May 14, 2020 2:17 AM > *To: *Zhang, Zhehao > *Cc: *rtk-users at public.kitware.com > *Subject: *Re: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Hi, > > Yes, you understood correctly. Adding projections will not fix the problem > of angular gaps but will add some motion blur. This is, in my experience, > the best way to proceed but you're free to do otherwise. > > I can't access your link, it seems to be protected. Can you provide just > one snapshot of your result? > > Simon > > > > On Thu, May 14, 2020 at 8:13 AM Zhang, Zhehao > wrote: > > Hi, > > > > First, thank you for your reply. I am following the rtkfourdfdk to do the > phase-correlated recon now. However, the result is not desirable and I am > wondering whether the bad results result from too few projections for each > phase. > > If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, > it only select one projection from per respiratory cycle for each phase. So > if 20 projections were acquired per respiratory cycle and I want to > reconstruct 10 phases, only half projections will be used, right? I don?t > know why we abandon some projections and is there some way I can use all > the data? That?s to say, select 2 projections for each one of total 10 > phases per respiratory cycle. > > I also put my Python code and used data here( > https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). > > > > > Thank you again. > > Zhehao > > > > > > *From: *Simon Rit > *Sent: *Wednesday, May 13, 2020 3:59 AM > *To: *Zhang, Zhehao > *Cc: *rtk-users at public.kitware.com > *Subject: *Re: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Hi, > > I think you should look at rtkfourdfdk > > which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will > select the projections for you. Can you try to reimplement this in Python? > We'll help if you're stuck but this is the right file to use as a basis for > your dev. > > Simon > > > > On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: > > > > Dear all, > > > > I am trying to do the 4D phase-correlated CBCT reconstruction under Python > environment. What I have are the projection data(.mha), geometry info(.xml) > and the repiratory info(.txt). You can check the attachment for the phase > file. I want just to simply ?divide? the projections and geometry into > different bins according to the phase information and perform FDK recon > separately, to get several different 3D images with streaks artifacts of > course. The Rooster is not necessary for me. > > > > I have spent lot of time on the given ?4DROOSTERReconstruction? example. I > think it used the ReorderProjectionsImageFilter order to do the separation. > However, I am stuck on how to perform it for Python since I didn?t figure > out how to read the phase.txt. Could you please give me some hints and is > it correct to call this order to achieve my goals? > > > > Additionally, I also saw another test example( > https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) > which seems using ?PhasesToInterpolationWeights? , > ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am > confused I should follow which way. And I also want to make sure why here > using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. > > > > Sorry for these cumbersome questions. Really hope to get some help, which > means a lot for me. Thank you very much. > > > > Sincerely, > > Zhehao > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > > > > > *From: *Zhang, Zhehao > *Sent: *Thursday, May 14, 2020 2:38 AM > *To: *Simon Rit > *Cc: *rtk-users at public.kitware.com > *Subject: *RE: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Sorry for my fault, I think I have made that link public this time. The > results are also there. > > I attached two results, the better one is conventional FDK where also > projections are used (no separate phase) and another one is > phase-correlated recon (the shown is the first of five phases). > > BTW, if I need to utilize more projections for each phase, is there some > integrated method in RTK to do so? Or you mean that I need to handle it by > myself? > > > > Best regards, > > Zhehao > > *From: *Simon Rit > *Sent: *Thursday, May 14, 2020 2:17 AM > *To: *Zhang, Zhehao > *Cc: *rtk-users at public.kitware.com > *Subject: *Re: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Hi, > > Yes, you understood correctly. Adding projections will not fix the problem > of angular gaps but will add some motion blur. This is, in my experience, > the best way to proceed but you're free to do otherwise. > > I can't access your link, it seems to be protected. Can you provide just > one snapshot of your result? > > Simon > > > > On Thu, May 14, 2020 at 8:13 AM Zhang, Zhehao > wrote: > > Hi, > > > > First, thank you for your reply. I am following the rtkfourdfdk to do the > phase-correlated recon now. However, the result is not desirable and I am > wondering whether the bad results result from too few projections for each > phase. > > If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, > it only select one projection from per respiratory cycle for each phase. So > if 20 projections were acquired per respiratory cycle and I want to > reconstruct 10 phases, only half projections will be used, right? I don?t > know why we abandon some projections and is there some way I can use all > the data? That?s to say, select 2 projections for each one of total 10 > phases per respiratory cycle. > > I also put my Python code and used data here( > https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). > > > > > Thank you again. > > Zhehao > > > > > > *From: *Simon Rit > *Sent: *Wednesday, May 13, 2020 3:59 AM > *To: *Zhang, Zhehao > *Cc: *rtk-users at public.kitware.com > *Subject: *Re: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Hi, > > I think you should look at rtkfourdfdk > > which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will > select the projections for you. Can you try to reimplement this in Python? > We'll help if you're stuck but this is the right file to use as a basis for > your dev. > > Simon > > > > On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: > > > > Dear all, > > > > I am trying to do the 4D phase-correlated CBCT reconstruction under Python > environment. What I have are the projection data(.mha), geometry info(.xml) > and the repiratory info(.txt). You can check the attachment for the phase > file. I want just to simply ?divide? the projections and geometry into > different bins according to the phase information and perform FDK recon > separately, to get several different 3D images with streaks artifacts of > course. The Rooster is not necessary for me. > > > > I have spent lot of time on the given ?4DROOSTERReconstruction? example. I > think it used the ReorderProjectionsImageFilter order to do the separation. > However, I am stuck on how to perform it for Python since I didn?t figure > out how to read the phase.txt. Could you please give me some hints and is > it correct to call this order to achieve my goals? > > > > Additionally, I also saw another test example( > https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) > which seems using ?PhasesToInterpolationWeights? , > ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am > confused I should follow which way. And I also want to make sure why here > using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. > > > > Sorry for these cumbersome questions. Really hope to get some help, which > means a lot for me. Thank you very much. > > > > Sincerely, > > Zhehao > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhehao.zhang at wustl.edu Fri May 15 14:15:52 2020 From: zhehao.zhang at wustl.edu (Zhang, Zhehao) Date: Fri, 15 May 2020 18:15:52 +0000 Subject: [Rtk-users] 4D Phase-correlated Reconstruction In-Reply-To: References: , Message-ID: Hi, Thank you for reply. I tried to remove the Parker weights, however, it didn?t really help. As you can see from the attached result, there is still almost no contrast. Since I don?t what else I can do along this way, I am thinking using more projections for each phase (of course some motion blur may appear). My preliminary idea is to use ?ReorderProjectionsImageFilter? to reorder the projections and geometry, then sub-select corresponding projections for every phase. Is there some Python RTK implements can do this selection? I have tried ?SubSelectImageFilter? like selector = rtk.SubSelectImageFilter[ImageType].New() selector.SetInputProjectionStack(reorder.GetOutput()) selector.SetInputGeometry(reorder.GetOutputGeometry()) and got Error 'itkObject' object has no attribute 'SetInputProjectionStack'. I think the SubSelectImageFilter should have these set methods but I don?t know why I cannot use them on Python. Sorry for these troubles. Hope to get your help. Best, Zhehao From: Simon Rit Sent: Friday, May 15, 2020 4:21 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, Congratulations on this code translation. Only 17 cycles according to your phase.txt file is very few. But there seems to be something else going one. I would suggest to remove the parker weights because RTK might detect a short scan since you have large gaps between projections in the same cycle. Or set the angular threshold to a larger value to be sure that it does not apply any such weight, the default is pi/9 and not large enough in your case. Simon On Thu, May 14, 2020 at 11:58 PM Zhang, Zhehao > wrote: Hi, Sorry for my fault, I think I have made that link public this time. The results are also uploaded. The attachment is my phase-correlated reconstruction result (the first phase of total five phases). Thank you. BTW, if I need to utilize more projections for each phase, is there some integrated method in RTK to do so? Or you mean that I need to handle it by myself? Best regards, Zhehao From: Simon Rit Sent: Thursday, May 14, 2020 2:17 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, Yes, you understood correctly. Adding projections will not fix the problem of angular gaps but will add some motion blur. This is, in my experience, the best way to proceed but you're free to do otherwise. I can't access your link, it seems to be protected. Can you provide just one snapshot of your result? Simon On Thu, May 14, 2020 at 8:13 AM Zhang, Zhehao > wrote: Hi, First, thank you for your reply. I am following the rtkfourdfdk to do the phase-correlated recon now. However, the result is not desirable and I am wondering whether the bad results result from too few projections for each phase. If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, it only select one projection from per respiratory cycle for each phase. So if 20 projections were acquired per respiratory cycle and I want to reconstruct 10 phases, only half projections will be used, right? I don?t know why we abandon some projections and is there some way I can use all the data? That?s to say, select 2 projections for each one of total 10 phases per respiratory cycle. I also put my Python code and used data here( https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). Thank you again. Zhehao From: Simon Rit Sent: Wednesday, May 13, 2020 3:59 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, I think you should look at rtkfourdfdk which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will select the projections for you. Can you try to reimplement this in Python? We'll help if you're stuck but this is the right file to use as a basis for your dev. Simon On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: Dear all, I am trying to do the 4D phase-correlated CBCT reconstruction under Python environment. What I have are the projection data(.mha), geometry info(.xml) and the repiratory info(.txt). You can check the attachment for the phase file. I want just to simply ?divide? the projections and geometry into different bins according to the phase information and perform FDK recon separately, to get several different 3D images with streaks artifacts of course. The Rooster is not necessary for me. I have spent lot of time on the given ?4DROOSTERReconstruction? example. I think it used the ReorderProjectionsImageFilter order to do the separation. However, I am stuck on how to perform it for Python since I didn?t figure out how to read the phase.txt. Could you please give me some hints and is it correct to call this order to achieve my goals? Additionally, I also saw another test example(https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) which seems using ?PhasesToInterpolationWeights? , ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am confused I should follow which way. And I also want to make sure why here using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. Sorry for these cumbersome questions. Really hope to get some help, which means a lot for me. Thank you very much. Sincerely, Zhehao _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users From: Zhang, Zhehao Sent: Thursday, May 14, 2020 2:38 AM To: Simon Rit Cc: rtk-users at public.kitware.com Subject: RE: [Rtk-users] 4D Phase-correlated Reconstruction Sorry for my fault, I think I have made that link public this time. The results are also there. I attached two results, the better one is conventional FDK where also projections are used (no separate phase) and another one is phase-correlated recon (the shown is the first of five phases). BTW, if I need to utilize more projections for each phase, is there some integrated method in RTK to do so? Or you mean that I need to handle it by myself? Best regards, Zhehao From: Simon Rit Sent: Thursday, May 14, 2020 2:17 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, Yes, you understood correctly. Adding projections will not fix the problem of angular gaps but will add some motion blur. This is, in my experience, the best way to proceed but you're free to do otherwise. I can't access your link, it seems to be protected. Can you provide just one snapshot of your result? Simon On Thu, May 14, 2020 at 8:13 AM Zhang, Zhehao > wrote: Hi, First, thank you for your reply. I am following the rtkfourdfdk to do the phase-correlated recon now. However, the result is not desirable and I am wondering whether the bad results result from too few projections for each phase. If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, it only select one projection from per respiratory cycle for each phase. So if 20 projections were acquired per respiratory cycle and I want to reconstruct 10 phases, only half projections will be used, right? I don?t know why we abandon some projections and is there some way I can use all the data? That?s to say, select 2 projections for each one of total 10 phases per respiratory cycle. I also put my Python code and used data here( https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). Thank you again. Zhehao From: Simon Rit Sent: Wednesday, May 13, 2020 3:59 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, I think you should look at rtkfourdfdk which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will select the projections for you. Can you try to reimplement this in Python? We'll help if you're stuck but this is the right file to use as a basis for your dev. Simon On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: Dear all, I am trying to do the 4D phase-correlated CBCT reconstruction under Python environment. What I have are the projection data(.mha), geometry info(.xml) and the repiratory info(.txt). You can check the attachment for the phase file. I want just to simply ?divide? the projections and geometry into different bins according to the phase information and perform FDK recon separately, to get several different 3D images with streaks artifacts of course. The Rooster is not necessary for me. I have spent lot of time on the given ?4DROOSTERReconstruction? example. I think it used the ReorderProjectionsImageFilter order to do the separation. However, I am stuck on how to perform it for Python since I didn?t figure out how to read the phase.txt. Could you please give me some hints and is it correct to call this order to achieve my goals? Additionally, I also saw another test example(https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) which seems using ?PhasesToInterpolationWeights? , ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am confused I should follow which way. And I also want to make sure why here using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. Sorry for these cumbersome questions. Really hope to get some help, which means a lot for me. Thank you very much. Sincerely, Zhehao _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: removeParker.png Type: image/png Size: 120638 bytes Desc: removeParker.png URL: From simon.rit at creatis.insa-lyon.fr Sun May 17 10:39:36 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Sun, 17 May 2020 16:39:36 +0200 Subject: [Rtk-users] 4D Phase-correlated Reconstruction In-Reply-To: References: Message-ID: Hi, That's more or less what I would expect from 17 projections but your gray window is not well adjusted. The white streaks on the border are probably because your projections are badly calibrated and air is not at 0 as it should be. rtk::SubSelectImageFilter is not meant to be instantiated, the New you are using is inherited from the parent. Try using rtk::SubSelectFromListImage. Best regards, Simon On Fri, May 15, 2020 at 8:16 PM Zhang, Zhehao wrote: > Hi, > > > > Thank you for reply. I tried to remove the Parker weights, however, it > didn?t really help. As you can see from the attached result, there is still > almost no contrast. > > Since I don?t what else I can do along this way, I am thinking using more > projections for each phase (of course some motion blur may appear). My > preliminary idea is to use ?ReorderProjectionsImageFilter? to reorder the > projections and geometry, then sub-select corresponding projections for > every phase. Is there some Python RTK implements can do this selection? I > have tried ?SubSelectImageFilter? like > > > > selector = rtk.SubSelectImageFilter[ImageType].New() > > selector.SetInputProjectionStack(reorder.GetOutput()) > > selector.SetInputGeometry(reorder.GetOutputGeometry()) > > > > and got Error 'itkObject' object has no attribute > 'SetInputProjectionStack'. I think the SubSelectImageFilter > > should have these set methods but I don?t know why I cannot use them on > Python. > > Sorry for these troubles. Hope to get your help. > > > > Best, > > Zhehao > > > > *From: *Simon Rit > *Sent: *Friday, May 15, 2020 4:21 AM > *To: *Zhang, Zhehao > *Cc: *rtk-users at public.kitware.com > *Subject: *Re: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Hi, > > Congratulations on this code translation. Only 17 cycles according to your > phase.txt file is very few. But there seems to be something else going one. > I would suggest to remove the parker weights because RTK might detect a > short scan since you have large gaps between projections in the same cycle. > Or set the angular threshold > > to a larger value to be sure that it does not apply any such weight, the > default is pi/9 and not large enough in your case. > > Simon > > > > On Thu, May 14, 2020 at 11:58 PM Zhang, Zhehao > wrote: > > Hi, > > Sorry for my fault, I think I have made that link public this time. The > results are also uploaded. > > The attachment is my phase-correlated reconstruction result (the first > phase of total five phases). Thank you. > > BTW, if I need to utilize more projections for each phase, is there some > integrated method in RTK to do so? Or you mean that I need to handle it by > myself? > > > > Best regards, > > Zhehao > > *From: *Simon Rit > *Sent: *Thursday, May 14, 2020 2:17 AM > *To: *Zhang, Zhehao > *Cc: *rtk-users at public.kitware.com > *Subject: *Re: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Hi, > > Yes, you understood correctly. Adding projections will not fix the problem > of angular gaps but will add some motion blur. This is, in my experience, > the best way to proceed but you're free to do otherwise. > > I can't access your link, it seems to be protected. Can you provide just > one snapshot of your result? > > Simon > > > > On Thu, May 14, 2020 at 8:13 AM Zhang, Zhehao > wrote: > > Hi, > > > > First, thank you for your reply. I am following the rtkfourdfdk to do the > phase-correlated recon now. However, the result is not desirable and I am > wondering whether the bad results result from too few projections for each > phase. > > If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, > it only select one projection from per respiratory cycle for each phase. So > if 20 projections were acquired per respiratory cycle and I want to > reconstruct 10 phases, only half projections will be used, right? I don?t > know why we abandon some projections and is there some way I can use all > the data? That?s to say, select 2 projections for each one of total 10 > phases per respiratory cycle. > > I also put my Python code and used data here( > https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). > > > > > Thank you again. > > Zhehao > > > > > > *From: *Simon Rit > *Sent: *Wednesday, May 13, 2020 3:59 AM > *To: *Zhang, Zhehao > *Cc: *rtk-users at public.kitware.com > *Subject: *Re: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Hi, > > I think you should look at rtkfourdfdk > > which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will > select the projections for you. Can you try to reimplement this in Python? > We'll help if you're stuck but this is the right file to use as a basis for > your dev. > > Simon > > > > On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: > > > > Dear all, > > > > I am trying to do the 4D phase-correlated CBCT reconstruction under Python > environment. What I have are the projection data(.mha), geometry info(.xml) > and the repiratory info(.txt). You can check the attachment for the phase > file. I want just to simply ?divide? the projections and geometry into > different bins according to the phase information and perform FDK recon > separately, to get several different 3D images with streaks artifacts of > course. The Rooster is not necessary for me. > > > > I have spent lot of time on the given ?4DROOSTERReconstruction? example. I > think it used the ReorderProjectionsImageFilter order to do the separation. > However, I am stuck on how to perform it for Python since I didn?t figure > out how to read the phase.txt. Could you please give me some hints and is > it correct to call this order to achieve my goals? > > > > Additionally, I also saw another test example( > https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) > which seems using ?PhasesToInterpolationWeights? , > ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am > confused I should follow which way. And I also want to make sure why here > using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. > > > > Sorry for these cumbersome questions. Really hope to get some help, which > means a lot for me. Thank you very much. > > > > Sincerely, > > Zhehao > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > > > > > *From: *Zhang, Zhehao > *Sent: *Thursday, May 14, 2020 2:38 AM > *To: *Simon Rit > *Cc: *rtk-users at public.kitware.com > *Subject: *RE: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Sorry for my fault, I think I have made that link public this time. The > results are also there. > > I attached two results, the better one is conventional FDK where also > projections are used (no separate phase) and another one is > phase-correlated recon (the shown is the first of five phases). > > BTW, if I need to utilize more projections for each phase, is there some > integrated method in RTK to do so? Or you mean that I need to handle it by > myself? > > > > Best regards, > > Zhehao > > *From: *Simon Rit > *Sent: *Thursday, May 14, 2020 2:17 AM > *To: *Zhang, Zhehao > *Cc: *rtk-users at public.kitware.com > *Subject: *Re: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Hi, > > Yes, you understood correctly. Adding projections will not fix the problem > of angular gaps but will add some motion blur. This is, in my experience, > the best way to proceed but you're free to do otherwise. > > I can't access your link, it seems to be protected. Can you provide just > one snapshot of your result? > > Simon > > > > On Thu, May 14, 2020 at 8:13 AM Zhang, Zhehao > wrote: > > Hi, > > > > First, thank you for your reply. I am following the rtkfourdfdk to do the > phase-correlated recon now. However, the result is not desirable and I am > wondering whether the bad results result from too few projections for each > phase. > > If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, > it only select one projection from per respiratory cycle for each phase. So > if 20 projections were acquired per respiratory cycle and I want to > reconstruct 10 phases, only half projections will be used, right? I don?t > know why we abandon some projections and is there some way I can use all > the data? That?s to say, select 2 projections for each one of total 10 > phases per respiratory cycle. > > I also put my Python code and used data here( > https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). > > > > > Thank you again. > > Zhehao > > > > > > *From: *Simon Rit > *Sent: *Wednesday, May 13, 2020 3:59 AM > *To: *Zhang, Zhehao > *Cc: *rtk-users at public.kitware.com > *Subject: *Re: [Rtk-users] 4D Phase-correlated Reconstruction > > > > Hi, > > I think you should look at rtkfourdfdk > > which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will > select the projections for you. Can you try to reimplement this in Python? > We'll help if you're stuck but this is the right file to use as a basis for > your dev. > > Simon > > > > On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: > > > > Dear all, > > > > I am trying to do the 4D phase-correlated CBCT reconstruction under Python > environment. What I have are the projection data(.mha), geometry info(.xml) > and the repiratory info(.txt). You can check the attachment for the phase > file. I want just to simply ?divide? the projections and geometry into > different bins according to the phase information and perform FDK recon > separately, to get several different 3D images with streaks artifacts of > course. The Rooster is not necessary for me. > > > > I have spent lot of time on the given ?4DROOSTERReconstruction? example. I > think it used the ReorderProjectionsImageFilter order to do the separation. > However, I am stuck on how to perform it for Python since I didn?t figure > out how to read the phase.txt. Could you please give me some hints and is > it correct to call this order to achieve my goals? > > > > Additionally, I also saw another test example( > https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) > which seems using ?PhasesToInterpolationWeights? , > ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am > confused I should follow which way. And I also want to make sure why here > using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. > > > > Sorry for these cumbersome questions. Really hope to get some help, which > means a lot for me. Thank you very much. > > > > Sincerely, > > Zhehao > > > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > > > > > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From zhehao.zhang at wustl.edu Sun May 17 22:01:33 2020 From: zhehao.zhang at wustl.edu (Zhang, Zhehao) Date: Mon, 18 May 2020 02:01:33 +0000 Subject: [Rtk-users] 4D Phase-correlated Reconstruction In-Reply-To: References: , Message-ID: Hi Simon, Yes, I think maybe the problem is because my data itself is not desirable. I utilized another dataset and the results get much better. Additionally, the SubSelectImageFilter works well. Thank you again, really appreciate it. Best, Zhehao From: Simon Rit Sent: Sunday, May 17, 2020 9:38 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, That's more or less what I would expect from 17 projections but your gray window is not well adjusted. The white streaks on the border are probably because your projections are badly calibrated and air is not at 0 as it should be. rtk::SubSelectImageFilter is not meant to be instantiated, the New you are using is inherited from the parent. Try using rtk::SubSelectFromListImage. Best regards, Simon On Fri, May 15, 2020 at 8:16 PM Zhang, Zhehao > wrote: Hi, Thank you for reply. I tried to remove the Parker weights, however, it didn?t really help. As you can see from the attached result, there is still almost no contrast. Since I don?t what else I can do along this way, I am thinking using more projections for each phase (of course some motion blur may appear). My preliminary idea is to use ?ReorderProjectionsImageFilter? to reorder the projections and geometry, then sub-select corresponding projections for every phase. Is there some Python RTK implements can do this selection? I have tried ?SubSelectImageFilter? like selector = rtk.SubSelectImageFilter[ImageType].New() selector.SetInputProjectionStack(reorder.GetOutput()) selector.SetInputGeometry(reorder.GetOutputGeometry()) and got Error 'itkObject' object has no attribute 'SetInputProjectionStack'. I think the SubSelectImageFilter should have these set methods but I don?t know why I cannot use them on Python. Sorry for these troubles. Hope to get your help. Best, Zhehao From: Simon Rit Sent: Friday, May 15, 2020 4:21 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, Congratulations on this code translation. Only 17 cycles according to your phase.txt file is very few. But there seems to be something else going one. I would suggest to remove the parker weights because RTK might detect a short scan since you have large gaps between projections in the same cycle. Or set the angular threshold to a larger value to be sure that it does not apply any such weight, the default is pi/9 and not large enough in your case. Simon On Thu, May 14, 2020 at 11:58 PM Zhang, Zhehao > wrote: Hi, Sorry for my fault, I think I have made that link public this time. The results are also uploaded. The attachment is my phase-correlated reconstruction result (the first phase of total five phases). Thank you. BTW, if I need to utilize more projections for each phase, is there some integrated method in RTK to do so? Or you mean that I need to handle it by myself? Best regards, Zhehao From: Simon Rit Sent: Thursday, May 14, 2020 2:17 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, Yes, you understood correctly. Adding projections will not fix the problem of angular gaps but will add some motion blur. This is, in my experience, the best way to proceed but you're free to do otherwise. I can't access your link, it seems to be protected. Can you provide just one snapshot of your result? Simon On Thu, May 14, 2020 at 8:13 AM Zhang, Zhehao > wrote: Hi, First, thank you for your reply. I am following the rtkfourdfdk to do the phase-correlated recon now. However, the result is not desirable and I am wondering whether the bad results result from too few projections for each phase. If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, it only select one projection from per respiratory cycle for each phase. So if 20 projections were acquired per respiratory cycle and I want to reconstruct 10 phases, only half projections will be used, right? I don?t know why we abandon some projections and is there some way I can use all the data? That?s to say, select 2 projections for each one of total 10 phases per respiratory cycle. I also put my Python code and used data here( https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). Thank you again. Zhehao From: Simon Rit Sent: Wednesday, May 13, 2020 3:59 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, I think you should look at rtkfourdfdk which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will select the projections for you. Can you try to reimplement this in Python? We'll help if you're stuck but this is the right file to use as a basis for your dev. Simon On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: Dear all, I am trying to do the 4D phase-correlated CBCT reconstruction under Python environment. What I have are the projection data(.mha), geometry info(.xml) and the repiratory info(.txt). You can check the attachment for the phase file. I want just to simply ?divide? the projections and geometry into different bins according to the phase information and perform FDK recon separately, to get several different 3D images with streaks artifacts of course. The Rooster is not necessary for me. I have spent lot of time on the given ?4DROOSTERReconstruction? example. I think it used the ReorderProjectionsImageFilter order to do the separation. However, I am stuck on how to perform it for Python since I didn?t figure out how to read the phase.txt. Could you please give me some hints and is it correct to call this order to achieve my goals? Additionally, I also saw another test example(https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) which seems using ?PhasesToInterpolationWeights? , ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am confused I should follow which way. And I also want to make sure why here using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. Sorry for these cumbersome questions. Really hope to get some help, which means a lot for me. Thank you very much. Sincerely, Zhehao _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users From: Zhang, Zhehao Sent: Thursday, May 14, 2020 2:38 AM To: Simon Rit Cc: rtk-users at public.kitware.com Subject: RE: [Rtk-users] 4D Phase-correlated Reconstruction Sorry for my fault, I think I have made that link public this time. The results are also there. I attached two results, the better one is conventional FDK where also projections are used (no separate phase) and another one is phase-correlated recon (the shown is the first of five phases). BTW, if I need to utilize more projections for each phase, is there some integrated method in RTK to do so? Or you mean that I need to handle it by myself? Best regards, Zhehao From: Simon Rit Sent: Thursday, May 14, 2020 2:17 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, Yes, you understood correctly. Adding projections will not fix the problem of angular gaps but will add some motion blur. This is, in my experience, the best way to proceed but you're free to do otherwise. I can't access your link, it seems to be protected. Can you provide just one snapshot of your result? Simon On Thu, May 14, 2020 at 8:13 AM Zhang, Zhehao > wrote: Hi, First, thank you for your reply. I am following the rtkfourdfdk to do the phase-correlated recon now. However, the result is not desirable and I am wondering whether the bad results result from too few projections for each phase. If I understand the rtk::SelectOneProjectionPerCycleImageFilter correctly, it only select one projection from per respiratory cycle for each phase. So if 20 projections were acquired per respiratory cycle and I want to reconstruct 10 phases, only half projections will be used, right? I don?t know why we abandon some projections and is there some way I can use all the data? That?s to say, select 2 projections for each one of total 10 phases per respiratory cycle. I also put my Python code and used data here( https://drive.google.com/drive/folders/1SFXr4ehI1N8Wh0BAMlRqIah9cXwukRYJ ). Thank you again. Zhehao From: Simon Rit Sent: Wednesday, May 13, 2020 3:59 AM To: Zhang, Zhehao Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] 4D Phase-correlated Reconstruction Hi, I think you should look at rtkfourdfdk which does what you want. rtk::SelectOneProjectionPerCycleImageFilter will select the projections for you. Can you try to reimplement this in Python? We'll help if you're stuck but this is the right file to use as a basis for your dev. Simon On Wed, May 13, 2020 at 8:07 AM Zhang, Zhehao > wrote: Dear all, I am trying to do the 4D phase-correlated CBCT reconstruction under Python environment. What I have are the projection data(.mha), geometry info(.xml) and the repiratory info(.txt). You can check the attachment for the phase file. I want just to simply ?divide? the projections and geometry into different bins according to the phase information and perform FDK recon separately, to get several different 3D images with streaks artifacts of course. The Rooster is not necessary for me. I have spent lot of time on the given ?4DROOSTERReconstruction? example. I think it used the ReorderProjectionsImageFilter order to do the separation. However, I am stuck on how to perform it for Python since I didn?t figure out how to read the phase.txt. Could you please give me some hints and is it correct to call this order to achieve my goals? Additionally, I also saw another test example(https://github.com/SimonRit/RTK/blob/master/test/rtkwarpprojectionstacktofourdtest.cxx) which seems using ?PhasesToInterpolationWeights? , ?BackProjectionImageFilter? and ?DivideImageFilter ? to do this. I am confused I should follow which way. And I also want to make sure why here using BackProjectionImageFilter rather than FDKConeBeamReconstructionFilter. Sorry for these cumbersome questions. Really hope to get some help, which means a lot for me. Thank you very much. Sincerely, Zhehao _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoonho94.na at gmail.com Mon May 18 02:42:56 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Mon, 18 May 2020 15:42:56 +0900 Subject: [Rtk-users] (no subject) Message-ID: Hi, rtk-users. first I'm not really a C++ user I'm looking on this link and I'm curious about argv for dimension and spacing. where does the spacing and dimension value go? in the rtkprojectgeometricphantom.cxx, I don't see any variables related to spacing and dimension argv. I think there should be something like args_info.spacing or args_info.dimension. where does argv for spacing and dimension goes to? -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreasga22 at gmail.com Mon May 18 03:38:13 2020 From: andreasga22 at gmail.com (Andreas Andersen) Date: Mon, 18 May 2020 09:38:13 +0200 Subject: [Rtk-users] (no subject) In-Reply-To: References: Message-ID: argv is an array of \0 terminated char arrays from the commandline -> i.e. or an array of strings. E.g. "rtksimulatedgeometry -n 180 -o geometry.xml" would give *argv = "rtksimulatedgeometry\0-n\0180\0-o\0geometry.xml\0" such that argv[2] = "180" and argv[4] = "geometry.xml" argc is the number of strings in the array. Gengetopt (GGO) handles the arguments for you and binds them to the args_info struct based on the *.ggo file. I hope this makes it somewhat understandable. /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Mon, 18 May 2020 at 08:43, ??? wrote: > Hi, rtk-users. > > first I'm not really a C++ user > > I'm looking on this link > and I'm curious about > argv for dimension and spacing. > > where does the spacing and dimension value go? > > in the rtkprojectgeometricphantom.cxx, I don't see any variables related > to spacing and dimension argv. > > I think there should be something like args_info.spacing or > args_info.dimension. > > where does argv for spacing and dimension goes to? > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoonho94.na at gmail.com Mon May 18 03:49:28 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Mon, 18 May 2020 16:49:28 +0900 Subject: [Rtk-users] (no subject) In-Reply-To: References: Message-ID: Thank you for replying. but there are no options about dimension and spacing in that ggo file . I can find other options though. for example there's an script like this. rtkprojectgeometricphantom -g geometry.xml -o projections.mha --spacing 2 --dimension=512,3,512 --phantomfile SheppLogan-2d.txt --phantomscale=256,1,256 and there's no options about spacing and dimension in the ggo file. Yoonho. 2020? 5? 18? (?) ?? 4:38, Andreas Andersen ?? ??: > argv is an array of \0 terminated char arrays from the commandline -> i.e. > or an array of strings. > E.g. "rtksimulatedgeometry -n 180 -o geometry.xml" > would give *argv = "rtksimulatedgeometry\0-n\0180\0-o\0geometry.xml\0" > such that argv[2] = "180" and argv[4] = "geometry.xml" > argc is the number of strings in the array. > > Gengetopt (GGO) handles the arguments for you and binds them to the > args_info struct based on the *.ggo file. > > I hope this makes it somewhat understandable. > > /Andreas > > __________________________________ > > Andreas Gravgaard Andersen > > Danish Center for Particle Therapy, > > Aarhus University Hospital > > Palle Juul-Jensens Blvd. 99, > > 8200, Aarhus > > Mail: agravgaard at protonmail.com > > Cell: +45 3165 8140 > > > On Mon, 18 May 2020 at 08:43, ??? wrote: > >> Hi, rtk-users. >> >> first I'm not really a C++ user >> >> I'm looking on this link >> and I'm curious >> about argv for dimension and spacing. >> >> where does the spacing and dimension value go? >> >> in the rtkprojectgeometricphantom.cxx, I don't see any variables related >> to spacing and dimension argv. >> >> I think there should be something like args_info.spacing or >> args_info.dimension. >> >> where does argv for spacing and dimension goes to? >> _______________________________________________ >> Rtk-users mailing list >> Rtk-users at public.kitware.com >> https://public.kitware.com/mailman/listinfo/rtk-users >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreasga22 at gmail.com Mon May 18 03:58:02 2020 From: andreasga22 at gmail.com (Andreas Andersen) Date: Mon, 18 May 2020 09:58:02 +0200 Subject: [Rtk-users] (no subject) In-Reply-To: References: Message-ID: Ah yes, that was also confusing to me in the beginning. The CMake file includes a ggo file from the parent directory: https://github.com/SimonRit/RTK/blob/master/applications/rtkprojectgeometricphantom/CMakeLists.txt#L1 This file has the volume property arguments, such as spacing: https://github.com/SimonRit/RTK/blob/master/applications/rtk3Doutputimage_section.ggo /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Mon, 18 May 2020 at 09:49, ??? wrote: > Thank you for replying. > > but there are no options about dimension and spacing in that ggo file > > . > > I can find other options though. > > for example there's an script like this. > > rtkprojectgeometricphantom -g geometry.xml -o projections.mha --spacing 2 --dimension=512,3,512 --phantomfile SheppLogan-2d.txt --phantomscale=256,1,256 > > and there's no options about spacing and dimension in the ggo file. > > Yoonho. > > 2020? 5? 18? (?) ?? 4:38, Andreas Andersen ?? ??: > >> argv is an array of \0 terminated char arrays from the commandline -> >> i.e. or an array of strings. >> E.g. "rtksimulatedgeometry -n 180 -o geometry.xml" >> would give *argv = "rtksimulatedgeometry\0-n\0180\0-o\0geometry.xml\0" >> such that argv[2] = "180" and argv[4] = "geometry.xml" >> argc is the number of strings in the array. >> >> Gengetopt (GGO) handles the arguments for you and binds them to the >> args_info struct based on the *.ggo file. >> >> I hope this makes it somewhat understandable. >> >> /Andreas >> >> __________________________________ >> >> Andreas Gravgaard Andersen >> >> Danish Center for Particle Therapy, >> >> Aarhus University Hospital >> >> Palle Juul-Jensens Blvd. 99, >> >> 8200, Aarhus >> >> Mail: agravgaard at protonmail.com >> >> Cell: +45 3165 8140 >> >> >> On Mon, 18 May 2020 at 08:43, ??? wrote: >> >>> Hi, rtk-users. >>> >>> first I'm not really a C++ user >>> >>> I'm looking on this link >>> and I'm curious >>> about argv for dimension and spacing. >>> >>> where does the spacing and dimension value go? >>> >>> in the rtkprojectgeometricphantom.cxx, I don't see any variables >>> related to spacing and dimension argv. >>> >>> I think there should be something like args_info.spacing or >>> args_info.dimension. >>> >>> where does argv for spacing and dimension goes to? >>> _______________________________________________ >>> Rtk-users mailing list >>> Rtk-users at public.kitware.com >>> https://public.kitware.com/mailman/listinfo/rtk-users >>> >> -------------- next part -------------- An HTML attachment was scrubbed... URL: From lesaint.jerome at gmail.com Mon May 18 17:44:52 2020 From: lesaint.jerome at gmail.com (Jerome Lesaint) Date: Mon, 18 May 2020 23:44:52 +0200 Subject: [Rtk-users] Error in the FFTRampImpageFilter In-Reply-To: References: Message-ID: Hi Simon, sorry for disturbing again. I've updated my repo and compiled again. It fails with the above message : */Users/jerome/src/ITK/Modules/Remote/RTK/src/rtkBioscanGeometryReader.cxx:26:10: **fatal error: **'gdcmImageReader.h' file not found* #include * ^~~~~~~~~~~~~~~~~~~* 1 error generated. make[2]: *** [Modules/Remote/RTK/src/CMakeFiles/RTK.dir/rtkBioscanGeometryReader.cxx.o] Error 1 make[2]: *** Waiting for unfinished jobs.... Any idea ? I guess I need to turn some option(s) in cmake, to get the gdcm module ? Note that I also installed the binary python package you sent in previous mail. The installation and the import are OK. But the python command const = rtk.ConstantImageSource[itk.Image[itk.F,3]].New() output fails with : itkImageToImageFilterIUL2IUL2 not loaded from module ITKCommon because of exception: module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL2IUL2' itkImageToImageFilterIUL3IUL3 not loaded from module ITKCommon because of exception: module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL3IUL3' itkImageToImageFilterIUL2IF2 not loaded from module ITKCommon because of exception: module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL2IF2' itkImageToImageFilterIUL3IF3 not loaded from module ITKCommon because of exception: module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL3IF3' itkImageToImageFilterIUL2ID2 not loaded from module ITKCommon because of exception: module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL2ID2' itkImageToImageFilterIUL3ID3 not loaded from module ITKCommon because of exception: module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL3ID3' stdnumeric_limitsULL not loaded from module ITKCommon because of exception: module 'ITKCommonPython' has no attribute 'stdnumeric_limitsULL' itkNumericTraitsULL not loaded from module ITKCommon because of exception: module 'ITKCommonPython' has no attribute 'itkNumericTraitsULL' Template itk::PyBuffer,2>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,2>>' Template itk::PyBuffer,2>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,2>>' Template itk::PyBuffer,2>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,2>>' Template itk::PyBuffer,2>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,2>>' Template itk::PyBuffer,2>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,2>>' Template itk::PyBuffer,2>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,2>>' Template itk::PyBuffer,3>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,3>>' Template itk::PyBuffer,3>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,3>>' Template itk::PyBuffer,3>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,3>>' Template itk::PyBuffer,3>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,3>>' Template itk::PyBuffer,3>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,3>>' Template itk::PyBuffer,3>> already defined as is redefined as Warning: template already defined 'itk::PyBuffer,3>>' Template itk::CastImageFilter,itk::Image> already defined as is redefined as Warning: template already defined 'itk::CastImageFilter,itk::Image>' Template itk::CastImageFilter,itk::Image> already defined as is redefined as Warning: template already defined 'itk::CastImageFilter,itk::Image>' Template itk::CastImageFilter,itk::Image> already defined as is redefined as Warning: template already defined 'itk::CastImageFilter,itk::Image>' Template itk::CastImageFilter,itk::Image> already defined as is redefined as Warning: template already defined 'itk::CastImageFilter,itk::Image>' Template itk::CastImageFilter,itk::Image> already defined as is redefined as Warning: template already defined 'itk::CastImageFilter,itk::Image>' Template itk::CastImageFilter,itk::Image> already defined as is redefined as Warning: template already defined 'itk::CastImageFilter,itk::Image>' Template itk::CastImageFilter,itk::Image> already defined as is redefined as Warning: template already defined 'itk::CastImageFilter,itk::Image>' Template itk::CastImageFilter,itk::Image> already defined as is redefined as Warning: template already defined 'itk::CastImageFilter,itk::Image>' Template itk::CastImageFilter,itk::Image> already defined as is redefined as Warning: template already defined 'itk::CastImageFilter,itk::Image>' Template itk::CastImageFilter,itk::Image> already defined as is redefined as Warning: template already defined 'itk::CastImageFilter,itk::Image>' itkRegularSphereMeshSourceMF2 not loaded from module ITKMesh because of exception: module 'ITKMeshPython' has no attribute 'itkRegularSphereMeshSourceMF2' itkRegularSphereMeshSourceMD2 not loaded from module ITKMesh because of exception: module 'ITKMeshPython' has no attribute 'itkRegularSphereMeshSourceMD2' itkRegularSphereMeshSourceMF3 not loaded from module ITKMesh because of exception: module 'ITKMeshPython' has no attribute 'itkRegularSphereMeshSourceMF3' itkRegularSphereMeshSourceMD3 not loaded from module ITKMesh because of exception: module 'ITKMeshPython' has no attribute 'itkRegularSphereMeshSourceMD3' itkSphereMeshSourceMF2 not loaded from module ITKMesh because of exception: module 'ITKMeshPython' has no attribute 'itkSphereMeshSourceMF2' itkSphereMeshSourceMD2 not loaded from module ITKMesh because of exception: module 'ITKMeshPython' has no attribute 'itkSphereMeshSourceMD2' itkSphereMeshSourceMF3 not loaded from module ITKMesh because of exception: module 'ITKMeshPython' has no attribute 'itkSphereMeshSourceMF3' itkSphereMeshSourceMD3 not loaded from module ITKMesh because of exception: module 'ITKMeshPython' has no attribute 'itkSphereMeshSourceMD3' --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in ----> 1 const = rtk.ConstantImageSource[itk.Image[itk.F,3]].New() ~/src/ITK-build/Wrapping/Generators/Python/itkLazy.py in __getattribute__(self, attr) * 50* module = self.__belong_lazy_attributes[attr] * 51* namespace = {} ---> 52 itkBase.LoadModule(module, namespace) * 53* self.loaded_lazy_modules.add(module) * 54* for k, v in namespace.items(): ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, namespace) * 81* deps = sorted(data['depends']) * 82* for dep in deps: ---> 83 LoadModule(dep, namespace) * 84* * 85* if itkConfig.ImportCallback: ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, namespace) * 81* deps = sorted(data['depends']) * 82* for dep in deps: ---> 83 LoadModule(dep, namespace) * 84* * 85* if itkConfig.ImportCallback: ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, namespace) * 81* deps = sorted(data['depends']) * 82* for dep in deps: ---> 83 LoadModule(dep, namespace) * 84* * 85* if itkConfig.ImportCallback: ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, namespace) * 81* deps = sorted(data['depends']) * 82* for dep in deps: ---> 83 LoadModule(dep, namespace) * 84* * 85* if itkConfig.ImportCallback: ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, namespace) * 81* deps = sorted(data['depends']) * 82* for dep in deps: ---> 83 LoadModule(dep, namespace) * 84* * 85* if itkConfig.ImportCallback: ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, namespace) * 171* if 'snake_case_functions' in data: * 172* for snakeCaseFunction in data['snake_case_functions']: --> 173 namespace[snakeCaseFunction] = getattr(module, snakeCaseFunction) * 174* init_name = snakeCaseFunction + "_init_docstring" * 175* init_function = getattr(module, init_name) AttributeError: module 'ITKMeshPython' has no attribute 'regular_sphere_mesh_source' Thanks for your help, J?rome Le mer. 13 mai 2020 ? 01:07, Simon Rit a ?crit : > Thanks. This was a multi-threading problem which is now fixed by > processing each projection at a time within a thread: > > https://github.com/SimonRit/RTK/commit/a719d8913beb7b?6a39da787980ead720b353f545 > > 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... > > On Sat, May 9, 2020 at 11:08 AM Jerome Lesaint > wrote: > >> See the code below. >> >> 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 !! >> 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). >> >> J?rome >> >> >> ------------------------------------------------------------------- >> sid = 500 >> sdd = 1000 >> >> spacing = 1 >> nb_pixels = int(257/spacing) >> nb_pixels_u = nb_pixels >> nb_pixels_v = nb_pixels_u >> >> geo_0 = rtk.ThreeDCircularProjectionGeometry.New() >> for i in range(nprojs_0) : >> geo_0.AddProjection(sid,sdd,i) >> >> ImageType = itk.Image[itk.F, 3] >> const = rtk.ConstantImageSource[ImageType].New() >> const.SetConstant(0.) >> const.SetSpacing([spacing,spacing,spacing]) >> const.SetSize([nb_pixels_u,nb_pixels_v,len(geo_0.GetGantryAngles())]) >> const.SetOrigin(-0.5*spacing*(np.array(const.GetSize())-1)) >> sl = rtk.SheppLoganPhantomFilter[ImageType,ImageType].New() >> sl.SetInput(const.GetOutput()) >> sl.SetGeometry(geo_0) >> sl.SetPhantomScale(60) >> >> sl.Update() >> >> #weights = rtk.FDKWeightProjectionFilter[ImageType].New() >> #weights.SetGeometry(geo_0) >> #weights.SetInput(sl.GetOutput()) >> #weights.SetNumberOfWorkUnits(1) >> #weights.InPlaceOff() >> >> ramp = rtk.FFTRampImageFilter[ImageType,ImageType,itk.D].New() >> ramp.SetInput(sl.GetOutput()) >> ramp.Update() >> >> >> Le ven. 8 mai 2020 ? 22:15, Simon Rit a >> ?crit : >> >>> Hi, >>> I cannot reproduce the issue with this code >>> >>> import itk >>> from itk import RTK as rtk >>> >>> ImageType = itk.Image[itk.F,3] >>> >>> constantImageSource = rtk.ConstantImageSource[ImageType].New() >>> constantImageSource.SetOrigin( [ -127.875, -127.875, 0. ] ) >>> constantImageSource.SetSpacing( [ .25 ] *3 ) >>> constantImageSource.SetSize( [ 1024, 512, 360 ] ) >>> constantImageSource.SetConstant(1.) >>> >>> ramp = rtk.FFTRampImageFilter[ImageType, ImageType, itk.D].New() >>> ramp.SetInput(constantImageSource.GetOutput()) >>> ramp.Update() >>> >>> Can you tell me more on the pipeline you're using? >>> Simon >>> >>> On Fri, May 8, 2020 at 9:36 AM Jerome Lesaint >>> wrote: >>> >>>> Salut, >>>> >>>> thanks again for the answer. The streaming workaround seems to work. >>>> 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 ??? >>>> >>>> Anyway, it works fine now. Thank you. >>>> J?rome >>>> >>>> >>>> Le jeu. 7 mai 2020 ? 20:48, Simon Rit >>>> a ?crit : >>>> >>>>> Hi, >>>>> 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. >>>>> Let me know if we can help with one of the two options. >>>>> Simon >>>>> >>>>> On Thu, May 7, 2020 at 7:24 PM Jerome Lesaint < >>>>> lesaint.jerome at gmail.com> wrote: >>>>> >>>>>> Hi, >>>>>> >>>>>> I am trying to use the ramp filter FFTRampImageFilter and it fails at >>>>>> Update time with the error message : >>>>>> >>>>>> 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. >>>>>> >>>>>> I already read Simon's answer to a previous similar issue, saying >>>>>> that he recommends using FFTW by turning ITK_USE_FFTW when building >>>>>> ITK. But I did not compile ITK (on this computer). I simply installed the >>>>>> pre-compiled Python package. >>>>>> My question : can I turn any parameter in Python to force the ramp >>>>>> filter to use this library ? >>>>>> >>>>>> Thanks in advance for your help, >>>>>> >>>>>> J?rome >>>>>> _______________________________________________ >>>>>> Rtk-users mailing list >>>>>> Rtk-users at public.kitware.com >>>>>> https://public.kitware.com/mailman/listinfo/rtk-users >>>>>> >>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From simon.rit at creatis.insa-lyon.fr Mon May 18 18:10:30 2020 From: simon.rit at creatis.insa-lyon.fr (Simon Rit) Date: Tue, 19 May 2020 00:10:30 +0200 Subject: [Rtk-users] Error in the FFTRampImpageFilter In-Reply-To: References: Message-ID: Hi J?r?me, For the compilation, this should have been fixed on the master branch, see this commit . Can you check that your CMakeLists.txt file in the source directory has this change? If not, you did not update the source directory. Note that ITK will automatically rollback to the tag on the ITK repo if you don't change it in the RTK.remote.cmake file or with Module_RTK_GIT_TAG (see INSTALLATION.md ) If yes, I don't know what's wrong, you may need to manually re-run cmake in the build directory. I'm a bit surprised regarding the pre-compiled packages. Can you try the latest version compiled by the CI here ? I don't know which version you have used but ITK v5.1 has been fairly recently released so that may be the issue here. Simon On Mon, May 18, 2020 at 11:45 PM Jerome Lesaint wrote: > Hi Simon, > > sorry for disturbing again. > I've updated my repo and compiled again. It fails with the above message : > > */Users/jerome/src/ITK/Modules/Remote/RTK/src/rtkBioscanGeometryReader.cxx:26:10: > **fatal error: **'gdcmImageReader.h' file not found* > > #include > > * ^~~~~~~~~~~~~~~~~~~* > > 1 error generated. > > make[2]: *** > [Modules/Remote/RTK/src/CMakeFiles/RTK.dir/rtkBioscanGeometryReader.cxx.o] > Error 1 > > make[2]: *** Waiting for unfinished jobs.... > > Any idea ? > I guess I need to turn some option(s) in cmake, to get the gdcm module ? > > Note that I also installed the binary python package you sent in previous > mail. The installation and the import are OK. But the python command > > const = rtk.ConstantImageSource[itk.Image[itk.F,3]].New() > > output fails with : > > itkImageToImageFilterIUL2IUL2 not loaded from module ITKCommon because of > exception: > > module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL2IUL2' > > itkImageToImageFilterIUL3IUL3 not loaded from module ITKCommon because of > exception: > > module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL3IUL3' > > itkImageToImageFilterIUL2IF2 not loaded from module ITKCommon because of > exception: > > module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL2IF2' > > itkImageToImageFilterIUL3IF3 not loaded from module ITKCommon because of > exception: > > module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL3IF3' > > itkImageToImageFilterIUL2ID2 not loaded from module ITKCommon because of > exception: > > module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL2ID2' > > itkImageToImageFilterIUL3ID3 not loaded from module ITKCommon because of > exception: > > module 'ITKCommonPython' has no attribute 'itkImageToImageFilterIUL3ID3' > > stdnumeric_limitsULL not loaded from module ITKCommon because of exception: > > module 'ITKCommonPython' has no attribute 'stdnumeric_limitsULL' > > itkNumericTraitsULL not loaded from module ITKCommon because of exception: > > module 'ITKCommonPython' has no attribute 'itkNumericTraitsULL' > > Template itk::PyBuffer,2>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,2>>' > > Template itk::PyBuffer,2>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,2>>' > > Template itk::PyBuffer,2>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,2>>' > > Template itk::PyBuffer,2>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,2>>' > > Template itk::PyBuffer,2>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,2>>' > > Template itk::PyBuffer,2>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,2>>' > > Template itk::PyBuffer,3>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,3>>' > > Template itk::PyBuffer,3>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,3>>' > > Template itk::PyBuffer,3>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,3>>' > > Template itk::PyBuffer,3>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,3>>' > > Template itk::PyBuffer,3>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,3>>' > > Template itk::PyBuffer,3>> > > already defined as > > is redefined as > > Warning: template already defined > 'itk::PyBuffer,3>>' > > Template > itk::CastImageFilter,itk::Image> > > already defined as 'itkCastImageFilterPython.itkCastImageFilterIULL2ISC2'> > > is redefined as 'itkCastImageFilterPython.itkCastImageFilterIULL2ISC2'> > > Warning: template already defined > 'itk::CastImageFilter,itk::Image>' > > Template > itk::CastImageFilter,itk::Image> > > already defined as 'itkCastImageFilterPython.itkCastImageFilterIULL3ISC3'> > > is redefined as 'itkCastImageFilterPython.itkCastImageFilterIULL3ISC3'> > > Warning: template already defined > 'itk::CastImageFilter,itk::Image>' > > Template > itk::CastImageFilter,itk::Image> > > already defined as 'itkCastImageFilterPython.itkCastImageFilterIULL2ISS2'> > > is redefined as 'itkCastImageFilterPython.itkCastImageFilterIULL2ISS2'> > > Warning: template already defined > 'itk::CastImageFilter,itk::Image>' > > Template > itk::CastImageFilter,itk::Image> > > already defined as 'itkCastImageFilterPython.itkCastImageFilterIULL3ISS3'> > > is redefined as 'itkCastImageFilterPython.itkCastImageFilterIULL3ISS3'> > > Warning: template already defined > 'itk::CastImageFilter,itk::Image>' > > Template > itk::CastImageFilter,itk::Image> > > already defined as 'itkCastImageFilterPython.itkCastImageFilterIULL2IUC2'> > > is redefined as 'itkCastImageFilterPython.itkCastImageFilterIULL2IUC2'> > > Warning: template already defined > 'itk::CastImageFilter,itk::Image>' > > Template > itk::CastImageFilter,itk::Image> > > already defined as 'itkCastImageFilterPython.itkCastImageFilterIULL3IUC3'> > > is redefined as 'itkCastImageFilterPython.itkCastImageFilterIULL3IUC3'> > > Warning: template already defined > 'itk::CastImageFilter,itk::Image>' > > Template > itk::CastImageFilter,itk::Image> > > already defined as 'itkCastImageFilterPython.itkCastImageFilterIULL2IULL2'> > > is redefined as 'itkCastImageFilterPython.itkCastImageFilterIULL2IULL2'> > > Warning: template already defined > 'itk::CastImageFilter,itk::Image>' > > Template > itk::CastImageFilter,itk::Image> > > already defined as 'itkCastImageFilterPython.itkCastImageFilterIULL3IULL3'> > > is redefined as 'itkCastImageFilterPython.itkCastImageFilterIULL3IULL3'> > > Warning: template already defined > 'itk::CastImageFilter,itk::Image>' > > Template > itk::CastImageFilter,itk::Image> > > already defined as 'itkCastImageFilterPython.itkCastImageFilterIULL2IUS2'> > > is redefined as 'itkCastImageFilterPython.itkCastImageFilterIULL2IUS2'> > > Warning: template already defined > 'itk::CastImageFilter,itk::Image>' > > Template > itk::CastImageFilter,itk::Image> > > already defined as 'itkCastImageFilterPython.itkCastImageFilterIULL3IUS3'> > > is redefined as 'itkCastImageFilterPython.itkCastImageFilterIULL3IUS3'> > > Warning: template already defined > 'itk::CastImageFilter,itk::Image>' > > itkRegularSphereMeshSourceMF2 not loaded from module ITKMesh because of > exception: > > module 'ITKMeshPython' has no attribute 'itkRegularSphereMeshSourceMF2' > > itkRegularSphereMeshSourceMD2 not loaded from module ITKMesh because of > exception: > > module 'ITKMeshPython' has no attribute 'itkRegularSphereMeshSourceMD2' > > itkRegularSphereMeshSourceMF3 not loaded from module ITKMesh because of > exception: > > module 'ITKMeshPython' has no attribute 'itkRegularSphereMeshSourceMF3' > > itkRegularSphereMeshSourceMD3 not loaded from module ITKMesh because of > exception: > > module 'ITKMeshPython' has no attribute 'itkRegularSphereMeshSourceMD3' > > itkSphereMeshSourceMF2 not loaded from module ITKMesh because of exception: > > module 'ITKMeshPython' has no attribute 'itkSphereMeshSourceMF2' > > itkSphereMeshSourceMD2 not loaded from module ITKMesh because of exception: > > module 'ITKMeshPython' has no attribute 'itkSphereMeshSourceMD2' > > itkSphereMeshSourceMF3 not loaded from module ITKMesh because of exception: > > module 'ITKMeshPython' has no attribute 'itkSphereMeshSourceMF3' > > itkSphereMeshSourceMD3 not loaded from module ITKMesh because of exception: > > module 'ITKMeshPython' has no attribute 'itkSphereMeshSourceMD3' > > --------------------------------------------------------------------------- > > AttributeError Traceback (most recent call > last) > > in > > ----> 1 const = rtk.ConstantImageSource[itk.Image[itk.F,3]].New() > > > ~/src/ITK-build/Wrapping/Generators/Python/itkLazy.py in __getattribute__(self, > attr) > > * 50* module = self.__belong_lazy_attributes[attr] > > * 51* namespace = {} > > ---> 52 itkBase.LoadModule(module, namespace) > > * 53* self.loaded_lazy_modules.add(module) > > * 54* for k, v in namespace.items(): > > > ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, > namespace) > > * 81* deps = sorted(data['depends']) > > * 82* for dep in deps: > > ---> 83 LoadModule(dep, namespace) > > * 84* > > * 85* if itkConfig.ImportCallback: > > > ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, > namespace) > > * 81* deps = sorted(data['depends']) > > * 82* for dep in deps: > > ---> 83 LoadModule(dep, namespace) > > * 84* > > * 85* if itkConfig.ImportCallback: > > > ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, > namespace) > > * 81* deps = sorted(data['depends']) > > * 82* for dep in deps: > > ---> 83 LoadModule(dep, namespace) > > * 84* > > * 85* if itkConfig.ImportCallback: > > > ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, > namespace) > > * 81* deps = sorted(data['depends']) > > * 82* for dep in deps: > > ---> 83 LoadModule(dep, namespace) > > * 84* > > * 85* if itkConfig.ImportCallback: > > > ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, > namespace) > > * 81* deps = sorted(data['depends']) > > * 82* for dep in deps: > > ---> 83 LoadModule(dep, namespace) > > * 84* > > * 85* if itkConfig.ImportCallback: > > > ~/src/ITK-build/Wrapping/Generators/Python/itkBase.py in LoadModule(name, > namespace) > > * 171* if 'snake_case_functions' in data: > > * 172* for snakeCaseFunction in data > ['snake_case_functions']: > > --> 173 namespace[snakeCaseFunction] = getattr(module, > snakeCaseFunction) > > * 174* init_name = snakeCaseFunction + > "_init_docstring" > > * 175* init_function = getattr(module, init_name) > > > AttributeError: module 'ITKMeshPython' has no attribute > 'regular_sphere_mesh_source' > > > Thanks for your help, > J?rome > > Le mer. 13 mai 2020 ? 01:07, Simon Rit a > ?crit : > >> Thanks. This was a multi-threading problem which is now fixed by >> processing each projection at a time within a thread: >> >> https://github.com/SimonRit/RTK/commit/a719d8913beb7b?6a39da787980ead720b353f545 >> >> 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... >> >> On Sat, May 9, 2020 at 11:08 AM Jerome Lesaint >> wrote: >> >>> See the code below. >>> >>> 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 !! >>> 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). >>> >>> J?rome >>> >>> >>> ------------------------------------------------------------------- >>> sid = 500 >>> sdd = 1000 >>> >>> spacing = 1 >>> nb_pixels = int(257/spacing) >>> nb_pixels_u = nb_pixels >>> nb_pixels_v = nb_pixels_u >>> >>> geo_0 = rtk.ThreeDCircularProjectionGeometry.New() >>> for i in range(nprojs_0) : >>> geo_0.AddProjection(sid,sdd,i) >>> >>> ImageType = itk.Image[itk.F, 3] >>> const = rtk.ConstantImageSource[ImageType].New() >>> const.SetConstant(0.) >>> const.SetSpacing([spacing,spacing,spacing]) >>> const.SetSize([nb_pixels_u,nb_pixels_v,len(geo_0.GetGantryAngles())]) >>> const.SetOrigin(-0.5*spacing*(np.array(const.GetSize())-1)) >>> sl = rtk.SheppLoganPhantomFilter[ImageType,ImageType].New() >>> sl.SetInput(const.GetOutput()) >>> sl.SetGeometry(geo_0) >>> sl.SetPhantomScale(60) >>> >>> sl.Update() >>> >>> #weights = rtk.FDKWeightProjectionFilter[ImageType].New() >>> #weights.SetGeometry(geo_0) >>> #weights.SetInput(sl.GetOutput()) >>> #weights.SetNumberOfWorkUnits(1) >>> #weights.InPlaceOff() >>> >>> ramp = rtk.FFTRampImageFilter[ImageType,ImageType,itk.D].New() >>> ramp.SetInput(sl.GetOutput()) >>> ramp.Update() >>> >>> >>> Le ven. 8 mai 2020 ? 22:15, Simon Rit >>> a ?crit : >>> >>>> Hi, >>>> I cannot reproduce the issue with this code >>>> >>>> import itk >>>> from itk import RTK as rtk >>>> >>>> ImageType = itk.Image[itk.F,3] >>>> >>>> constantImageSource = rtk.ConstantImageSource[ImageType].New() >>>> constantImageSource.SetOrigin( [ -127.875, -127.875, 0. ] ) >>>> constantImageSource.SetSpacing( [ .25 ] *3 ) >>>> constantImageSource.SetSize( [ 1024, 512, 360 ] ) >>>> constantImageSource.SetConstant(1.) >>>> >>>> ramp = rtk.FFTRampImageFilter[ImageType, ImageType, itk.D].New() >>>> ramp.SetInput(constantImageSource.GetOutput()) >>>> ramp.Update() >>>> >>>> Can you tell me more on the pipeline you're using? >>>> Simon >>>> >>>> On Fri, May 8, 2020 at 9:36 AM Jerome Lesaint >>>> wrote: >>>> >>>>> Salut, >>>>> >>>>> thanks again for the answer. The streaming workaround seems to work. >>>>> 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 ??? >>>>> >>>>> Anyway, it works fine now. Thank you. >>>>> J?rome >>>>> >>>>> >>>>> Le jeu. 7 mai 2020 ? 20:48, Simon Rit >>>>> a ?crit : >>>>> >>>>>> Hi, >>>>>> 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. >>>>>> Let me know if we can help with one of the two options. >>>>>> Simon >>>>>> >>>>>> On Thu, May 7, 2020 at 7:24 PM Jerome Lesaint < >>>>>> lesaint.jerome at gmail.com> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> I am trying to use the ramp filter FFTRampImageFilter and it fails >>>>>>> at Update time with the error message : >>>>>>> >>>>>>> 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. >>>>>>> >>>>>>> I already read Simon's answer to a previous similar issue, saying >>>>>>> that he recommends using FFTW by turning ITK_USE_FFTW when building >>>>>>> ITK. But I did not compile ITK (on this computer). I simply installed the >>>>>>> pre-compiled Python package. >>>>>>> My question : can I turn any parameter in Python to force the ramp >>>>>>> filter to use this library ? >>>>>>> >>>>>>> Thanks in advance for your help, >>>>>>> >>>>>>> J?rome >>>>>>> _______________________________________________ >>>>>>> Rtk-users mailing list >>>>>>> Rtk-users at public.kitware.com >>>>>>> https://public.kitware.com/mailman/listinfo/rtk-users >>>>>>> >>>>>> -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoonho94.na at gmail.com Wed May 20 20:33:01 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Thu, 21 May 2020 09:33:01 +0900 Subject: [Rtk-users] how to create own exe files? Message-ID: Hi rtk-users~ I modified rtkprojectgeometricphantom.cxx and want to make and exe file. and when I configure with CMake It is keep saying Unknown CMake command "WRAP_GGO". how can I make my own exe file using the basic frame of rtk application files? -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreasga22 at gmail.com Thu May 21 03:49:09 2020 From: andreasga22 at gmail.com (Andreas Andersen) Date: Thu, 21 May 2020 09:49:09 +0200 Subject: [Rtk-users] how to create own exe files? In-Reply-To: References: Message-ID: I think you just need to add `find_package(Gengetopt REQUIRED)` to your CMakeLists.txt to get the WRAP_GGO function. You'll probably need to set Gengetopt_DIR when you configure the project to the path where Gengetopt was built (which may be somewhere deep in the RTK build directory - I don't remember) /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Thu, 21 May 2020 at 02:33, ??? wrote: > Hi rtk-users~ > > I modified rtkprojectgeometricphantom.cxx and want to make and exe file. > > and when I configure with CMake It is keep saying > > Unknown CMake command "WRAP_GGO". > > > how can I make my own exe file using the basic frame of rtk application > files? > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoonho94.na at gmail.com Sun May 24 21:10:36 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Mon, 25 May 2020 10:10:36 +0900 Subject: [Rtk-users] problem with cmake Message-ID: Hi I'm trying to build just one cxx file specifically rtkprojectgeometricphantom.cxx I copied rtkprojectgeometricphantom.cxx, rtkprojectgeometricphantom.cxx, CMakeLists.txt to new directory. and in CMakeLists.txt, I added three lines cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR) > find_package(Gengetopt REQUIRED) > project(rtkprojectgeometricphantom) here is an error message. CMake Error at CMakeLists.txt:3 (find_package): By not providing "FindGengetopt.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "Gengetopt", but CMake did not find one. Could not find a package configuration file provided by "Gengetopt" with any of the following names: GengetoptConfig.cmake gengetopt-config.cmake Add the installation prefix of "Gengetopt" to CMAKE_PREFIX_PATH or set "Gengetopt_DIR" to a directory containing one of the above files. If "Gengetopt" provides a separate development package or SDK, be sure it has been installed. Configuring incomplete, errors occurred! I need to set an Gengetopt_DIR. at first I set the directory where rtkprojectgeometricphantom.ggo is but It didn't work and than I set the directory where FindGengetopt.cmake is It still didn't work. I think I need to find the directory of GengetoptConfig.cmake or gengetopt-config.cmake how can I build only one cxx file? -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreasga22 at gmail.com Mon May 25 02:47:07 2020 From: andreasga22 at gmail.com (Andreas Andersen) Date: Mon, 25 May 2020 08:47:07 +0200 Subject: [Rtk-users] problem with cmake In-Reply-To: References: Message-ID: It should not be necessary to set `Gengetopt_DIR` I think what you actually need is to have a `find_package(ITK REQUIRED)` before your `find_package(Gengetopt REQUIRED)` (and you'll need ITK for RTK anyway) Reading "FindGengetopt.cmake" from ITK, I can see it defines the `WRAP_GGO` macro. So we just want to trigger this Find script. (I'm unsure if it's also necessary to have `include(${ITK_USE_FILE})` before `find_package(Gengetopt REQUIRED)`, but it might be) So I would recommend something like: ``` cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR) project(rtkprojectgeometricphantom) find_package(ITK REQUIRED) include(${ITK_USE_FILE}) find_package(Gengetopt REQUIRED) ``` /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Mon, 25 May 2020 at 03:10, ??? wrote: > Hi I'm trying to build just one cxx file > specifically rtkprojectgeometricphantom.cxx > > I copied rtkprojectgeometricphantom.cxx, rtkprojectgeometricphantom.cxx, > CMakeLists.txt to new directory. > > and in CMakeLists.txt, I added three lines > > cmake_minimum_required(VERSION 3.9.5 FATAL_ERROR) >> find_package(Gengetopt REQUIRED) >> project(rtkprojectgeometricphantom) > > > here is an error message. > > CMake Error at CMakeLists.txt:3 (find_package): > > By not providing "FindGengetopt.cmake" in CMAKE_MODULE_PATH this project > has asked CMake to find a package configuration file provided by > "Gengetopt", but CMake did not find one. > > Could not find a package configuration file provided by "Gengetopt" with > any of the following names: > > GengetoptConfig.cmake > gengetopt-config.cmake > > Add the installation prefix of "Gengetopt" to CMAKE_PREFIX_PATH or set > "Gengetopt_DIR" to a directory containing one of the above files. If > "Gengetopt" provides a separate development package or SDK, be sure it has > been installed. > > Configuring incomplete, errors occurred! > > > I need to set an Gengetopt_DIR. > > > at first I set the directory where rtkprojectgeometricphantom.ggo is but > It didn't work > > and than I set the directory where FindGengetopt.cmake is It still didn't > work. > > > I think I need to find the directory of GengetoptConfig.cmake or > gengetopt-config.cmake > > > how can I build only one cxx file? > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From erwinwalter11 at web.de Mon May 25 12:48:28 2020 From: erwinwalter11 at web.de (erwinwalter11 at web.de) Date: Mon, 25 May 2020 18:48:28 +0200 Subject: [Rtk-users] Blurry reconstructions in ROOSTER Message-ID: <003801d632b4$51631b80$f4295280$@web.de> Hi, for my Master's thesis I am testing some implementations for a 4D reconstruction of small mice set. For this I apply the rooster algorithm on the full projection set with a discretised phase signal. To compare the rooster reconstruction I also take a subset of the full set with rtksubselect considering the phase signal and apply the regularized conjugate gradient reconstruction algorithm on that subset of projections. This way I get a 3D reconstruction for each phase respectively. However with the same gamma_space=8e-6 (in regularized cg gammatv defined) in the total variation step both in rooster and regularized conjugate gradient and gamma_time equal to 0 in roosters algorithm, I do not get the same results. The rooster reconstruction is much more blurried compared to the regularized conjugate gradient reconstruction, which surprises me. Shouldn't be both reconstructions nearly identical under same conditions? Outer and inner loops (n_iter=30, tv_iter=10, cg_iter=4) are equally set. The blurriness occurs only in respiratory phases with small amount of projections (approx. 90) For visualization I have added an example to the following link: https://gigamove.rz.rwth-aachen.de/d/id/P42uxboh472jzV The regularized conjugate gradient reconstruction is shown on both upper images and the rooster reconstruction is shown on both lower images. I appreciate any help or explanation. Erwin -------------- next part -------------- An HTML attachment was scrubbed... URL: From Brani_Rusanov at hotmail.com Mon May 25 23:08:35 2020 From: Brani_Rusanov at hotmail.com (Brani Rusanov) Date: Tue, 26 May 2020 03:08:35 +0000 Subject: [Rtk-users] Unable to Forward Project CT Volume With Correct Orientation Message-ID: Hi all, I am attempting to forward project a CT volume (previously registered to a CBCT volume) using the geometry of a CBCT volume to generate raw projections. I also have access to the raw CBCT projections. I have used rktprojections to stack the raw CBCT projections and generate .mhd/raw files. Next, I used rtkvariabprobeamgeometry on the scan.xml file that came with the raw CBCT projections to generate a RTK compatible geometry.xml file. Next, I have stacked the registered CT dicoms into a .mhd/raw format. The trouble I'm having is creating the projections using rtkforwardprojections. Specifically, I cannot find the correct transformmatrix in the CT header to tell rtkforwardprojetions the conversion from DICOM to IEC geometry. The output projections do not look like the raw projections I have from the CBCT. This may be a stupid question, but I cannot figure it out. From my own estimation, the transformation should be 1 0 0 0 0 -1 0 1 0 based on this diagram (https://www.semanticscholar.org/paper/nuclear-science-and-technology-Radiation-Quantities-Brink-McNitt-Gray/1ec27be3617dfc4e03bba86dcd92db8f3323de21/figure/3 [https://ai2-s2-public.s3.amazonaws.com/figures/2017-08-08/1ec27be3617dfc4e03bba86dcd92db8f3323de21/14-Figure1.4-1.png] Figure 1.4 from nuclear science and technology Radiation Quantities and Units , Dose to the Patients , and Image Quality in Computed Tomography ( CT ) ( RAD UNITS ) Author : | Semantic Scholar Figure 1.4 (left) The IEC patient coordinate system (the patient is lying in supine position); (right) transformation of coordinates between the IEC and DICOM coordinate systems [IEC, 2000] (cited in ICRU Report 71, 2004, page 35) - "nuclear science and technology Radiation Quantities and Units , Dose to the Patients , and Image Quality in Computed Tomography ( CT ) ( RAD UNITS ) Author :" www.semanticscholar.org ) My questions are: Is this the correct transformmatrix to apply? Do I need to also change the offset values in order to get the correct projections? Could this have something to do with the fact that I am using variant data? The .mhd for the registered CT is: ObjectType = Image NDims = 3 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 0 0 -1 0 1 0 Offset = -131.03451538085938 -131.03451538085938 -91.809638977050781 CenterOfRotation = 0 0 0 AnatomicalOrientation = RAI ElementSpacing = 0.51285523409720002 0.51285523409720002 1.9958648681640625 DimSize = 512 512 93 ElementType = MET_DOUBLE ElementDataFile = CIRS_6A.raw Similarly, the .mhd for the raw CBCT projections is: ObjectType = Image NDims = 3 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 0 1 0 0 0 1 Offset = -198.46200000000002 -148.798 0 CenterOfRotation = 0 0 0 AnatomicalOrientation = RAI ElementSpacing = 0.38800000000000001 0.38800000000000001 1 DimSize = 1024 768 501 ElementType = MET_FLOAT ElementDataFile = CIRS_6A_SCGH_P.raw Thank you kindly for your response, Brani -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoonho94.na at gmail.com Mon May 25 23:12:15 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Tue, 26 May 2020 12:12:15 +0900 Subject: [Rtk-users] question about rtkfdk Message-ID: Hi everyone. In the rtkfdk.cxx, feldkamp gets an two inputs constant image source and pssf. I want to know where the exact computing script part is. what I'm guessing is the empty constant image source only gives the output image size and the only pssf is used in reconstructing calculation. or does both inputs goes into the calculation process? if it is how does those two inputs with different array shape calculates? Best Regards. Yoonho. -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreasga22 at gmail.com Tue May 26 04:51:49 2020 From: andreasga22 at gmail.com (Andreas Andersen) Date: Tue, 26 May 2020 10:51:49 +0200 Subject: [Rtk-users] Unable to Forward Project CT Volume With Correct Orientation In-Reply-To: References: Message-ID: What do you more precisely mean by "The output projections do not look like the raw projections I have from the CBCT" Are they flipped, are they all black, are they much brighter or darker, or do they not align? If alignment: Consider if you need to sort the projections by gantry angle before visual comparison, the Xim reader just reads sequentially by the given regex, so a ProBeam CB (with two imagers) may interleave projections from different angles. This is unlikely to be a problem for a gantry with only one imager. If flipped or all black: Your transformation matrix looks correct to me, so I think the problem may be elsewhere. It's always a mess to figure out. Be careful, that when you flip axes manually like that that you also remember to flip offsets (origin), spacing, etc. accordingly. In particular orientation (directions), I can see it says RAI for "AnatomicalOrientation", but I think you'll need the "Orientation" tag with direction cosines if you want to specify the directions manually. https://itk.org/Wiki/ITK/MetaIO/Documentation#MetaObject_Tags All this being said, I would suggest to instead use ITK's readers and the built-in filters for image transformation if that's even necessary, to avoid the hell of trying to keep track of all these values manually. If intensity is darker or brighter: Check if you have preprocessed the CB projections correctly for bow-tie filter and the like. I hope this gives a hint to where the problem might be. /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Tue, 26 May 2020 at 05:08, Brani Rusanov wrote: > Hi all, > > I am attempting to forward project a CT volume (previously registered to a > CBCT volume) using the geometry of a CBCT volume to generate raw > projections. I also have access to the raw CBCT projections. I have used > rktprojections to stack the raw CBCT projections and generate .mhd/raw > files. > > Next, I used rtkvariabprobeamgeometry on the scan.xml file that came with > the raw CBCT projections to generate a RTK compatible geometry.xml file. > > Next, I have stacked the registered CT dicoms into a .mhd/raw format. The > trouble I'm having is creating the projections using rtkforwardprojections. > Specifically, I cannot find the correct transformmatrix in the CT header to > tell rtkforwardprojetions the conversion from DICOM to IEC geometry. The > output projections do not look like the raw projections I have from the > CBCT. This may be a stupid question, but I cannot figure it out. From my > own estimation, the transformation should be 1 0 0 0 0 -1 0 1 0 based on > this diagram ( > https://www.semanticscholar.org/paper/nuclear-science-and-technology-Radiation-Quantities-Brink-McNitt-Gray/1ec27be3617dfc4e03bba86dcd92db8f3323de21/figure/3 > > > Figure 1.4 from nuclear science and technology Radiation Quantities and > Units , Dose to the Patients , and Image Quality in Computed Tomography ( > CT ) ( RAD UNITS ) Author : | Semantic Scholar > > Figure 1.4 (left) The IEC patient coordinate system (the patient is lying > in supine position); (right) transformation of coordinates between the IEC > and DICOM coordinate systems [IEC, 2000] (cited in ICRU Report 71, 2004, > page 35) - "nuclear science and technology Radiation Quantities and Units , > Dose to the Patients , and Image Quality in Computed Tomography ( CT ) ( > RAD UNITS ) Author :" > www.semanticscholar.org > ) > > My questions are: Is this the correct transformmatrix to apply? > Do I need to also change the offset values in order to get the correct > projections? > Could this have something to do with the fact that I am using variant data? > > The .mhd for the registered CT is: > ObjectType = Image > NDims = 3 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 0 0 -1 0 1 0 > Offset = -131.03451538085938 -131.03451538085938 -91.809638977050781 > CenterOfRotation = 0 0 0 > AnatomicalOrientation = RAI > ElementSpacing = 0.51285523409720002 0.51285523409720002 1.9958648681640625 > DimSize = 512 512 93 > ElementType = MET_DOUBLE > ElementDataFile = CIRS_6A.raw > > Similarly, the .mhd for the raw CBCT projections is: > ObjectType = Image > NDims = 3 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 0 1 0 0 0 1 > Offset = -198.46200000000002 -148.798 0 > CenterOfRotation = 0 0 0 > AnatomicalOrientation = RAI > ElementSpacing = 0.38800000000000001 0.38800000000000001 1 > DimSize = 1024 768 501 > ElementType = MET_FLOAT > ElementDataFile = CIRS_6A_SCGH_P.raw > > Thank you kindly for your response, > Brani > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreasga22 at gmail.com Tue May 26 05:26:46 2020 From: andreasga22 at gmail.com (Andreas Andersen) Date: Tue, 26 May 2020 11:26:46 +0200 Subject: [Rtk-users] question about rtkfdk In-Reply-To: References: Message-ID: RTK and ITK uses pipeline based calculation, so you build a pipeline and in the end call ->Update() on the last filter (sometimes also on earlier filter if some synchronisation is needed) In the case of rtkfdk.cxx, update is called on the writer at the very end. The Update call triggers certain functions in the image filters and in particular GenerateData, which is where the actual computation usually will take place. For the CPU FDK filter, the GenerateData function is defined at: https://github.com/SimonRit/RTK/blob/master/include/rtkFDKConeBeamReconstructionFilter.hxx#L117 Which internally calls update on the BackProjectionImageFilter, thus: https://github.com/SimonRit/RTK/blob/master/include/rtkFDKBackProjectionImageFilter.hxx#L53 Input 1, pssf, is the Parker Short Scan Filter and pssf->GetOutput() will return the processed projections. Input 0, constantimagesource, is, as you correctly said, to get the output image geometry (if you want to do some iterative FDK or online reconstruction this can also be the output image of the previous iteration.) I don't think constantimagesource needs it's image buffer to be allocated before it's given as input, only the UpdateOutputInformation is necessary, which asks ITK to propagate the geometry information to all the variables used internally, i.e. in GetLargestPossibleRegion and the like. I hope this is somewhat understandable. The pipeline system in ITK is confusing in the beginning, but once you get it, it's easy to use ( Although probably still confusing when trying to write your own filters - it is for me :p ). /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Tue, 26 May 2020 at 05:12, ??? wrote: > Hi everyone. > > In the rtkfdk.cxx, feldkamp gets an two inputs constant image source and > pssf. > > I want to know where the exact computing script part is. > > what I'm guessing is the empty constant image source only gives the output > image size and the only pssf is used in reconstructing calculation. > > or does both inputs goes into the calculation process? > if it is how does those two inputs with different array shape calculates? > > Best Regards. > > Yoonho. > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brani_rusanov at hotmail.com Tue May 26 06:37:00 2020 From: brani_rusanov at hotmail.com (Brani Rusanov) Date: Tue, 26 May 2020 10:37:00 +0000 Subject: [Rtk-users] Unable to Forward Project CT Volume With Correct Orientation In-Reply-To: References: , Message-ID: Hi Andreas, You are correct, I had failed to flip the y and z coordinates of the offset parameter in the header. I had thought that the transformmatrix would take care of this. Now the simulated projection looks as desired. Thank you! You mentioned the possibility of applying pre-processing on the CB projections for a bow-tie filter. Do you know what kind of pre-processing is available within RTK for bow-tie filters? I ask because I plan on subtracting the measured CBCT projections from the simulated CT-registered projections. However, the measured CBCT projections have the characteristic attenuation pattern on the left and right side of the image corresponding to a bow-tie filter. Can RTK remove these two regions of greater attenuation? Also, would you happen to know if rtkprojections, when converting the raw projection float values to attenuation, is compatible with Varian raw projection data? I ask this because the studies I have read that perform this procedure use Elekta projection data. The output attenuation values for my measured projection data in air region is about ~2 mm-1 after conversion with rtkprojections. Whereas, I previously converted the HU of the registered CT volume to attenuation using the formula: mu = (HU + 1024)/2^16 which shows air to be ~0.019mm-1 once forward projected. Thank you kindly for your advice, Brani ________________________________ From: Andreas Andersen Sent: Tuesday, 26 May 2020 4:51 PM To: Brani Rusanov Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] Unable to Forward Project CT Volume With Correct Orientation What do you more precisely mean by "The output projections do not look like the raw projections I have from the CBCT" Are they flipped, are they all black, are they much brighter or darker, or do they not align? If alignment: Consider if you need to sort the projections by gantry angle before visual comparison, the Xim reader just reads sequentially by the given regex, so a ProBeam CB (with two imagers) may interleave projections from different angles. This is unlikely to be a problem for a gantry with only one imager. If flipped or all black: Your transformation matrix looks correct to me, so I think the problem may be elsewhere. It's always a mess to figure out. Be careful, that when you flip axes manually like that that you also remember to flip offsets (origin), spacing, etc. accordingly. In particular orientation (directions), I can see it says RAI for "AnatomicalOrientation", but I think you'll need the "Orientation" tag with direction cosines if you want to specify the directions manually. https://itk.org/Wiki/ITK/MetaIO/Documentation#MetaObject_Tags All this being said, I would suggest to instead use ITK's readers and the built-in filters for image transformation if that's even necessary, to avoid the hell of trying to keep track of all these values manually. If intensity is darker or brighter: Check if you have preprocessed the CB projections correctly for bow-tie filter and the like. I hope this gives a hint to where the problem might be. /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Tue, 26 May 2020 at 05:08, Brani Rusanov > wrote: Hi all, I am attempting to forward project a CT volume (previously registered to a CBCT volume) using the geometry of a CBCT volume to generate raw projections. I also have access to the raw CBCT projections. I have used rktprojections to stack the raw CBCT projections and generate .mhd/raw files. Next, I used rtkvariabprobeamgeometry on the scan.xml file that came with the raw CBCT projections to generate a RTK compatible geometry.xml file. Next, I have stacked the registered CT dicoms into a .mhd/raw format. The trouble I'm having is creating the projections using rtkforwardprojections. Specifically, I cannot find the correct transformmatrix in the CT header to tell rtkforwardprojetions the conversion from DICOM to IEC geometry. The output projections do not look like the raw projections I have from the CBCT. This may be a stupid question, but I cannot figure it out. From my own estimation, the transformation should be 1 0 0 0 0 -1 0 1 0 based on this diagram (https://www.semanticscholar.org/paper/nuclear-science-and-technology-Radiation-Quantities-Brink-McNitt-Gray/1ec27be3617dfc4e03bba86dcd92db8f3323de21/figure/3 [https://ai2-s2-public.s3.amazonaws.com/figures/2017-08-08/1ec27be3617dfc4e03bba86dcd92db8f3323de21/14-Figure1.4-1.png] Figure 1.4 from nuclear science and technology Radiation Quantities and Units , Dose to the Patients , and Image Quality in Computed Tomography ( CT ) ( RAD UNITS ) Author : | Semantic Scholar Figure 1.4 (left) The IEC patient coordinate system (the patient is lying in supine position); (right) transformation of coordinates between the IEC and DICOM coordinate systems [IEC, 2000] (cited in ICRU Report 71, 2004, page 35) - "nuclear science and technology Radiation Quantities and Units , Dose to the Patients , and Image Quality in Computed Tomography ( CT ) ( RAD UNITS ) Author :" www.semanticscholar.org ) My questions are: Is this the correct transformmatrix to apply? Do I need to also change the offset values in order to get the correct projections? Could this have something to do with the fact that I am using variant data? The .mhd for the registered CT is: ObjectType = Image NDims = 3 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 0 0 -1 0 1 0 Offset = -131.03451538085938 -131.03451538085938 -91.809638977050781 CenterOfRotation = 0 0 0 AnatomicalOrientation = RAI ElementSpacing = 0.51285523409720002 0.51285523409720002 1.9958648681640625 DimSize = 512 512 93 ElementType = MET_DOUBLE ElementDataFile = CIRS_6A.raw Similarly, the .mhd for the raw CBCT projections is: ObjectType = Image NDims = 3 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 0 1 0 0 0 1 Offset = -198.46200000000002 -148.798 0 CenterOfRotation = 0 0 0 AnatomicalOrientation = RAI ElementSpacing = 0.38800000000000001 0.38800000000000001 1 DimSize = 1024 768 501 ElementType = MET_FLOAT ElementDataFile = CIRS_6A_SCGH_P.raw Thank you kindly for your response, Brani _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreasga22 at gmail.com Tue May 26 07:15:45 2020 From: andreasga22 at gmail.com (Andreas Andersen) Date: Tue, 26 May 2020 13:15:45 +0200 Subject: [Rtk-users] Unable to Forward Project CT Volume With Correct Orientation In-Reply-To: References: Message-ID: I'm happy to hear it worked! I don't know the complete Varian pipeline for correction, there should in addition to subtracting the bow-tie be something like a calibration-chamber-based correction, but I have not figured out how to do this (let me know if you do) RTK does not have filters to take care of this (yet). It would be possible to do, but you'd have to know which image in the calibration folder is the correct one. (There may be several and I think they are named by the local Varian engineers - not standardised) I do a simple subtraction in my own OpenCL implementation, but looping through projections, extracting 2D from 3D, and using the ITK subtraction image filter would probably be simpler. (*If I should find documentation from Varian describing this process with some standard, I'll write it into the reader for Xim images. However, I'm afraid their own solution might specific to each gantry or engineering team* ) It could sound like you want to do the "a priori scatter correction", I've implemented this for Varian based projections (hnd and xim), see: gitlab.com/agravgaard/cbctrecon (The Develop branch should be preferred at the moment) The correction factor from the original Elekta implementation doesn't work without a normalisation as mentioned above, so I'm doing some tricks to ensure correctness of projection intensity for the subtraction, but I hope to implement a solution/normalisation based on numbers from the machine instead. /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Tue, 26 May 2020 at 12:37, Brani Rusanov wrote: > Hi Andreas, > > You are correct, I had failed to flip the y and z coordinates of the > offset parameter in the header. I had thought that the transformmatrix > would take care of this. Now the simulated projection looks as desired. > Thank you! > > You mentioned the possibility of applying pre-processing on the CB > projections for a bow-tie filter. Do you know what kind of pre-processing > is available within RTK for bow-tie filters? I ask because I plan on > subtracting the measured CBCT projections from the simulated CT-registered > projections. However, the measured CBCT projections have the characteristic > attenuation pattern on the left and right side of the image corresponding > to a bow-tie filter. Can RTK remove these two regions of greater > attenuation? > > Also, would you happen to know if rtkprojections, when converting the raw > projection float values to attenuation, is compatible with Varian raw > projection data? I ask this because the studies I have read that perform > this procedure use Elekta projection data. The output attenuation values > for my measured projection data in air region is about ~2 mm-1 after > conversion with rtkprojections. Whereas, I previously converted the HU of > the registered CT volume to attenuation using the formula: mu = (HU + > 1024)/2^16 which shows air to be ~0.019mm-1 once forward projected. > > Thank you kindly for your advice, > Brani > ------------------------------ > *From:* Andreas Andersen > *Sent:* Tuesday, 26 May 2020 4:51 PM > *To:* Brani Rusanov > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] Unable to Forward Project CT Volume With > Correct Orientation > > What do you more precisely mean by "The output projections do not look > like the raw projections I have from the CBCT" > Are they flipped, are they all black, are they much brighter or darker, or > do they not align? > > If alignment: Consider if you need to sort the projections by gantry angle > before visual comparison, the Xim reader just reads sequentially by the > given regex, so a ProBeam CB (with two imagers) may interleave projections > from different angles. This is unlikely to be a problem for a gantry with > only one imager. > > If flipped or all black: Your transformation matrix looks correct to me, > so I think the problem may be elsewhere. > It's always a mess to figure out. Be careful, that when you flip axes > manually like that that you also remember to flip offsets (origin), > spacing, etc. accordingly. > In particular orientation (directions), I can see it says RAI for > "AnatomicalOrientation", but I think you'll need the "Orientation" tag with > direction cosines if you want to specify the directions manually. > https://itk.org/Wiki/ITK/MetaIO/Documentation#MetaObject_Tags > > > All this being said, I would suggest to instead use ITK's readers and the > built-in filters for image transformation if that's even necessary, to > avoid the hell of trying to keep track of all these values manually. > > If intensity is darker or brighter: Check if you have preprocessed the CB > projections correctly for bow-tie filter and the like. > > I hope this gives a hint to where the problem might be. > > /Andreas > > __________________________________ > > Andreas Gravgaard Andersen > > Danish Center for Particle Therapy, > > Aarhus University Hospital > > Palle Juul-Jensens Blvd. 99, > > 8200, Aarhus > > Mail: agravgaard at protonmail.com > > Cell: +45 3165 8140 > > > On Tue, 26 May 2020 at 05:08, Brani Rusanov > wrote: > > Hi all, > > I am attempting to forward project a CT volume (previously registered to a > CBCT volume) using the geometry of a CBCT volume to generate raw > projections. I also have access to the raw CBCT projections. I have used > rktprojections to stack the raw CBCT projections and generate .mhd/raw > files. > > Next, I used rtkvariabprobeamgeometry on the scan.xml file that came with > the raw CBCT projections to generate a RTK compatible geometry.xml file. > > Next, I have stacked the registered CT dicoms into a .mhd/raw format. The > trouble I'm having is creating the projections using rtkforwardprojections. > Specifically, I cannot find the correct transformmatrix in the CT header to > tell rtkforwardprojetions the conversion from DICOM to IEC geometry. The > output projections do not look like the raw projections I have from the > CBCT. This may be a stupid question, but I cannot figure it out. From my > own estimation, the transformation should be 1 0 0 0 0 -1 0 1 0 based on > this diagram ( > https://www.semanticscholar.org/paper/nuclear-science-and-technology-Radiation-Quantities-Brink-McNitt-Gray/1ec27be3617dfc4e03bba86dcd92db8f3323de21/figure/3 > > > > Figure 1.4 from nuclear science and technology Radiation Quantities and > Units , Dose to the Patients , and Image Quality in Computed Tomography ( > CT ) ( RAD UNITS ) Author : | Semantic Scholar > > Figure 1.4 (left) The IEC patient coordinate system (the patient is lying > in supine position); (right) transformation of coordinates between the IEC > and DICOM coordinate systems [IEC, 2000] (cited in ICRU Report 71, 2004, > page 35) - "nuclear science and technology Radiation Quantities and Units , > Dose to the Patients , and Image Quality in Computed Tomography ( CT ) ( > RAD UNITS ) Author :" > www.semanticscholar.org > > ) > > My questions are: Is this the correct transformmatrix to apply? > Do I need to also change the offset values in order to get the correct > projections? > Could this have something to do with the fact that I am using variant data? > > The .mhd for the registered CT is: > ObjectType = Image > NDims = 3 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 0 0 -1 0 1 0 > Offset = -131.03451538085938 -131.03451538085938 -91.809638977050781 > CenterOfRotation = 0 0 0 > AnatomicalOrientation = RAI > ElementSpacing = 0.51285523409720002 0.51285523409720002 1.9958648681640625 > DimSize = 512 512 93 > ElementType = MET_DOUBLE > ElementDataFile = CIRS_6A.raw > > Similarly, the .mhd for the raw CBCT projections is: > ObjectType = Image > NDims = 3 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 0 1 0 0 0 1 > Offset = -198.46200000000002 -148.798 0 > CenterOfRotation = 0 0 0 > AnatomicalOrientation = RAI > ElementSpacing = 0.38800000000000001 0.38800000000000001 1 > DimSize = 1024 768 501 > ElementType = MET_FLOAT > ElementDataFile = CIRS_6A_SCGH_P.raw > > Thank you kindly for your response, > Brani > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brani_rusanov at hotmail.com Wed May 27 00:00:25 2020 From: brani_rusanov at hotmail.com (Brani Rusanov) Date: Wed, 27 May 2020 04:00:25 +0000 Subject: [Rtk-users] Unable to Forward Project CT Volume With Correct Orientation In-Reply-To: References: , Message-ID: Hi Andreas, Your input is invaluable, thanks for your suggestions! You are correct, I am attempting to apply the a priori scatter correction. Is the normalisation procedure you mentioned regarding the calibration-chamber similar to what has been mentioned on page 63-64 of this thesis (https://pdfs.semanticscholar.org/d90c/d77b61d10d2c24df0686bc0be1f38424d67d.pdf), specifically Norm Chamber (NC) values located in raw projection header? I will admit, I am a complete novice when it comes to C coding and using RTK. For correctly normalising the Varian projections do you recommend installing your "cbctrecon" package? If so, which function performs the Varian normalisation? Or can the normalisation be done by scaling the projection pixel values manually? My plan is to manually scale the CB projections and perform a reconstruction until the HU looks right. A more robust method is preferable, however. Your advice is greatly appreciated, Brani ________________________________ From: Andreas Andersen Sent: Tuesday, 26 May 2020 7:15 PM To: Brani Rusanov Cc: rtk-users at public.kitware.com Subject: Re: [Rtk-users] Unable to Forward Project CT Volume With Correct Orientation I'm happy to hear it worked! I don't know the complete Varian pipeline for correction, there should in addition to subtracting the bow-tie be something like a calibration-chamber-based correction, but I have not figured out how to do this (let me know if you do) RTK does not have filters to take care of this (yet). It would be possible to do, but you'd have to know which image in the calibration folder is the correct one. (There may be several and I think they are named by the local Varian engineers - not standardised) I do a simple subtraction in my own OpenCL implementation, but looping through projections, extracting 2D from 3D, and using the ITK subtraction image filter would probably be simpler. (If I should find documentation from Varian describing this process with some standard, I'll write it into the reader for Xim images. However, I'm afraid their own solution might specific to each gantry or engineering team) It could sound like you want to do the "a priori scatter correction", I've implemented this for Varian based projections (hnd and xim), see: gitlab.com/agravgaard/cbctrecon (The Develop branch should be preferred at the moment) The correction factor from the original Elekta implementation doesn't work without a normalisation as mentioned above, so I'm doing some tricks to ensure correctness of projection intensity for the subtraction, but I hope to implement a solution/normalisation based on numbers from the machine instead. /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Tue, 26 May 2020 at 12:37, Brani Rusanov > wrote: Hi Andreas, You are correct, I had failed to flip the y and z coordinates of the offset parameter in the header. I had thought that the transformmatrix would take care of this. Now the simulated projection looks as desired. Thank you! You mentioned the possibility of applying pre-processing on the CB projections for a bow-tie filter. Do you know what kind of pre-processing is available within RTK for bow-tie filters? I ask because I plan on subtracting the measured CBCT projections from the simulated CT-registered projections. However, the measured CBCT projections have the characteristic attenuation pattern on the left and right side of the image corresponding to a bow-tie filter. Can RTK remove these two regions of greater attenuation? Also, would you happen to know if rtkprojections, when converting the raw projection float values to attenuation, is compatible with Varian raw projection data? I ask this because the studies I have read that perform this procedure use Elekta projection data. The output attenuation values for my measured projection data in air region is about ~2 mm-1 after conversion with rtkprojections. Whereas, I previously converted the HU of the registered CT volume to attenuation using the formula: mu = (HU + 1024)/2^16 which shows air to be ~0.019mm-1 once forward projected. Thank you kindly for your advice, Brani ________________________________ From: Andreas Andersen > Sent: Tuesday, 26 May 2020 4:51 PM To: Brani Rusanov > Cc: rtk-users at public.kitware.com > Subject: Re: [Rtk-users] Unable to Forward Project CT Volume With Correct Orientation What do you more precisely mean by "The output projections do not look like the raw projections I have from the CBCT" Are they flipped, are they all black, are they much brighter or darker, or do they not align? If alignment: Consider if you need to sort the projections by gantry angle before visual comparison, the Xim reader just reads sequentially by the given regex, so a ProBeam CB (with two imagers) may interleave projections from different angles. This is unlikely to be a problem for a gantry with only one imager. If flipped or all black: Your transformation matrix looks correct to me, so I think the problem may be elsewhere. It's always a mess to figure out. Be careful, that when you flip axes manually like that that you also remember to flip offsets (origin), spacing, etc. accordingly. In particular orientation (directions), I can see it says RAI for "AnatomicalOrientation", but I think you'll need the "Orientation" tag with direction cosines if you want to specify the directions manually. https://itk.org/Wiki/ITK/MetaIO/Documentation#MetaObject_Tags All this being said, I would suggest to instead use ITK's readers and the built-in filters for image transformation if that's even necessary, to avoid the hell of trying to keep track of all these values manually. If intensity is darker or brighter: Check if you have preprocessed the CB projections correctly for bow-tie filter and the like. I hope this gives a hint to where the problem might be. /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Tue, 26 May 2020 at 05:08, Brani Rusanov > wrote: Hi all, I am attempting to forward project a CT volume (previously registered to a CBCT volume) using the geometry of a CBCT volume to generate raw projections. I also have access to the raw CBCT projections. I have used rktprojections to stack the raw CBCT projections and generate .mhd/raw files. Next, I used rtkvariabprobeamgeometry on the scan.xml file that came with the raw CBCT projections to generate a RTK compatible geometry.xml file. Next, I have stacked the registered CT dicoms into a .mhd/raw format. The trouble I'm having is creating the projections using rtkforwardprojections. Specifically, I cannot find the correct transformmatrix in the CT header to tell rtkforwardprojetions the conversion from DICOM to IEC geometry. The output projections do not look like the raw projections I have from the CBCT. This may be a stupid question, but I cannot figure it out. From my own estimation, the transformation should be 1 0 0 0 0 -1 0 1 0 based on this diagram (https://www.semanticscholar.org/paper/nuclear-science-and-technology-Radiation-Quantities-Brink-McNitt-Gray/1ec27be3617dfc4e03bba86dcd92db8f3323de21/figure/3 [https://ai2-s2-public.s3.amazonaws.com/figures/2017-08-08/1ec27be3617dfc4e03bba86dcd92db8f3323de21/14-Figure1.4-1.png] Figure 1.4 from nuclear science and technology Radiation Quantities and Units , Dose to the Patients , and Image Quality in Computed Tomography ( CT ) ( RAD UNITS ) Author : | Semantic Scholar Figure 1.4 (left) The IEC patient coordinate system (the patient is lying in supine position); (right) transformation of coordinates between the IEC and DICOM coordinate systems [IEC, 2000] (cited in ICRU Report 71, 2004, page 35) - "nuclear science and technology Radiation Quantities and Units , Dose to the Patients , and Image Quality in Computed Tomography ( CT ) ( RAD UNITS ) Author :" www.semanticscholar.org ) My questions are: Is this the correct transformmatrix to apply? Do I need to also change the offset values in order to get the correct projections? Could this have something to do with the fact that I am using variant data? The .mhd for the registered CT is: ObjectType = Image NDims = 3 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 0 0 -1 0 1 0 Offset = -131.03451538085938 -131.03451538085938 -91.809638977050781 CenterOfRotation = 0 0 0 AnatomicalOrientation = RAI ElementSpacing = 0.51285523409720002 0.51285523409720002 1.9958648681640625 DimSize = 512 512 93 ElementType = MET_DOUBLE ElementDataFile = CIRS_6A.raw Similarly, the .mhd for the raw CBCT projections is: ObjectType = Image NDims = 3 BinaryData = True BinaryDataByteOrderMSB = False CompressedData = False TransformMatrix = 1 0 0 0 1 0 0 0 1 Offset = -198.46200000000002 -148.798 0 CenterOfRotation = 0 0 0 AnatomicalOrientation = RAI ElementSpacing = 0.38800000000000001 0.38800000000000001 1 DimSize = 1024 768 501 ElementType = MET_FLOAT ElementDataFile = CIRS_6A_SCGH_P.raw Thank you kindly for your response, Brani _______________________________________________ Rtk-users mailing list Rtk-users at public.kitware.com https://public.kitware.com/mailman/listinfo/rtk-users -------------- next part -------------- An HTML attachment was scrubbed... URL: From andreasga22 at gmail.com Wed May 27 03:10:34 2020 From: andreasga22 at gmail.com (Andreas Andersen) Date: Wed, 27 May 2020 09:10:34 +0200 Subject: [Rtk-users] Unable to Forward Project CT Volume With Correct Orientation In-Reply-To: References: Message-ID: Interesting, then maybe it is possible to standardise it. I would prefer to have the normalisation in RTK if possible. A value named KVNormChamber is read on this line: https://github.com/SimonRit/RTK/blob/master/src/rtkXimImageIO.cxx#L73 But if I'm reading the section from the Thesis you linked right, I guess we'd also need the I_0 value. I think this must come from a file in the Calibrations folder, so it'll have to be an optional feature and require a CLI flag pointing to the right file (depending on the bow-tie type used if any). I'm guessing the "KVNormChamber" value corresponds to NC_I, but is NC_I_0 then "KVNormChamber" in the calibration projection, or is it maybe the kV value from the scan.xml file ? P.S. Shameless promotion of my own project: I wouldn't recommend getting CbctRecon just to normalise projections. However, for the a priori scatter correction it will make your life easier: - Take a look at Testing/test_end_to_end.cpp for a somewhat short script doing the full correction (If you want to script it) https://gitlab.com/agravgaard/cbctrecon/-/blob/Develop/Testing/test_end_to_end.cpp#L176 - Configure and build the whole thing if you want a user interface (UI works best on Windows) for the scatter correction: https://gitlab.com/agravgaard/cbctrecon/-/tree/Develop/#cbctrecon - It's optimised a lot and takes about 70 seconds for a full scatter correction (also including file-reading) on my Linux machine. - Although expanded from the original implementation by Yang et al., it avoids the "Correction Factor" - TBI: Two ongoing projects to automise the process, a minimal UI project and a clinical integration project (reconstructing as projections are captured with a frame-grabber). P.P.S. There's quite a different between C and C++, in particular C++ 17 (or 20), below is a few of my favourite ressources for learning C++ (although I'm mostly self-taught by looking at other peoples code) - Jonathan Boccara's FluentC++ blog: https://www.fluentcpp.com/posts/ For writing readable (expressive) C++ and understanding what's in the standard library - Jason Turner's Weekly C++ series on youtube: https://www.youtube.com/playlist?list=PLs3KjaCtOwSZ2tbuV1hx8Xz-rFZTan2J1 - Bartek Filipek's blog: https://www.bfilipek.com/ For C++17, lambdas, and in general modern C++ - Craig Scott's book: https://crascit.com/professional-cmake/ The single best ressource for all your CMake needs. - Rainer Grimm's blog: http://www.modernescpp.com/index.php For understanding threading, atomics, parallelism and functional programming in C++ - Matt Godbolt's: https://godbolt.org/ Online compiler with all the compilers for quick and easy test of code snippets and compiler flags (you might also learn some assembly if you use it as often as I do) /Andreas __________________________________ Andreas Gravgaard Andersen Danish Center for Particle Therapy, Aarhus University Hospital Palle Juul-Jensens Blvd. 99, 8200, Aarhus Mail: agravgaard at protonmail.com Cell: +45 3165 8140 On Wed, 27 May 2020 at 06:00, Brani Rusanov wrote: > > Hi Andreas, > > Your input is invaluable, thanks for your suggestions! You are correct, I > am attempting to apply the a priori scatter correction. Is the > normalisation procedure you mentioned regarding the calibration-chamber > similar to what has been mentioned on page 63-64 of this thesis ( > https://pdfs.semanticscholar.org/d90c/d77b61d10d2c24df0686bc0be1f38424d67d.pdf), > specifically Norm Chamber (NC) values located in raw projection header? > > I will admit, I am a complete novice when it comes to C coding and using > RTK. For correctly normalising the Varian projections do you recommend > installing your "cbctrecon" package? If so, which function performs the > Varian normalisation? Or can the normalisation be done by scaling the > projection pixel values manually? My plan is to manually scale the CB > projections and perform a reconstruction until the HU looks right. A more > robust method is preferable, however. > > Your advice is greatly appreciated, > Brani > ------------------------------ > *From:* Andreas Andersen > *Sent:* Tuesday, 26 May 2020 7:15 PM > *To:* Brani Rusanov > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] Unable to Forward Project CT Volume With > Correct Orientation > > I'm happy to hear it worked! > > I don't know the complete Varian pipeline for correction, there should in > addition to subtracting the bow-tie be something like a > calibration-chamber-based correction, but I have not figured out how to do > this (let me know if you do) > RTK does not have filters to take care of this (yet). It would be possible > to do, but you'd have to know which image in the calibration folder is the > correct one. (There may be several and I think they are named by the local > Varian engineers - not standardised) > I do a simple subtraction in my own OpenCL implementation, but looping > through projections, extracting 2D from 3D, and using the ITK subtraction > image filter would probably be simpler. > (*If I should find documentation from Varian describing this process with > some standard, I'll write it into the reader for Xim images. However, I'm > afraid their own solution might specific to each gantry or engineering team* > ) > > It could sound like you want to do the "a priori scatter correction", I've > implemented this for Varian based projections (hnd and xim), see: > gitlab.com/agravgaard/cbctrecon > > (The Develop branch should be preferred at the moment) > The correction factor from the original Elekta implementation doesn't work > without a normalisation as mentioned above, so I'm doing some tricks to > ensure correctness of projection intensity for the subtraction, but I hope > to implement a solution/normalisation based on numbers from the machine > instead. > > /Andreas > > __________________________________ > > Andreas Gravgaard Andersen > > Danish Center for Particle Therapy, > > Aarhus University Hospital > > Palle Juul-Jensens Blvd. 99, > > 8200, Aarhus > > Mail: agravgaard at protonmail.com > > Cell: +45 3165 8140 > > > On Tue, 26 May 2020 at 12:37, Brani Rusanov > wrote: > > Hi Andreas, > > You are correct, I had failed to flip the y and z coordinates of the > offset parameter in the header. I had thought that the transformmatrix > would take care of this. Now the simulated projection looks as desired. > Thank you! > > You mentioned the possibility of applying pre-processing on the CB > projections for a bow-tie filter. Do you know what kind of pre-processing > is available within RTK for bow-tie filters? I ask because I plan on > subtracting the measured CBCT projections from the simulated CT-registered > projections. However, the measured CBCT projections have the characteristic > attenuation pattern on the left and right side of the image corresponding > to a bow-tie filter. Can RTK remove these two regions of greater > attenuation? > > Also, would you happen to know if rtkprojections, when converting the raw > projection float values to attenuation, is compatible with Varian raw > projection data? I ask this because the studies I have read that perform > this procedure use Elekta projection data. The output attenuation values > for my measured projection data in air region is about ~2 mm-1 after > conversion with rtkprojections. Whereas, I previously converted the HU of > the registered CT volume to attenuation using the formula: mu = (HU + > 1024)/2^16 which shows air to be ~0.019mm-1 once forward projected. > > Thank you kindly for your advice, > Brani > ------------------------------ > *From:* Andreas Andersen > *Sent:* Tuesday, 26 May 2020 4:51 PM > *To:* Brani Rusanov > *Cc:* rtk-users at public.kitware.com > *Subject:* Re: [Rtk-users] Unable to Forward Project CT Volume With > Correct Orientation > > What do you more precisely mean by "The output projections do not look > like the raw projections I have from the CBCT" > Are they flipped, are they all black, are they much brighter or darker, or > do they not align? > > If alignment: Consider if you need to sort the projections by gantry angle > before visual comparison, the Xim reader just reads sequentially by the > given regex, so a ProBeam CB (with two imagers) may interleave projections > from different angles. This is unlikely to be a problem for a gantry with > only one imager. > > If flipped or all black: Your transformation matrix looks correct to me, > so I think the problem may be elsewhere. > It's always a mess to figure out. Be careful, that when you flip axes > manually like that that you also remember to flip offsets (origin), > spacing, etc. accordingly. > In particular orientation (directions), I can see it says RAI for > "AnatomicalOrientation", but I think you'll need the "Orientation" tag with > direction cosines if you want to specify the directions manually. > https://itk.org/Wiki/ITK/MetaIO/Documentation#MetaObject_Tags > > > All this being said, I would suggest to instead use ITK's readers and the > built-in filters for image transformation if that's even necessary, to > avoid the hell of trying to keep track of all these values manually. > > If intensity is darker or brighter: Check if you have preprocessed the CB > projections correctly for bow-tie filter and the like. > > I hope this gives a hint to where the problem might be. > > /Andreas > > __________________________________ > > Andreas Gravgaard Andersen > > Danish Center for Particle Therapy, > > Aarhus University Hospital > > Palle Juul-Jensens Blvd. 99, > > 8200, Aarhus > > Mail: agravgaard at protonmail.com > > Cell: +45 3165 8140 > > > On Tue, 26 May 2020 at 05:08, Brani Rusanov > wrote: > > Hi all, > > I am attempting to forward project a CT volume (previously registered to a > CBCT volume) using the geometry of a CBCT volume to generate raw > projections. I also have access to the raw CBCT projections. I have used > rktprojections to stack the raw CBCT projections and generate .mhd/raw > files. > > Next, I used rtkvariabprobeamgeometry on the scan.xml file that came with > the raw CBCT projections to generate a RTK compatible geometry.xml file. > > Next, I have stacked the registered CT dicoms into a .mhd/raw format. The > trouble I'm having is creating the projections using rtkforwardprojections. > Specifically, I cannot find the correct transformmatrix in the CT header to > tell rtkforwardprojetions the conversion from DICOM to IEC geometry. The > output projections do not look like the raw projections I have from the > CBCT. This may be a stupid question, but I cannot figure it out. From my > own estimation, the transformation should be 1 0 0 0 0 -1 0 1 0 based on > this diagram ( > https://www.semanticscholar.org/paper/nuclear-science-and-technology-Radiation-Quantities-Brink-McNitt-Gray/1ec27be3617dfc4e03bba86dcd92db8f3323de21/figure/3 > > > > Figure 1.4 from nuclear science and technology Radiation Quantities and > Units , Dose to the Patients , and Image Quality in Computed Tomography ( > CT ) ( RAD UNITS ) Author : | Semantic Scholar > > Figure 1.4 (left) The IEC patient coordinate system (the patient is lying > in supine position); (right) transformation of coordinates between the IEC > and DICOM coordinate systems [IEC, 2000] (cited in ICRU Report 71, 2004, > page 35) - "nuclear science and technology Radiation Quantities and Units , > Dose to the Patients , and Image Quality in Computed Tomography ( CT ) ( > RAD UNITS ) Author :" > www.semanticscholar.org > > ) > > My questions are: Is this the correct transformmatrix to apply? > Do I need to also change the offset values in order to get the correct > projections? > Could this have something to do with the fact that I am using variant data? > > The .mhd for the registered CT is: > ObjectType = Image > NDims = 3 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 0 0 -1 0 1 0 > Offset = -131.03451538085938 -131.03451538085938 -91.809638977050781 > CenterOfRotation = 0 0 0 > AnatomicalOrientation = RAI > ElementSpacing = 0.51285523409720002 0.51285523409720002 1.9958648681640625 > DimSize = 512 512 93 > ElementType = MET_DOUBLE > ElementDataFile = CIRS_6A.raw > > Similarly, the .mhd for the raw CBCT projections is: > ObjectType = Image > NDims = 3 > BinaryData = True > BinaryDataByteOrderMSB = False > CompressedData = False > TransformMatrix = 1 0 0 0 1 0 0 0 1 > Offset = -198.46200000000002 -148.798 0 > CenterOfRotation = 0 0 0 > AnatomicalOrientation = RAI > ElementSpacing = 0.38800000000000001 0.38800000000000001 1 > DimSize = 1024 768 501 > ElementType = MET_FLOAT > ElementDataFile = CIRS_6A_SCGH_P.raw > > Thank you kindly for your response, > Brani > > _______________________________________________ > Rtk-users mailing list > Rtk-users at public.kitware.com > https://public.kitware.com/mailman/listinfo/rtk-users > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From yoonho94.na at gmail.com Sun May 31 23:41:16 2020 From: yoonho94.na at gmail.com (=?UTF-8?B?64KY7Jyk7Zi4?=) Date: Mon, 1 Jun 2020 12:41:16 +0900 Subject: [Rtk-users] (no subject) Message-ID: Hi, rtk-users. I'm trying to reconstruct an image from one of my sinogram using fdk. but some kind of error occurs.(I don't know what this means.) How can I put my sinogram input to fdk? Here is the error message that I got. [image: image.png] (sinogram.mha is my input.) -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image.png Type: image/png Size: 132548 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: image01.png Type: image/png Size: 115761 bytes Desc: not available URL: