xopto.mcbase.mcfluence.fluencecylt module¶
- class FluenceCylt(raxis: xopto.mcbase.mcutil.axis.Axis, fiaxis: Optional[xopto.mcbase.mcutil.axis.Axis] = None, zaxis: Optional[xopto.mcbase.mcutil.axis.Axis] = None, taxis: Optional[xopto.mcbase.mcutil.axis.Axis] = None, center: Tuple[float, float] = (0.0, 0.0), mode: str = 'deposition')[source]¶
Bases:
xopto.mcbase.mcobject.McObject
Cylindrical Fluence object constructor. Default constructor disables the fluence functionality by creating a zero-size fluence accumulator array.
- Parameters
raxis (Axis or FluenceCylt) – Axis that defines accumulators along the radial axis. If FluenceCylt instance, a new copy is created.
fiaxis (Axis) – Axis that defines accumulators along the polar angle axis. The range of this axis typically span from 0 to 2*:math:pi.
zaxis (Axis) – Axis that defines accumulators along the z axis.
taxis (Axis) – Axis that defines accumulators along the temporal axis.
center (Tuple(float, float)) – Center of the cylindrical coordinate system in the x-y plane.
mode (str from ('deposition', 'fluence')) –
Mode that is used to accumulate the photon packet weight:
fluence - fluence rate ( 1/m 2)
deposition - absorbed energy (sum of photon packet weights absorbed in the voxel 1/m 3).
Note
The fluence accumulator buffer data type is inherited from the Monte Carlo simulator mc_accu_t type.
- property center: numpy.ndarray¶
Center of the cylindrical coordinate system in the x-y plane.
- static cl_declaration(mc: xopto.mcbase.mcobject.McObject) → str[source]¶
- static cl_implementation(mc: xopto.mcbase.mcobject.McObject)[source]¶
- cl_options(mc: xopto.mcbase.mcobject.McObject) → List[Tuple[str, str]][source]¶
- cl_pack(mc: xopto.mcbase.mcobject.McObject, target: Optional[xopto.cl.cltypes.Structure] = None) → xopto.cl.cltypes.Structure[source]¶
Fills the structure (target) with the data required by the Monte Carlo simulator. See the
FluenceCylt.cl_type()
for a detailed list of fields.- Parameters
mc (mcobject.McObject) – Monte Carlo simulator instance.
target (ClFluenceCylt) – CStructure that is filled with the source data.
buffer (np.ndarray) – Accumulator buffer or None. Should be checked for proper size. Use py:attr:mc.types.np_accu attribute to determine the numpy type of the accumulator used in the Monte Carlo simulator.
- Returns
target – Filled structure received as an input argument or a new instance if the input argument target is None.
- Return type
ClFluenceCylt
- static cl_type(mc: xopto.mcbase.mcobject.McObject) → xopto.cl.cltypes.Structure[source]¶
- property data¶
Fluence accumulator - deposition or fluence rate.
- property dfi: numpy.ndarray¶
The size of voxels along the polar angle axis.
- property dr: numpy.ndarray¶
The size of voxels along the radial axis.
- property dt: numpy.ndarray¶
The size of voxels along the t axis.
- property dz: numpy.ndarray¶
The size of voxels along the z axis.
- property fi: numpy.ndarray¶
Accumulator centers along the polar angle axis.
- property fiaxis: xopto.mcbase.mcutil.axis.Axis¶
Accumulator axis object along the polar angle axis.
- classmethod fromdict(data: dict) → xopto.mcbase.mcfluence.fluencecylt.FluenceCylt[source]¶
Create a FluenceCylt instance from a dictionary.
- Parameters
data (dict) – Dictionary created by the
FluenceCylt.todict()
method.
- property k: int¶
Fluence floating point to accumulatorinteger conversion coefficient.
- property mode: int¶
The accumulator mode.
- property nphotons: int¶
The number of photon packets that produced the raw data accumulator content.
- plot(scale: str = 'log', axis: str = 'z', autoscale: bool = True, show: bool = True)[source]¶
Show fluence slices or integral projections.
- Parameters
scale (str) – Data scaling can be “log” for logarithmic or “lin” for linear.
axis (str) – The axis of slicing (“z”, “fi” or “r”) or a projection along the selected coordinate axis (“rproj”, “fiproj”, “zproj”). Alternatively, specify the projection plane as one of (“rfi”, “rz”, or “fiz”).
autoscale (bool) – Scale the color coding of individual slices to the corresponding range of weights. If True, the color coding changes from slice to slice.
show (bool) –
- property r: numpy.ndarray¶
Accumulator centers along the radial axis.
- property raw: numpy.ndarray¶
Raw fluence accumulator data if any.
- property raxis: xopto.mcbase.mcutil.axis.Axis¶
Accumulator axis object along the radial axis.
- property shape: Tuple[int, int, int, int]¶
Fluence array shape.
- property t: numpy.ndarray¶
Accumulator centers along the t axis.
- property taxis: xopto.mcbase.mcutil.axis.Axis¶
Accumulator axis object along the t axis.
- todict() → dict[source]¶
Save the fluence configuration without the accumulator data to a dictionary.
- Returns
data – Fluence configuration as a dictionary.
- Return type
dict
- update(obj: xopto.mcbase.mcfluence.fluencecylt.FluenceCylt)[source]¶
Update the fluence accumulator with data from the given fluence object.
- Parameters
obj (FluenceCylt) – Update the fluence accumulator of this instance with the data from fluence instance obj.
- update_data(mc: xopto.mcbase.mcobject.McObject, data: Dict[numpy.dtype, List[numpy.ndarray]], nphotons: int, **kwargs)[source]¶
Update fluence accumulator data with simulation results.
- Parameters
mc (mcobject.McObject) – Simulator instance that produced the data.
data (Dict[np.dtype, List[np.ndarray]]) – List of allocated accumulators (this implementation uses only one accumulator buffer).
nphotons (int) – The number of photon packets that produced the raw data accumulator content.
kwargs (dict) – Additional keyword arguments not used by this implementation.
- property z: numpy.ndarray¶
Accumulator centers along the z axis.
- property zaxis: xopto.mcbase.mcutil.axis.Axis¶
Accumulator axis object along the z axis.