3.10.1.11.1.1. opengate.geometry.materials

3.10.1.11.1.1.1. Classes

ElementBuilder

A description of a G4Element that can be build.

MaterialBuilder

A description of a material, that will can be built on demand.

MaterialDatabase

Manage a unique list of Geant4 materials and elements.

3.10.1.11.1.1.2. Functions

read_voxel_materials(filename[, def_mat])

HU_read_materials_table(file_mat)

HU_read_density_table(file_density)

HU_linear_interpolate_densities(hu, densities)

HU_find_max_density_difference(hu_min, hu_max, d_min, ...)

HounsfieldUnit_to_material(simulation, ...)

Same function than in GateHounsfieldToMaterialsBuilder class.

dump_material_like_Gate(mat)

assert_same_material(m1, m2)

read_next_line(f)

read_tag(s, tag)

read_tag_with_unit(s, tag)

create_density_img(img_volume, material_database)

Parameters

create_mass_img(ct_itk, hu_density_file[, overrides])

Parameters

3.10.1.11.1.1.3. Module Contents

opengate.geometry.materials.read_voxel_materials(filename, def_mat='G4_AIR')[source]
opengate.geometry.materials.HU_read_materials_table(file_mat)[source]
opengate.geometry.materials.HU_read_density_table(file_density)[source]
opengate.geometry.materials.HU_linear_interpolate_densities(hu, densities)[source]
opengate.geometry.materials.HU_find_max_density_difference(hu_min, hu_max, d_min, d_max, densities)[source]
opengate.geometry.materials.HounsfieldUnit_to_material(simulation, density_tolerance, file_mat, file_density)[source]

Same function than in GateHounsfieldToMaterialsBuilder class. Probably far from optimal, put we keep the compatibility

opengate.geometry.materials.dump_material_like_Gate(mat)[source]
opengate.geometry.materials.assert_same_material(m1, m2)[source]
opengate.geometry.materials.read_next_line(f)[source]
opengate.geometry.materials.read_tag(s, tag)[source]
opengate.geometry.materials.read_tag_with_unit(s, tag)[source]
opengate.geometry.materials.create_density_img(img_volume, material_database)[source]

3.10.1.11.1.1. Parameters

img_volumeImageVolume

opengate ImageVolume class instance

material_databasedict

dictionary with keys: material name, values: G4 material obj

3.10.1.11.1.1. Returns

rhoitk.Image

image of the same size and resolution of the ct. The voxel value is the density of the voxel. Density is returned in G4 1/kg.

opengate.geometry.materials.create_mass_img(ct_itk, hu_density_file, overrides=dict())[source]

3.10.1.11.1.1. Parameters

ct_itk :itk.Image

ct image

hu_density_filestr

filepath of the HU to density table

overridesdict, optional

Dict where keys are HU to be overwritten and values are density values. The default is dict().

3.10.1.11.1.1. Returns

massitk.Image

image of the same size and resolution of the ct. The voxel value is the mass of the voxel. Mass is returned in grams.

class opengate.geometry.materials.ElementBuilder(material_database)[source]

A description of a G4Element that can be build.

type = 'element'[source]
name = None[source]
symbol = None[source]
Zeff = None[source]
Aeff = None[source]
material_database[source]
__repr__()[source]
read(line)[source]
build()[source]
class opengate.geometry.materials.MaterialBuilder(material_database)[source]

A description of a material, that will can be built on demand. A material is described by a list of components that can be elements or sub-materials.

type = 'material'[source]
name = None[source]
symbol = None[source]
density = None[source]
n = None[source]
state = None[source]
components[source]
material_database[source]
__repr__()[source]
read(f, line)[source]
read_one_element(line)[source]
read_one_submat(line)[source]
build()[source]
add_element_to_material(mat, elem)[source]
add_submat_to_material(mat, elem)[source]
class opengate.geometry.materials.MaterialDatabase[source]

Manage a unique list of Geant4 materials and elements. The materials/elements are read in a DB txt file or in NIST. They are only build on demand, during the geometry Construct

filenames = [][source]
material_builders[source]
material_builders_by_filename[source]
element_builders[source]
element_builders_by_filename[source]
new_materials_nb_atoms[source]
new_materials_weights[source]
g4_materials[source]
g4_elements[source]
current_section = None[source]
current_filename = None[source]
g4_NistManager = None[source]
nist_material_names = None[source]
nist_element_names = None[source]
__getstate__()[source]
__setstate__(state)[source]
read_from_file(filename)[source]
read_one_item(f, line)[source]
init_NIST()[source]
add_material_nb_atoms(*args)[source]

Usage example: “Lead”, [“Pb”], [1], 11.4 * gcm3 “BGO”, [“Bi”, “Ge”, “O”], [4, 3, 12], 7.13 * gcm3)

add_material_weights(*args)[source]

Usage example : add_material_weights(name, elems_symbol_nz, weights_nz, 3 * gcm3)

initialize()[source]
init_user_mat()[source]
FindOrBuildMaterial(material_name)[source]
FindOrBuildElement(element_name)[source]
get_database_material_names(db=None)[source]