RTK/Scripts/FDK: Difference between revisions

From Openrtk
Jump to navigation Jump to search
No edit summary
(Pictures for the 2D case)
 
(10 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<div class="floatcenter">[[File:sinogram.png]][[File:overlay.png]]</div>
== 3D ==


This script uses the file [[File:SheppLogan.txt|SheppLogan.txt]] as input.
<div class="floatcenter">[[File:sinogram.png|200px]] [[File:overlay.png|200px]]</div>


<source lang="bash">
This script uses the file [https://data.kitware.com/api/v1/item/5b179c938d777f15ebe2020b/download SheppLogan.txt] as input.
 
<source lang="bash" enclose="div">
  # Create a simulated geometry
  # Create a simulated geometry
  rtksimulatedgeometry.exe -n 180 -o geometry.xml
  rtksimulatedgeometry -n 180 -o geometry.xml
# You may add "--arc 200" to make the scan short or "--proj_iso_x 200" to offset the detector


  # Create projections of the phantom file
  # Create projections of the phantom file
Line 15: Line 18:
  # Create a reference volume for comparison
  # Create a reference volume for comparison
  rtkdrawgeometricphantom --spacing 2 --dimension 256 --phantomfile SheppLogan.txt -o ref.mha
  rtkdrawgeometricphantom --spacing 2 --dimension 256 --phantomfile SheppLogan.txt -o ref.mha
</source>
== 2D ==
<div class="floatcenter">[[File:SheppLogan-2d-sinogram.png|200px]] [[File:SheppLogan-2d.png|200px]]</div>
The same reconstruction can be performed using the original 2D Shepp-Logan phantom. RTK can perform 2D reconstructions through images wide of 1 pixel in the y direction.
The following script performs the same reconstruction as above in a 2D environment and uses [[:File:SheppLogan-2d.txt|the 2D Shepp-Logan phantom]] as input.
<source lang="bash" enclose="div">
# Create a simulated geometry
rtksimulatedgeometry -n 180 -o geometry.xml
# Create projections of the phantom file
# Note the sinogram being 3 pixels wide in the y direction to allow back-projection interpolation in a 2D image
rtkprojectgeometricphantom -g geometry.xml -o projections.mha --spacing 2 --dimension=512,3,512 --phantomfile SheppLogan-2d.txt --phantomscale=256,1,256
# Reconstruct
rtkfdk -p . -r projections.mha -o fdk.mha -g geometry.xml --spacing 2 --dimension 256,1,256
# Create a reference volume for comparison
rtkdrawgeometricphantom --spacing 2 --dimension=256,1,256 --phantomfile SheppLogan-2d.txt -o ref.mha --phantomscale=256,1,256
</source>
</source>

Latest revision as of 07:55, 20 May 2019

3D

Error creating thumbnail: File missing
Error creating thumbnail: File missing

This script uses the file SheppLogan.txt as input.

 # Create a simulated geometry
 rtksimulatedgeometry -n 180 -o geometry.xml
 # You may add "--arc 200" to make the scan short or "--proj_iso_x 200" to offset the detector

 # Create projections of the phantom file
 rtkprojectgeometricphantom -g geometry.xml -o projections.mha --spacing 2 --dimension 256 --phantomfile SheppLogan.txt

 # Reconstruct
 rtkfdk -p . -r projections.mha -o fdk.mha -g geometry.xml --spacing 2 --dimension 256

 # Create a reference volume for comparison
 rtkdrawgeometricphantom --spacing 2 --dimension 256 --phantomfile SheppLogan.txt -o ref.mha

2D

Error creating thumbnail: File missing
Error creating thumbnail: File missing

The same reconstruction can be performed using the original 2D Shepp-Logan phantom. RTK can perform 2D reconstructions through images wide of 1 pixel in the y direction. The following script performs the same reconstruction as above in a 2D environment and uses the 2D Shepp-Logan phantom as input.

# Create a simulated geometry
rtksimulatedgeometry -n 180 -o geometry.xml

# Create projections of the phantom file
# Note the sinogram being 3 pixels wide in the y direction to allow back-projection interpolation in a 2D image
rtkprojectgeometricphantom -g geometry.xml -o projections.mha --spacing 2 --dimension=512,3,512 --phantomfile SheppLogan-2d.txt --phantomscale=256,1,256

# Reconstruct
rtkfdk -p . -r projections.mha -o fdk.mha -g geometry.xml --spacing 2 --dimension 256,1,256

# Create a reference volume for comparison
rtkdrawgeometricphantom --spacing 2 --dimension=256,1,256 --phantomfile SheppLogan-2d.txt -o ref.mha --phantomscale=256,1,256