Simulation

petl_server.PETLserver.add_object(self, typeOfObject, c, r, val, A=None, clip=None)

Adds a geometric object to the phantom

This function operates in two modes: (1) specifying a voxelized phantom and (2) specifying a phantom to be used in an analytic ray-tracing simulation (see rayTrace). The object will be added to a stack of objects that define a phantom to be used for an analytic ray-tracing simulation.

The order in which multiple object are defined is important. Background objects must be specified first and foreground objects defined last. If you reverse the order, then the foreground objects will be effectively overriden by the background objects.

Parameters:
  • type (int) – ELLIPSOID=0, PARALLELEPIPED=1, CYLINDER_X=2, CYLINDER_Y=3, CYLINDER_Z=4, CONE_X=5, CONE_Y=6, CONE_Z=7

  • c (3X1 numpy array) – x,y,z coordinates of the center of the object

  • r (3X1 numpy array) – radii in the x,y,z directions of the object

  • val (float) – the values to ascribe inside this object

  • A (3x3 numpy array) – rotation matrix to rotate the object about its center

  • clip (3X1 numpy array) – specifies the clipping planes, if any

petl_server.PETLserver.clear_phantom(self)

Clears all phantom objects

petl_server.PETLserver.scale_phantom(self, c)

Scales the size of the phantom by the provided factor

One must have a phantom already defined before running this function.

Parameters:

c (float or list of three float) – the scaling values (values greater than one make the phantom larger)

petl_server.PETLserver.voxelize(self, f=None, oversampling=1)

Voxelizes a phantom defined by geometric objects.

One must have a phantom already defined before running this function.

Parameters:
  • f (C contiguous float32 numpy array) – volume data

  • oversampling (int) – the oversampling factor of the voxelization

petl_server.PETLserver.ray_trace(self, g=None, oversampling=1)

Performs analytic ray-tracing simulation through a phantom composed of geometrical objects

See the addObject function for how to build the phantom description The CT geometry parameters must be specified prior to running this functions

Parameters:
  • g (C contiguous float32 numpy array) – CT projection data

  • oversampling (int) – the oversampling factor for each ray

Returns:

g