xdesign.phantom
¶
Functions:
Phantom ([shape]) |
Phantom generation class. |
-
class
xdesign.phantom.
Phantom
(shape=u'circle')[source]¶ Bases:
object
Phantom generation class.
-
shape
¶ string
Shape of the phantom. Available options: circle, square.
-
population
¶ scalar
Number of generated features in the phantom.
-
area
¶ scalar
Area of the features in the phantom.
-
feature
¶ list
List of features.
-
density
¶ Returns the area density of the phantom. (Does not acount for mass_atten.)
-
list
¶
-
rotate
(theta, origin=<xdesign.geometry.Point object>, axis=None)[source]¶ Rotate phantom around a point.
-
sprinkle
(counts, radius, gap=0, region=None, mass_atten=1, max_density=1)[source]¶ Sprinkle a number of circles. Uses various termination criteria to determine when to stop trying to add circles.
Parameters: - counts (int) – The number of circles to be added.
- radius (scalar or list) – The radius of the circles to be added.
- gap (float, optional) – The minimum distance between circle boundaries. A negative value allows overlapping edges.
- region (Entity, optional) – The new circles are confined to this shape. None if the circles are allowed anywhere.
- max_density (scalar, optional) – Stops adding circles when the geometric density of the phantom reaches this ratio.
- mass_atten (scalar, optional) – A mass attenuation parameter passed to the circles.
Returns: counts (scalar) – The number of circles successfully added.
-