Deprecated ‐ NEW ‐ Physics Models (under construction) - xcist/documentation GitHub Wiki

Materials

[18JUL23 text]
Materials are fundamental to several aspects of X-ray/CT imaging systems, including source and detector filtration, the detector's X-ray conversion materials, and the patient (phantom).

In XCIST, materials are specified in a simple text format. We have provided the CatSim material calculator to produce material files in a consistent and accurate manner. Using this tool, you can quickly specify new materials based on chemical formulas or mass fractions. Detailed instructions are provided within the tool. If you need a new material, please download & use the tool, and, if not a proprietary material, please contribute your new material specification back to XCIST!

At the time of this writing (July 2023), the material folder contained 92 elements, 29 compounds and mixtures, and 40 biological tissues.

[Original text]
The ASCII text-files for the material composition and constants are located in a directory catsim/materials/ and have no extension (files with extension .mac and .rho are obsolete material definition files, and have been moved to the obsolete/materials directory). The first line specifies the number of elemental components. The second line contains the mass density (g/cm3), and the next lines contain the atomic number and the mass fraction of the respective components. The mass density is absolute. The mass fractions are relative (they don’t need to sum to 1 – they are normalized in the code).

Disclaimer: Material files included with CatSim may or may not be precisely correct. In general, you can probably assume that elemental material files are correct, but material files for mixtures may include approximations.

The mass attenuation coefficients of the materials are determined from files that are stored in subdirectories under catsim/materials. These files separate the energy-dependent Compton, photoelectric, and Rayleigh absorption processes for each element. These files were obtained from Geant4, and are used under the Geant4 Software License, found at https://geant4.web.cern.ch/download/license.

Phantom

Any of the phantoms can be converted to a voxelized phantom using the function catvoxel.m. This will produce output that can be used by catdose.m and catscatter.m as well as by catsim.m.

The routine that reads and parses the phantom is specified using cfg.callback_phantom = 'PhantomCallback';
where 'PhantomCallback' is one of

'Phantom_Analytic'
'Phantom_NCAT'
'Phantom_Voxelized'

This is set according to which type of phantom file is used, and which projector callback is specified. For details of these dependencies see Table 1: Phantom types and associated callback functions.

The phantom file is given by

cfg.phantom_filename = 'FileName';

where FileName is a file with extension .pp (FORBILD syntax), .ppm (CatSim syntax), or .nrb (NCAT syntax). These can be located in the phantoms directory, but a full path can be included optionally, or the file can be specified relative to the current working directory.

cfg.phantom_scale = ScaleFactor;

is an optional scale factor to be applied to the phantom. Generally CatSim uses mm for all dimensions.

Phantoms and projectors

There are several different phantom types/formats, including

  • voxelized,
  • analytic,
  • polygonal, and
  • NURBS (the format for files produced by XCAT software).

Each type requires its own projector because, as a ray is traced from the source to the detector, we need to determine the pathlength though each material in the phantom, as well as the volume fraction of that material. Determination of the pathlength and material properties depends on the phantom format, hence the need for projectors that can parse each format.

Voxelized files are specified as one or more 2D images. For details about the format, see

Because voxelized phantoms are specified as images, they can be visualized using an image viewer. For details about visualization using ImageJ, see Viewing image files using ImageJ.

The latter three phantom types are specified in text files, each with their own unique format. For details about those formats, see

These phantom types are difficult to visualize, because it would be necessary to parse the file and render an image of what it describes. At this time, no such utilities are provided with XCIST.

Voxelized File Format

Projector

As explained in section 6: Software architecture, CatSim is in principle able to use different phantom types, provided a C library is provided to perform the corresponding projection operations. The projector is specified by the field

cfg.callback_projector = 'ProjectorCallbackFunctionName';

Where ProjectorCallbackFunctionName is one of

'C_Projector_Analytic'
'C_Projector_NCAT'
'C_Projector_Polygon'
'C_Projector_Voxelized'

These all have been reasonable well tested, with the exception of the polygon projector. Prior to Release 5.7, the voxelized projector was limited to a monochromatic spectrum and a single material (water). With Release 5.7, we extended the voxelized projector to perform polychromatic simulations of multi-material voxelized phantoms.

The core catsim.m routine has only a few calls to the C libraries. The various components in the projection process are parsed and passed to C in the following sequence, via the routines specified by these variables:

cfg.callback_getphantom
cfg.callback_setMaterial
cfg.callback_setSource
cfg.callback_setDetector
cfg.callback_projector

The type of phantom that is used determines the projector callback required, which in turn determines the callback that will be used for each of the others. This relationship is summarized in Table 1: Phantom types and associated callback functions.

Some projectors also use the following fields:

The maximum number of threads is specified using
cfg.n_threads=1;

The detector bounding box computation is specified using
cfg.detector_bounding_box_strategy=2;

where 1 means that only v limits are computed for the detector bounding box, and 2 means that both u and v limits are used.

Table 1: Phantom types and associated callback functions

The voxelized projector

Voxelized projector usage

Obviously, the first thing the voxelized projector needs is a voxelized phantom. Please read the CatVoxel section of the Wiki.

The features in an analytic phantom are continuous (not approximated as discrete linear elements), therefore these produce “ideal” simulation results – there is no relationship between the intrinsic phantom characteristics and the pixel size of the detector, or the voxel size in the reconstruction matrix. In contrast, a voxelized phantom inherently contains linear segments that might represent continuous curves. Therefore, one needs to be cautious about the precision of the voxelized phantom uses, depending on the application.

In general, we recommend that the voxelized phantom contain voxels where

• The phantom voxel size in X and Z is smaller than the detector size in X and Z, divided by the geometric magnification.
• The phantom voxel size in X, Y, and Z is smaller than the reconstruction matrix size in the same directions.

In some cases, a voxelized phantom with somewhat large voxels (e.g. > 1 mm) may be perfectly adequate for the application. But typically, the voxelized phantom should have sub-millimeter voxels.

The effect of the choice of phantom voxel size relative to reconstruction voxel size is illustrated in section Voxelized projector validation.

Because voxelized phantoms are image volumes for each material, the total memory required for a phantom of many materials could be large, especially if the phantom represents a large object (in XY and Z), is made with high resolution (many small voxels), and includes many materials.

Required memory can be calculated by

M = NumVoxelsX * NumVoxelsY * NumVoxelsZ * NumMaterials * 4 bytes per voxel

As extreme examples, a (200 mm)3 phantom with 2 materials, represented as a (100 pixel)3 volume (i.e. 2 mm voxels), will require only 8 MB of memory.

However, a (500 mm)3 phantom with 20 materials, represented as a (1k pixel)3 volume (i.e. 0.5 mm voxels), will require 80 GB of memory.

If the required memory size can fit in available RAM, then the entire phantom can be loaded at once, and the simulation will be most efficient. Alternatively, one material can be loaded into RAM at a time. However, this needs to be repeated for each view, therefore efficiency and simulation performance suffer dramatically. The behavior of the voxelized projector in this regard is specified by

cfg.enough_memory_for_voxelized_phantom = Flag;

If the flag is set to 1, CatSim will attempt to load the entire phantom, and a fatal error will occur if there is insufficient memory. In that case, the flag must be set to 0 in order to perform the simulation.

Voxelized projector validation

To validate the voxelized projector when using multiple materials and a polychromatic spectrum, we ran two experiments, using multiple variations in each. One experiment used an analytic phantom and the analytic and voxelized projectors; the second experiment used an NCAT phantom and the NCAT and voxelized projectors. In each experiment, we compared the results of the two projectors after reconstructing images using identical reconstruction parameters.

For the configuration files used for these experiments, see

/base/samples/test_uniformity/readme.txt
/base/samples/test_NCAT/readme.txt

All experiments were performed under the following conditions:

  1. Multi-material phantoms were used.
  2. A 120 kVp spectrum was applied, using (12) 10 keV bins.
  3. “LightSpeed VCT” system and detector geometry were used. For some of Experiment 2, the detector pixels were binned 4X and the number of views was reduced 4X.
  4. No source or detector oversampling was used for the analytic and NCAT projectors.
  5. Oversampling of 11 was used when voxelizing the phantoms.

Analytic File Format

CatSim was originally developed to simulate the following analytic objects: cylinders, ellipsoids, boxes, and clipping planes. Subsequently, the capability to simulate other analytic objects has been added including hyperboloids of one plane, hyperboloids of two planes, cones, and tori (see figure to the right). However, the FORBILD phantom model does not support all these objects. For this and other reasons, we developed a new phantom format that’s based on Matlab syntax. We use the extension .ppm for the new (Matlab-based) format.

This syntax supports phantom files that contain one of two classes of shapes: analytic and polygonal.

For analytic phantoms, use cfg.callback_projector = 'C_Projector_Analytic';

For polygonal phantoms, use cfg.callback_projector = 'C_Projector_Polygon';

Files in the .ppm file syntax are read in by executing them as Matlab scripts. At the end of execution, it is expected that each object in the phantom will be stored in a structure called object, and a list of the materials will be stored in a cell array called materialList. The object structure contains various fields as described below.

These fields are relevant to analytic and polygonal phantoms:

object.material filename that describes the material or an index into the materialList (for example, if the materialList contains ‘water’, and ‘bone’, one could use the number 2 instead of the string ‘bone’.
object.density A density relative to the default density of the material.

These fields are relevant only to polygonal phantoms:

object.vertices The vertices of the polygon
object.tri_inds The indices of the vertices of each triangular face. Faces with more than three vertices should be subdivided into triangles.

These fields are relevant only to analytic phantoms:

object.center The center of the object
object.half_axes The size of the object along 3 object axes
object.euler_angs Three rotation angles that are applied sequentially (about z, y, and z axes respectively) in order to rotate the object to the desired orientation
object.type can be any of the following: Ellipsoid, Cylinder, Torus, Cone, Hyperboloid2, Hyperboloid1, VesselSeg, Box
object.axial_lims Simple way to establish two basic clipping planes for cones and hyperboloids
object.shape Used only for the torus object to define the thickness relative to the radius of curvature
object.clip A set of clipping planes specified as a vector and a distance
object.name object name (optional... used in PhantaSee)
object.color optional... used only in PhantaSee
object.group optional... used only in PhantaSee
object.transparency optional... used only in PhantaSee

There are many ways to structure the phantom description file since it is executed within Matlab. The most straightforward (and verbose) way to specify a given object is to set each parameter of each object on a separate line. For example:

object{1}.center = [0.000000 0.000000 0.000000];
object{1}.half_axes = [108.000000 108.000000 17.500000];
object{1}.euler_angs = [0.000000 0.000000 0.000000];
object{1}.density = 1.000000;
object{1}.type = 'Cylinder';
object{1}.material = 'water';
object{1}.axial_lims = [0.000000 0.000000];
object{1}.shape = 0.000000;
object{1}.clip = [];
object{1}.color = [1.000000 0.000000 0.000000];
object{1}.group = 0;
object{1}.transparancy = 0.000000;   

Note that this can be problematic if you have a phantom of 100 objects and you want to add an object at the beginning of the list such that the former object 1 becomes object 2, the former object 2 becomes object 3 and so on. It is better, therefore, to use the function AddObject() to add the objects into the phantom as in the example .ppm file. Note also that most parameters have default values (the half_axes parameter does not), so there is no need to specify a parameter if you are happy with the default. There is a default header for .ppm files as follows: