@@ -26,7 +26,11 @@ This page was generated from a single Julia file:
2626
2727# Packages needed here.
2828
29- using Sinograms: SinoPar, SinoMoj, SinoFanArc, SinoFanFlat, rays
29+ using Unitful: mm, °
30+ using UnitfulRecipes
31+ using Plots # must precede 'using Sinograms' for sino_plot_rays to work
32+ using Sinograms: SinoPar, SinoMoj, SinoFanArc, SinoFanFlat, SinoFan
33+ using Sinograms: sino_plot_rays
3034using MIRTjim: jim, prompt
3135using InteractiveUtils: versioninfo
3236
@@ -72,25 +76,117 @@ In this package,
7276is the type that describes
7377a parallel-beam sinogram geometry.
7478
75- The built-in defaults are helpful.
79+ The built-in defaults provide helpful reminders about the usage .
7680=#
7781
7882SinoPar ()
7983
84+ #=
85+ This package supports units via the
86+ [Unitful.jl](https://github.com/PainterQubits/Unitful.jl)
87+ and using units is recommended
88+ (but not required).
89+
90+ Here is an example of how to specify
91+ a parallel-beam geometry.
92+ Everything is a named keyword argument with sensible default values.
93+
94+ * `orbit` and `orbit_start` must both be unitless (degrees)
95+ or have the same units (e.g., degrees or radians).
96+ * detector spacing `d` and `strip_width`
97+ must both be unitless or have the same units (e.g., mm).
98+ * The projection angles ``ϕ`` are equally space and given by
99+ `orbit_start + (0:(nb-1))/nb * orbit`.
100+ =#
101+
102+ sg = SinoPar ( ;
103+ nb = 64 , # number of radial samples ("bins")
104+ na = 30 , # number of angular samples
105+ d = 2 mm, # detector spacing
106+ offset = 0.25 , # quarter detector offset (unitless)
107+ orbit = 180 , # angular range (in degrees)
108+ orbit_start = 0 , # starting angle (in degrees)
109+ strip_width = 2 mm, # detector width
110+ )
111+
112+ #=
113+ The struct `sg` has numerous useful properties;
114+ type `?SinoGeom` to see the full list.
115+
116+ For example,
117+ to access the angular samples in degrees
118+ type `sg.ad`
119+ =#
80120
81- # # todo: more details
121+ sg . ad
82122
83123
124+ # The following function visualizes the sampling pattern.
125+
126+ sino_plot_rays (sg; ylims= (0 ,180 ), yticks= (0 : 90 : 180 ), widen= true , title= " Parallel" )
127+
128+ #
129+ prompt ()
130+
131+
132+ #=
84133## Fan-beam CT with an arc detector (3rd generation CT)
85134
86- SinoFanArc ()
135+ For a fan-beam geometry,
136+ the arguments are the same as for `SinoPar`
137+ with the addition of specifying:
138+ * `dsd` distance from source to detector
139+ * `dod` distance from origin (isocenter) to detector
140+ * `dfs` distance from focal point of detector to source
141+ (0 for a 3rd gen arc detector, and `Inf` for a flat detector)
142+ * `source_offset` for misaligned systems
143+ where the ray from the source to the detector center
144+ does not intersect the isocenter.
145+ Not fully supported; submit an issue if you need this feature.
146+
147+ Here is an example that corresponds to a GE Lightspeed CT system.
148+ These numbers are published in
149+ [IEEE T-MI Oct. 2006, p.1272-1283](http://doi.org/10.1109/TMI.2006.882141).
150+ =#
151+
152+ sg = SinoFanArc ( ; nb= 888 , na= 984 ,
153+ d= 1.0239 mm, offset= 1.25 , dsd= 949.075 mm, dod= 408.075 mm)
154+
155+
156+ # Here is a smaller example for plotting the rays.
157+
158+ sg = SinoFanArc ( ; nb= 64 , na= 30 ,
159+ d= 20 mm, offset= 0.25 , dsd= 900 mm, dod= 400 mm)
160+ sino_plot_rays (sg; ylims= (- 50 ,400 ), yticks= (0 : 180 : 360 ), widen= true ,
161+ title= " Fan-beam for arc detector" )
87162
163+ #
164+ prompt ()
88165
166+
167+ #=
89168## Fan-beam CT with a flat detector
90169
91- SinoFanFlat ()
170+ This geometry is the same as the arc detector
171+ except that `dfs=Inf`.
172+ =#
92173
174+ sg = SinoFanFlat ( ; nb= 64 , na= 30 ,
175+ d= 20 mm, offset= 0.25 , dsd= 900 mm, dod= 400 mm)
93176
177+
178+ # Here is its sampling plot
179+ sino_plot_rays (sg; ylims= (- 50 ,400 ), yticks= (0 : 180 : 360 ), widen= true ,
180+ title= " Fan-beam for flat detector" )
181+
182+ #
183+ prompt ()
184+
185+
186+ #=
94187## Mojette sampling
188+ This is a specialized sampling geometry
189+ that is currently incompletely supported.
190+ =#
95191
96192SinoMoj ()
0 commit comments