opengate.geometry.volumes ========================= .. py:module:: opengate.geometry.volumes Classes ------- .. autoapisummary:: opengate.geometry.volumes.VolumeBase opengate.geometry.volumes.RepeatableVolume opengate.geometry.volumes.BooleanVolume opengate.geometry.volumes.BoxVolume opengate.geometry.volumes.HexagonVolume opengate.geometry.volumes.ConsVolume opengate.geometry.volumes.PolyhedraVolume opengate.geometry.volumes.SphereVolume opengate.geometry.volumes.TrapVolume opengate.geometry.volumes.TrdVolume opengate.geometry.volumes.TubsVolume opengate.geometry.volumes.TesselatedVolume opengate.geometry.volumes.RepeatParametrisedVolume opengate.geometry.volumes.ImageVolume opengate.geometry.volumes.ParallelWorldVolume opengate.geometry.volumes.VolumeTreeRoot Functions --------- .. autoapisummary:: opengate.geometry.volumes._setter_hook_user_info_rotation opengate.geometry.volumes._getter_hook_user_info_rotation opengate.geometry.volumes._setter_hook_user_info_translation opengate.geometry.volumes._getter_hook_user_info_translation opengate.geometry.volumes._setter_hook_user_info_mother opengate.geometry.volumes._setter_hook_voxel_materials opengate.geometry.volumes._setter_hook_ensure_array opengate.geometry.volumes._make_boolean_volume opengate.geometry.volumes.intersect_volumes opengate.geometry.volumes.unite_volumes opengate.geometry.volumes.subtract_volumes Module Contents --------------- .. py:function:: _setter_hook_user_info_rotation(self, rotation_user) Internal function associated with user_info rotation to check its validity. .. py:function:: _getter_hook_user_info_rotation(self, rotation) .. py:function:: _setter_hook_user_info_translation(self, translation_user) .. py:function:: _getter_hook_user_info_translation(self, translation) .. py:function:: _setter_hook_user_info_mother(self, mother) Hook to be attached to property setter of user info 'mother' in all volumes. Checks if new mother is actually different from stored one. If so, it also tries to inform the volume manager that the volume tree needs an update. This latter part only applies for volumes which have a volume manager, i.e. which have been added to a simulation. .. py:function:: _setter_hook_voxel_materials(self, voxel_materials) .. py:function:: _setter_hook_ensure_array(self, input) .. py:class:: VolumeBase(*args, template=None, **kwargs) Bases: :py:obj:`opengate.base.DynamicGateObject`, :py:obj:`anytree.NodeMixin` Store information about a geometry volume: - G4 objects: Solid, LogicalVolume, PhysicalVolume - user parameters: user_info - additional data such as: mother, material etc .. py:attribute:: user_info_defaults .. py:attribute:: parent :value: None .. py:attribute:: _is_constructed :value: False .. py:attribute:: volume_engine :value: None .. py:attribute:: g4_world_log_vol :value: None .. py:attribute:: g4_logical_volume :value: None .. py:attribute:: g4_vis_attributes :value: None .. py:attribute:: g4_physical_volumes :value: [] .. py:attribute:: g4_material :value: None .. py:method:: close() Dummy implementation for inherited classes which do not implement this method. .. py:method:: release_g4_references() Dummy implementation for inherited classes which do not implement this method. .. py:method:: __getstate__() Method needed for pickling. May be overridden in inheriting classes. .. py:method:: __finalize_init__() This method should be called once all attributes have been defined, usually at the end of the __init__ method. It defines the set of known_attribues that will be used to detect errors when the user tries to use a new attribute or misspells an attribute, e.g. box.mohter instead of box.mother. .. py:method:: _update_node() Internal method which retrieves the volume object from the volume manager based on the mother's name stored as user info 'mother' .. py:method:: _request_volume_tree_update() .. py:property:: volume_manager .. py:property:: volume_type .. py:property:: world_volume .. py:property:: volume_depth_in_tree .. py:property:: ancestor_volumes .. py:property:: children_volumes .. py:property:: number_of_repetitions .. py:method:: get_g4_physical_volume(index) .. py:property:: translation_list Utility property which always returns a list of translations, even if the volume is not repeated and has thus only one translation vector. .. py:property:: rotation_list Utility property which always returns a list of rotations, even if the volume is not repeated and has thus only one rotation vector. .. py:property:: g4_region .. py:property:: g4_physical_volume .. py:property:: g4_translation .. py:property:: g4_rotation .. py:property:: g4_transform .. py:property:: mother_g4_logical_volume .. py:property:: mother_volume .. py:method:: construct() .. py:method:: construct_material() .. py:method:: construct_logical_volume() .. py:method:: construct_physical_volume() .. py:method:: _make_physical_volume(volume_name, g4_transform, copy_index=0) .. py:method:: create_changers() .. py:method:: set_production_cut(particle_name, value) .. py:method:: set_max_step_size(max_step_size) .. py:method:: set_max_track_length(max_track_length) .. py:method:: set_min_ekine(min_ekine) .. py:method:: set_max_time(max_time) .. py:method:: set_min_range(min_range) .. py:class:: RepeatableVolume(*args, template=None, **kwargs) Bases: :py:obj:`VolumeBase` Store information about a geometry volume: - G4 objects: Solid, LogicalVolume, PhysicalVolume - user parameters: user_info - additional data such as: mother, material etc .. py:method:: get_repetition_name_from_index(index) .. py:method:: get_repetition_index_from_name(name) .. py:method:: construct_physical_volume() .. py:method:: add_dynamic_parametrisation(repetition_index=0, **params) .. py:class:: BooleanVolume(*args, template=None, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.BooleanSolid` Volume resulting from a boolean operation of the solids contained in two volumes. .. py:function:: _make_boolean_volume(volume_1, volume_2, operation, translation=None, rotation=None, new_name=None) .. py:function:: intersect_volumes(volume_1, volume_2, translation=None, rotation=None, new_name=None) .. py:function:: unite_volumes(volume_1, volume_2, translation=None, rotation=None, new_name=None) .. py:function:: subtract_volumes(volume_1, volume_2, translation=None, rotation=None, new_name=None) .. py:class:: BoxVolume(*args, template=None, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.BoxSolid` Volume with a box shape. .. py:class:: HexagonVolume(*args, template=None, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.HexagonSolid` Volume with a hexagon shape. .. py:class:: ConsVolume(*args, template=None, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.ConsSolid` Volume with the shape of a cone or conical section. .. py:class:: PolyhedraVolume(*args, template=None, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.PolyhedraSolid` Volume with a polyhedral shape. .. py:class:: SphereVolume(*args, template=None, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.SphereSolid` Volume with a sphere or spherical shell shape. .. py:class:: TrapVolume(*args, template=None, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.TrapSolid` Volume with a generic trapezoidal shape. .. py:class:: TrdVolume(*args, template=None, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.TrdSolid` Volume with a symmetric trapezoidal shape. .. py:class:: TubsVolume(*args, template=None, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.TubsSolid` Volume with a tube or cylindrical section shape. .. py:class:: TesselatedVolume(*args, template=None, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.TesselatedSolid` Volume based on a mesh volume by reading an STL file. .. py:class:: RepeatParametrisedVolume(repeated_volume, *args, **kwargs) Bases: :py:obj:`VolumeBase` Volume created from another volume via translations. .. py:attribute:: user_info_defaults .. py:attribute:: repeated_volume .. py:attribute:: g4_repeat_parametrisation :value: None .. py:method:: close() Dummy implementation for inherited classes which do not implement this method. .. py:method:: release_g4_references() Dummy implementation for inherited classes which do not implement this method. .. py:method:: __getstate__() Method needed for pickling. May be overridden in inheriting classes. .. py:method:: construct() .. py:method:: construct_physical_volume() .. py:method:: create_repeat_parametrisation() .. py:class:: ImageVolume(*args, **kwargs) Bases: :py:obj:`VolumeBase`, :py:obj:`opengate.geometry.solids.ImageSolid` Store information about a voxelized volume .. py:attribute:: user_info_defaults .. py:attribute:: material_to_label_lut :value: None .. py:attribute:: itk_image :value: None .. py:attribute:: label_image :value: None .. py:attribute:: g4_physical_x :value: None .. py:attribute:: g4_physical_y :value: None .. py:attribute:: g4_physical_z :value: None .. py:attribute:: g4_logical_x :value: None .. py:attribute:: g4_logical_y :value: None .. py:attribute:: g4_logical_z :value: None .. py:attribute:: g4_voxel_param :value: None .. py:method:: __getstate__() Method needed for pickling. May be overridden in inheriting classes. .. py:method:: close() Dummy implementation for inherited classes which do not implement this method. .. py:method:: release_g4_references() Dummy implementation for inherited classes which do not implement this method. .. py:property:: size_pix .. py:property:: spacing .. py:property:: native_translation .. py:property:: native_rotation .. py:method:: construct() .. py:method:: construct_physical_volume() .. py:method:: construct_logical_volume() .. py:method:: create_material_to_label_lut(material=None, voxel_materials=None) .. py:method:: read_input_image(path=None) .. py:method:: create_label_image(itk_image=None) .. py:method:: create_image_parametrisation(label_image=None) .. py:method:: update_label_image(label_image) Needed for dynamic image parametrisation. .. py:method:: save_label_image(path=None) .. py:method:: create_density_image() .. py:method:: create_changers() .. py:class:: ParallelWorldVolume(name, volume_manager) Bases: :py:obj:`anytree.NodeMixin` .. py:attribute:: name .. py:attribute:: volume_manager .. py:attribute:: parent .. py:attribute:: parallel_world_engine :value: None .. py:attribute:: g4_world_phys_vol :value: None .. py:attribute:: g4_world_log_vol :value: None .. py:method:: release_g4_references() .. py:method:: close() .. py:method:: __getstate__() .. py:method:: construct() .. py:method:: _update_node() .. py:class:: VolumeTreeRoot(volume_manager) Bases: :py:obj:`anytree.NodeMixin` Small class to provide a root for the volume tree. .. py:attribute:: volume_manager .. py:attribute:: name :value: 'volume_tree_root' .. py:attribute:: parent :value: None .. py:method:: __getstate__()