opengate.actors.digitizers ========================== .. py:module:: opengate.actors.digitizers Classes ------- .. autoapisummary:: opengate.actors.digitizers.Digitizer opengate.actors.digitizers.DigitizerBase opengate.actors.digitizers.DigitizerAdderActor opengate.actors.digitizers.DigitizerBlurringActor opengate.actors.digitizers.DigitizerSpatialBlurringActor opengate.actors.digitizers.DigitizerEfficiencyActor opengate.actors.digitizers.DigitizerEnergyWindowsActor opengate.actors.digitizers.DigitizerHitsCollectionActor opengate.actors.digitizers.DigitizerProjectionActor opengate.actors.digitizers.DigitizerReadoutActor opengate.actors.digitizers.PhaseSpaceActor Functions --------- .. autoapisummary:: opengate.actors.digitizers.ene_win_peak opengate.actors.digitizers.ene_win_down_scatter opengate.actors.digitizers.ene_win_up_scatter opengate.actors.digitizers.energy_windows_peak_scatter opengate.actors.digitizers.get_simplified_digitizer_channels_Tc99m opengate.actors.digitizers.get_simplified_digitizer_channels_Lu177 opengate.actors.digitizers.get_simplified_digitizer_channels_In111 opengate.actors.digitizers.get_simplified_digitizer_channels_I131 opengate.actors.digitizers.get_simplified_digitizer_channels_rad Module Contents --------------- .. py:function:: ene_win_peak(name, energy, energy_width_percent) .. py:function:: ene_win_down_scatter(name, peak_min_value, energy_width_percent) .. py:function:: ene_win_up_scatter(name, peak_max_value, energy_width_percent) .. py:function:: energy_windows_peak_scatter(peak_name, down_scatter_name, up_scatter_name, peak, peak_width, down_scatter_width, up_scatter_width=None) .. py:function:: get_simplified_digitizer_channels_Tc99m(spect_name, scatter_flag) .. py:function:: get_simplified_digitizer_channels_Lu177(spect_name, scatter_flag) .. py:function:: get_simplified_digitizer_channels_In111(spect_name, scatter_flag) .. py:function:: get_simplified_digitizer_channels_I131(spect_name, scatter_flag) .. py:function:: get_simplified_digitizer_channels_rad(spect_name, rad, scatter_flag) .. py:class:: Digitizer(sim, volume_name, digit_name) Simple helper class to reduce the code size when creating a digitizer. It only avoids repeating attached_to, output and input_digi_collection parameters. .. py:attribute:: simulation .. py:attribute:: volume_name .. py:attribute:: name .. py:attribute:: actors :value: [] .. py:attribute:: hc .. py:method:: set_hit_collection() .. py:method:: add_module(module_type, module_name=None) .. py:method:: get_last_module() .. py:method:: find_first_module(s) Find the first module that contains the s string .. py:class:: DigitizerBase(*args, **kwargs) Bases: :py:obj:`opengate.actors.base.ActorBase` .. py:attribute:: _output_name_root :value: 'root_output' .. py:attribute:: authorize_repeated_volumes :type: bool .. py:attribute:: user_info_defaults .. py:method:: _add_user_output_root(**kwargs) Specialized method to add a root user output in digitizers. The output name is hard-coded at the class-level and the same for all digitizers, i.e. in all digitizers, the user can do: digitizer.user_output.root_output Additionally, the C++ classes expect an output with this name. .. py:method:: initialize() .. py:class:: DigitizerAdderActor(*args, **kwargs) Bases: :py:obj:`DigitizerBase`, :py:obj:`opengate_core.GateDigitizerAdderActor` Equivalent to Gate "adder": gather all hits of an event in the same volume. Input: a HitsCollection, need aat least TotalEnergyDeposit and PostPosition attributes Output: a Single collections Policies: - EnergyWinnerPosition: consider position and energy of the hit with the max energy for all other attributes (Time, etc.): the value of the winner is used. - EnergyWeightedCentroidPosition: computed the energy-weighted centroid position for all other attributes (Time, etc.): the value the last seen hit is used. .. py:attribute:: user_info_defaults .. py:method:: __initcpp__() .. py:method:: initialize() .. py:method:: set_group_by_depth() .. py:method:: StartSimulationAction() .. py:method:: EndSimulationAction() .. py:class:: DigitizerBlurringActor(*args, **kwargs) Bases: :py:obj:`DigitizerBase`, :py:obj:`opengate_core.GateDigitizerBlurringActor` Digitizer module for blurring an attribute (single value only, not a vector). Usually for energy or time. .. py:attribute:: user_info_defaults .. py:attribute:: type_name :value: 'DigitizerBlurringActor' .. py:method:: __initcpp__() .. py:method:: initialize() .. py:method:: initialize_blurring_parameters() .. py:method:: set_param_gauss() .. py:method:: set_param_inverse_square() .. py:method:: set_param_linear() .. py:method:: StartSimulationAction() .. py:method:: EndSimulationAction() .. py:class:: DigitizerSpatialBlurringActor(*args, **kwargs) Bases: :py:obj:`DigitizerBase`, :py:obj:`opengate_core.GateDigitizerSpatialBlurringActor` Digitizer module for blurring a (global) spatial position. .. py:attribute:: user_info_defaults .. py:method:: __initcpp__() .. py:method:: initialize_blurring_parameters() .. py:method:: initialize() .. py:method:: StartSimulationAction() .. py:method:: EndSimulationAction() .. py:class:: DigitizerEfficiencyActor(*args, **kwargs) Bases: :py:obj:`DigitizerBase`, :py:obj:`opengate_core.GateDigitizerEfficiencyActor` Digitizer module for simulating efficiency. .. py:attribute:: user_info_defaults .. py:method:: __initcpp__() .. py:method:: initialize_blurring_parameters() .. py:method:: initialize() .. py:method:: StartSimulationAction() .. py:method:: EndSimulationAction() .. py:class:: DigitizerEnergyWindowsActor(*args, **kwargs) Bases: :py:obj:`DigitizerBase`, :py:obj:`opengate_core.GateDigitizerEnergyWindowsActor` Consider a list of hits and arrange them according to energy intervals. Input: one DigiCollection Output: as many DigiCollections as the number of energy windows .. py:attribute:: user_info_defaults .. py:method:: __initcpp__() .. py:method:: initialize() .. py:method:: StartSimulationAction() .. py:method:: EndSimulationAction() .. py:class:: DigitizerHitsCollectionActor(*args, **kwargs) Bases: :py:obj:`DigitizerBase`, :py:obj:`opengate_core.GateDigitizerHitsCollectionActor` Build a list of hits in a given volume. - the list of attributes to be stored is given in the 'attributes' options - output as root .. py:attribute:: user_info_defaults .. py:method:: __initcpp__() .. py:method:: initialize() .. py:method:: StartSimulationAction() .. py:method:: EndSimulationAction() .. py:class:: DigitizerProjectionActor(*args, **kwargs) Bases: :py:obj:`DigitizerBase`, :py:obj:`opengate_core.GateDigitizerProjectionActor` This actor takes as input HitsCollections and performed binning in 2D images. If there are several HitsCollection as input, the slices will correspond to each HC. If there are several runs, images will also be slice-stacked. .. py:attribute:: input_digi_collections :type: List[str] .. py:attribute:: spacing :type: List[float] .. py:attribute:: size :type: List[int] .. py:attribute:: physical_volume_index :type: int .. py:attribute:: origin_as_image_center :type: bool .. py:attribute:: detector_orientation_matrix :type: numpy.ndarray .. py:attribute:: user_info_defaults .. py:attribute:: start_output_origin :value: None .. py:method:: __initcpp__() .. py:method:: initialize() .. py:property:: output_size .. py:property:: output_spacing .. py:method:: compute_thickness(volume, channels) Get the thickness of the detector volume, in the correct direction. By default, it is Z. We use the 'projection_orientation' to get the correct one. .. py:method:: StartSimulationAction() .. py:method:: EndSimulationAction() .. py:class:: DigitizerReadoutActor(*args, **kwargs) Bases: :py:obj:`DigitizerAdderActor`, :py:obj:`opengate_core.GateDigitizerReadoutActor` This actor is a DigitizerAdderActor + a discretization step: the final position is the center of the volume .. py:attribute:: user_info_defaults .. py:method:: __initcpp__() .. py:method:: StartSimulationAction() .. py:method:: EndSimulationAction() .. py:class:: PhaseSpaceActor(*args, **kwargs) Bases: :py:obj:`DigitizerBase`, :py:obj:`opengate_core.GatePhaseSpaceActor` Similar to HitsCollectionActor : store a list of hits. However only the first hit of given event is stored here. .. py:attribute:: user_info_defaults .. py:attribute:: total_number_of_entries :value: 0 .. py:attribute:: number_of_absorbed_events :value: 0 .. py:method:: __initcpp__() .. py:method:: initialize() .. py:method:: StartSimulationAction() .. py:method:: EndSimulationAction()