<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size: 12pt; color: rgb(0, 0, 0); font-family: Calibri, Helvetica, sans-serif, EmojiFont, "Apple Color Emoji", "Segoe UI Emoji", NotoColorEmoji, "Segoe UI Symbol", "Android Emoji", EmojiSymbols;">
<p>Dear rtk-users,</p>
<p><br>
</p>
<p>First of all a huge thanks to the developers of RTK, what a very powerful tool. Here I am am with a couple of points:</p>
<p><br>
</p>
<p>1) Boellaard scatter: after having performed multiple rtkfkd recons with different "spr" settings (from the complied C++ version), I could not find any differences between the reconstructed images. It seems like the scatter-to-primary ratio does not impact
the recon. Is this to be expected/does anyone experience the same?</p>
<p><br>
</p>
<p>2) F<span style="font-size:12pt">inally I had some time to dig in the python wrapped side of RTK and run some very basic recons on Elekta raw (XVI release > 5) data - based on the FirstRecon example - for benchmarking purposes. However, I do not get to the
desired result. I am pretty sure that is something quite superficial on my side, but any help is very welcome.</span></p>
<p><span style="font-size:12pt">So the reconstruction starts from the following projections:</span></p>
<p><span style="font-size:12pt"><img naturalheight="480" naturalwidth="640" size="54921" id="img413685" tabindex="0" style="max-width: 99.9%; user-select: none;" contextid="img962260" src="cid:02b525b5-508f-4bb9-84e9-74d93726410c"><br>
I get with the compiled version of C++</span></p>
<p><span style="font-size:12pt"><img size="86799" contenttype="image/png" id="img339014" style="max-width: 99.9%; user-select: none;" contextid="img998307" tabindex="0" src="cid:a08661fb-7c01-4e2d-be4b-3a6199642f58"><br>
while when trying my own recon, I get</span></p>
<p><span style="font-size:12pt"><img size="63784" contenttype="image/png" id="img319115" style="max-width: 99.9%; user-select: none;" contextid="img153729" tabindex="0" src="cid:52a9a5b8-9ac8-4ad1-a591-228db1d6cedd"><br>
<br>
</span></p>
<p></p>
<p><span style="font-size:12pt">To me, it seems that the geometry/axis orientation is somewhat incorrect. Trying to facilitate coming up with some suggestions, I put at the end of the mail an excerpt of the code, maybe you spot the issue right away. If you
may appreciate a dataset to reproduce the problem, just let me know. Again, any suggestion is welcome, especially if a quick look from someone else may speed up things on this side.</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">Thank you very much in advance.</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">Best Regards and have a great weekend,</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">Matteo</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<div id="Signature">
<div id="divtagdefaultwrapper" dir="ltr" style="font-size:12pt; color:rgb(0,0,0); font-family:Calibri,Helvetica,sans-serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div style="font-family:Tahoma; font-size:13px">
<div class="BodyFragment"><font size="2"><span style="font-size:10pt">
<div class="PlainText"> Matteo Maspero</div>
<div class="PlainText">| Clinical scientist/Postdoc<br>
| Radiotherapy, Imaging and Cancer</div>
<div class="PlainText"><span style="font-size:10pt">| Computational Imaging Group <a href="http://www.compimag.org" class="OWAAutoLink" id="LPNoLP">www.compimag.org</a></span></div>
<div class="PlainText">| Center for Image Sciences<br>
| University Medical Center Utrecht</div>
<div class="PlainText"><span style="font-family:Tahoma; font-size:13.3333px">| Free on Wednesdays</span><br>
| Room Q.02.2.315<br>
| P.O. 85500<br>
| Heidelberglaan 100, 3508 GA Utrecht, Netherlands<br>
| E: m.maspero@umcutrecht.nl<br>
| Tel +31-8875 67492 / <span style="font-family:Tahoma; font-size:13.3333px">+31-614956534</span><br>
| Fax +31-8875 55850<br>
</div>
<div class="PlainText"><br>
</div>
<div class="PlainText">--------------------- code excerpt ----</div>
<div class="PlainText">
<pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:9.8pt;"><span style="color:#cc7832;"></span><pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:9.8pt;"><span style="color:#cc7832;">import </span>sys<br><span style="color:#cc7832;">import </span>os<br><span style="color:#cc7832;">import </span>matplotlib.pyplot <span style="color:#cc7832;">as </span>plt<br><span style="color:#cc7832;">import </span>glob<br><span style="color:#cc7832;">import </span>itk<br><span style="color:#cc7832;">from </span>itk <span style="color:#cc7832;">import </span>RTK <span style="color:#cc7832;">as </span>rtk <br><span style="color:#808080;"># image definition<br></span>CPUImageType = rtk.Image[itk.F<span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span>]<br><br><span style="color:#808080;"># TMP, pt_dir are the folders with the data <br></span><span style="color:#808080;"># Flags<br></span>Flag_saveProj = <span style="color:#6a8759;">"on"<br></span><span style="color:#6a8759;"><br></span><span style="color:#808080;"># geometry -> read xml<br></span>geometryReader = rtk.ThreeDCircularProjectionGeometryXMLFileReader.New()<br>geometryReader.SetFilename(TMP + <span style="color:#6a8759;">"elektaGeometry"</span>)<br>geometryReader.GenerateOutputInformation()<br>geometry = geometryReader.GetGeometry()<br><br><span style="color:#808080;"># List of filenames<br></span>fileNames = <span style="color:#8888c6;">list</span>()<br><span style="color:#808080;"># Get list of all files in a given directory sorted by name<br></span>fileNames = <span style="color:#8888c6;">sorted</span>( <span style="color:#8888c6;">filter</span>( os.path.isfile<span style="color:#cc7832;">,<br></span><span style="color:#cc7832;"> </span>glob.glob(pt_dir + <span style="color:#6a8759;">'*his'</span>)))<br><br>projReader = rtk.ProjectionsReader[CPUImageType].New()<br>projReader.SetFileNames(fileNames)<br>projections = projReader.GetOutput()<br><span style="color:#808080;"># plot the projections<br></span>plt.subplot(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">1</span>); plt.imshow(projections[<span style="color:#6897bb;">55</span><span style="color:#cc7832;">, </span>:<span style="color:#cc7832;">, </span>:]<span style="color:#cc7832;">, </span><span style="color:#aa4926;">cmap</span>=<span style="color:#6a8759;">'gray'</span>); plt.title(<span style="color:#6a8759;">'Proj X'</span>)<br>plt.subplot(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">2</span>); plt.imshow(projections[:<span style="color:#cc7832;">, </span><span style="color:#6897bb;">55</span><span style="color:#cc7832;">, </span>:]<span style="color:#cc7832;">, </span><span style="color:#aa4926;">cmap</span>=<span style="color:#6a8759;">'gray'</span>); plt.title(<span style="color:#6a8759;">'Proj Y'</span>)<br>plt.subplot(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span>); plt.imshow(projections[:<span style="color:#cc7832;">, </span>:<span style="color:#cc7832;">, </span><span style="color:#6897bb;">50</span>]<span style="color:#cc7832;">, </span><span style="color:#aa4926;">cmap</span>=<span style="color:#6a8759;">'gray'</span>); plt.title(<span style="color:#6a8759;">'Proj Z'</span>)<br>plt.show()<br><br><span style="color:#808080;"># Writer<br></span><span style="color:#cc7832;">if </span>Flag_saveProj == <span style="color:#6a8759;">"on"</span>:<br> <span style="color:#8888c6;">print</span>(<span style="color:#6a8759;">'Writing projections image...'</span>)<br> itk.imwrite(projections<span style="color:#cc7832;">, </span>TMP + <span style="color:#6a8759;">'projections.mha'</span>)<br> itk.imwrite(projections<span style="color:#cc7832;">, </span>TMP + <span style="color:#6a8759;">'projections.gipl'</span>)<br><br><span style="color:#808080;"># Reconstruction parameter<br></span>spacingVol = [<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">1</span>] <span style="color:#808080;"># resolution of the recon<br></span>sizeOutputVol = [<span style="color:#6897bb;">256</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">256</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">256</span>] <span style="color:#808080;"># FOV = S -> [270, 270, 264]<br></span>originVol = [-(sizeOutputVol[<span style="color:#6897bb;">0</span>] / <span style="color:#6897bb;">2 </span>+ <span style="color:#6897bb;">0.5</span>) * spacingVol[<span style="color:#6897bb;">0</span>]<span style="color:#cc7832;">, </span><span style="color:#6897bb;">0.</span><span style="color:#cc7832;">, </span>-(sizeOutputVol[<span style="color:#6897bb;">2</span>] / <span style="color:#6897bb;">2 </span>+ <span style="color:#6897bb;">0.5</span>) * spacingVol[<span style="color:#6897bb;">2</span>]]<br><br><span style="color:#808080;"># Create (an empty) reconstructed image<br></span>constantImageSource = rtk.ConstantImageSource[CPUImageType].New()<br>constantImageSource.SetOrigin(originVol)<br>constantImageSource.SetSpacing(spacingVol)<br>constantImageSource.SetSize(sizeOutputVol)<br>constantImageSource.SetConstant(<span style="color:#6897bb;">0.</span>)<br>source = constantImageSource.GetOutput()<br><br><span style="color:#808080;"># FDK reconstruction<br></span><span style="color:#8888c6;">print</span>(<span style="color:#6a8759;">'Reconstructing...'</span>)<br>FDKCPUType = rtk.FDKConeBeamReconstructionFilter[CPUImageType]<br>feldkamp = FDKCPUType.New()<br>feldkamp.SetInput(<span style="color:#6897bb;">0</span><span style="color:#cc7832;">, </span>source)<br>feldkamp.SetInput(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span>projections)<br>feldkamp.SetGeometry(geometry)<br>feldkamp.GetRampFilter().SetTruncationCorrection(<span style="color:#6897bb;">0.0</span>)<br>feldkamp.GetRampFilter().SetHannCutFrequency(<span style="color:#6897bb;">0.0</span>)<br>imageFDK = feldkamp.GetOutput()<br><br><span style="color:#808080;"># plot the reconstructed image<br></span>im = imageFDK<br>plt.subplot(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">1</span>); plt.imshow(im[<span style="color:#6897bb;">55</span><span style="color:#cc7832;">, </span>:<span style="color:#cc7832;">, </span>:]<span style="color:#cc7832;">, </span><span style="color:#aa4926;">cmap</span>=<span style="color:#6a8759;">'gray'</span>); plt.title(<span style="color:#6a8759;">'X'</span>)<br>plt.subplot(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">2</span>); plt.imshow(im[:<span style="color:#cc7832;">, </span><span style="color:#6897bb;">55</span><span style="color:#cc7832;">, </span>:]<span style="color:#cc7832;">, </span><span style="color:#aa4926;">cmap</span>=<span style="color:#6a8759;">'gray'</span>); plt.title(<span style="color:#6a8759;">'Y'</span>)<br>plt.subplot(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span>); plt.imshow(im[:<span style="color:#cc7832;">, </span>:<span style="color:#cc7832;">, </span><span style="color:#6897bb;">50</span>]<span style="color:#cc7832;">, </span><span style="color:#aa4926;">cmap</span>=<span style="color:#6a8759;">'gray'</span>); plt.title(<span style="color:#6a8759;">'Z'</span>); plt.show()</pre><pre style="background-color:#2b2b2b;color:#a9b7c6;font-family:'JetBrains Mono',monospace;font-size:9.8pt;"><br><span style="color:#808080;"># Reconstruction parameter<br></span>spacingVol = [<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">1</span>] <span style="color:#808080;"># resolution of the recon<br></span>sizeOutputVol = [<span style="color:#6897bb;">256</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">256</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">256</span>] <span style="color:#808080;"># FOV = S -> [270, 270, 264]<br></span>originVol = [-(sizeOutputVol[<span style="color:#6897bb;">0</span>] / <span style="color:#6897bb;">2 </span>+ <span style="color:#6897bb;">0.5</span>) * spacingVol[<span style="color:#6897bb;">0</span>]<span style="color:#cc7832;">, </span><span style="color:#6897bb;">0.</span><span style="color:#cc7832;">, </span>-(sizeOutputVol[<span style="color:#6897bb;">2</span>] / <span style="color:#6897bb;">2 </span>+ <span style="color:#6897bb;">0.5</span>) * spacingVol[<span style="color:#6897bb;">2</span>]]<br><br><span style="color:#808080;"># Create (an empty) reconstructed image<br></span>constantImageSource = rtk.ConstantImageSource[CPUImageType].New()<br>constantImageSource.SetOrigin(originVol)<br>constantImageSource.SetSpacing(spacingVol)<br>constantImageSource.SetSize(sizeOutputVol)<br>constantImageSource.SetConstant(<span style="color:#6897bb;">0.</span>)<br>source = constantImageSource.GetOutput()<br><br><span style="color:#808080;"># FDK reconstruction<br></span><span style="color:#8888c6;">print</span>(<span style="color:#6a8759;">'Reconstructing...'</span>)<br>FDKCPUType = rtk.FDKConeBeamReconstructionFilter[CPUImageType]<br>feldkamp = FDKCPUType.New()<br>feldkamp.SetInput(<span style="color:#6897bb;">0</span><span style="color:#cc7832;">, </span>source)<br>feldkamp.SetInput(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span>projections)<br>feldkamp.SetGeometry(geometry)<br>feldkamp.GetRampFilter().SetTruncationCorrection(<span style="color:#6897bb;">0.0</span>)<br>feldkamp.GetRampFilter().SetHannCutFrequency(<span style="color:#6897bb;">0.0</span>)<br>imageFDK = feldkamp.GetOutput()<br><br># plot the reconstructed image<br>im = imageFDK<br>plt.subplot(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">1</span>); plt.imshow(im[<span style="color:#6897bb;">55</span><span style="color:#cc7832;">, </span>:<span style="color:#cc7832;">, </span>:]<span style="color:#cc7832;">, </span><span style="color:#aa4926;">cmap</span>=<span style="color:#6a8759;">'gray'</span>); plt.title(<span style="color:#6a8759;">'X'</span>)<br>plt.subplot(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">2</span>); plt.imshow(im[:<span style="color:#cc7832;">, </span><span style="color:#6897bb;">55</span><span style="color:#cc7832;">, </span>:]<span style="color:#cc7832;">, </span><span style="color:#aa4926;">cmap</span>=<span style="color:#6a8759;">'gray'</span>); plt.title(<span style="color:#6a8759;">'Y'</span>)<br>plt.subplot(<span style="color:#6897bb;">1</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span><span style="color:#cc7832;">, </span><span style="color:#6897bb;">3</span>); plt.imshow(im[:<span style="color:#cc7832;">, </span>:<span style="color:#cc7832;">, </span><span style="color:#6897bb;">50</span>]<span style="color:#cc7832;">, </span><span style="color:#aa4926;">cmap</span>=<span style="color:#6a8759;">'gray'</span>); plt.title(<span style="color:#6a8759;">'Z'</span>); plt.show()</pre></pre>
<br>
</div>
</span></font></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- --><hr>
<p><font size="-2" face="arial" color="black"><i>
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct
te informeren door het bericht te retourneren. Het Universitair Medisch
Centrum Utrecht is een publiekrechtelijke rechtspersoon in de zin van de W.H.W.
(Wet Hoger Onderwijs en Wetenschappelijk Onderzoek) en staat geregistreerd bij
de Kamer van Koophandel voor Midden-Nederland onder nr. 30244197.
</i></font></p>
<p><font size="-2" face="arial" color="green"><i>
Denk s.v.p aan het milieu voor u deze e-mail afdrukt.
</i></font></p>
<hr>
<p><font size="-2" face="arial" color="black"><i>
This message may contain confidential information and is intended
exclusively for the addressee. If you receive this message
unintentionally, please do not use the contents but notify the sender
immediately by return e-mail. University Medical Center Utrecht is a legal
person by public law and is registered at the Chamber of Commerce for
Midden-Nederland under no. 30244197.
</i></font></p>
<p><font size="-2" face="arial" color="green"><i>
Please consider the environment before printing this e-mail.
</i></font></p>
</body>
</html>