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.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, **kwargs) Bases: :py:obj:`opengate.base.GateObject`, :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() .. py:method:: release_g4_references() .. 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_type .. py:property:: world_volume .. py:property:: volume_depth_in_tree .. py:property:: ancestor_volumes .. py:property:: number_of_repetitions .. 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:: 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, **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:class:: BooleanVolume(*args, **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, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.BoxSolid` Volume with a box shape. .. py:class:: HexagonVolume(*args, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.HexagonSolid` Volume with a hexagon shape. .. py:class:: ConsVolume(*args, **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, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.PolyhedraSolid` Volume with a polyhedral shape. .. py:class:: SphereVolume(*args, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.SphereSolid` Volume with a sphere or spherical shell shape. .. py:class:: TrapVolume(*args, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.TrapSolid` Volume with a generic trapezoidal shape. .. py:class:: TrdVolume(*args, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.TrdSolid` Volume with a symmetric trapezoidal shape. .. py:class:: TubsVolume(*args, **kwargs) Bases: :py:obj:`RepeatableVolume`, :py:obj:`opengate.geometry.solids.TubsSolid` Volume with a tube or cylindrical section shape. .. 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:: type_name :value: 'RepeatParametrised' .. py:attribute:: repeated_volume .. py:attribute:: repeat_parametrisation :value: None .. py:method:: close() .. 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:: close() .. py:method:: release_g4_references() .. py:property:: size_pix .. py:property:: spacing .. py:method:: construct() .. py:method:: construct_physical_volume() .. py:method:: construct_logical_volume() .. py:method:: process_input_image() .. py:method:: save_label_image(path=None) .. py:method:: _initialize_image_parameterisation() From the input image, a label image is computed with each label associated with a material. The label image is initialized with label 0, corresponding to the first material Correspondence from voxel value to material is given by a list of interval [min_value, max_value, material_name] all pixels with values between min (included) and max (not included) will be associated with the given material .. 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:: 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:: close()