mpacts.commands.misc. lighttransport

In order to be able to use this module import it like this:

import mpacts.commands.misc.lighttransport
#or assign it to a shorter name
import mpacts.commands.misc.lighttransport as lig

AbsorbCommand

class mpacts.commands.misc.lighttransport.AbsorbCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command that computes a change in ‘packet_size’ based on background absorption. The change is added to the ‘delta_packet_size’ array, and the user is stillresponsible to use Euler time integration to actually update the ‘packet_size’ array at the end of the ‘timestep’
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • alb — Absorption parameter.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, alb, [gate, predicate]
AbsorbCommand(name, parent, **kwargs)

AbsorbLayerCommand

class mpacts.commands.misc.lighttransport.AbsorbLayerCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command that computes a change in ‘packet_size’ based on background absorption. The change is added to the ‘delta_packet_size’ array, and the user is stillresponsible to use Euler time integration to actually update the ‘packet_size’ array at the end of the ‘timestep’. This command takes into account the layer inwhich the photonpacket is located.
Default location: ‘loop_cmds/post_contact_cmds’
  • Required keywords:
    • pc_layers — Particle container which describes the layers and their properties.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • rel_step_size (default value = 1) — Factor by which the step size is multiplied.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, pc_layers, [gate, predicate, rel_step_size]
AbsorbLayerCommand(name, parent, **kwargs)

AbsorbSphereCommand

class mpacts.commands.misc.lighttransport.AbsorbSphereCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command that computes absorption for photonpackets for each sphere indpendently.
Default location: ‘loop_cmds/contact_cmds’
  • Required keywords:
    • pc_spheresOP — Particle container which contains information about the optical properties of the spheres
    • pc_spheres — Particle container which contains information about the geometry of the spheres
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, pc_spheres, pc_spheresOP, [gate, predicate]
AbsorbSphereCommand(name, parent, **kwargs)

ComputeOptimizedStepSizeLayerCommand

class mpacts.commands.misc.lighttransport.ComputeOptimizedStepSizeLayerCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command to compute the step size of photon packets based on their ‘ut’ array, and as sampled from a logarithmic distribution.Step size can be split into multiple computationally optimized ‘sub-steps’ for contact detection, and the layer of the packet is taken into account.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • pc_layers — Particle container which describes the layers and their properties.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • n_radius (default value = 1) — Factor by which the step size is multiplied.
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, pc_layers, [gate, predicate, n_radius]
ComputeOptimizedStepSizeLayerCommand(name, parent, **kwargs)

ComputeStepSizeCommand

class mpacts.commands.misc.lighttransport.ComputeStepSizeCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command to compute the step size of photon packets based on their ‘ut’ array, and as sampled from a logarithmic distribution.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, [gate, predicate]
ComputeStepSizeCommand(name, parent, **kwargs)

DisplaceXToSphereSurfaceCommand

class mpacts.commands.misc.lighttransport.DisplaceXToSphereSurfaceCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

After sphere interaction, displaces ‘x’ to the spheres’ surface.
Default location: ‘loop_cmds/contact_cmds’
  • Required keywords:
    • pc_spheres — Particle container which contains information about the geometry of the spheres
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, pc_spheres, [gate, predicate]
DisplaceXToSphereSurfaceCommand(name, parent, **kwargs)

DisplaceXtToBoundaryCommand

class mpacts.commands.misc.lighttransport.DisplaceXtToBoundaryCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

When x and xt are not in the same layer, this command moves xt to the layers’ boundary.
Default location: ‘loop_cmds/pre_contact_cmds’
  • Required keywords:
    • pc_layers — Particle container which contains information about the layers
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • tolerance (default value = 0) — Additional distance beyond boundary layer to prevent computational errors
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, pc_layers, [gate, predicate, tolerance]
DisplaceXtToBoundaryCommand(name, parent, **kwargs)

KillCommand

class mpacts.commands.misc.lighttransport.KillCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command sets ‘alive’ to false and stores its weight in a property.
Default location: ‘loop_cmds/post_contact_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • edge_out (default value = 0) — Variable that stores the transmittance through the edges
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, [gate, predicate, edge_out]
KillCommand(name, parent, **kwargs)

LayerBoundaryInteractionCommand

class mpacts.commands.misc.lighttransport.LayerBoundaryInteractionCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Computes the optical interaction at the interface between two layers. The photonpacket can be internally reflected or be transmitted.
Default location: ‘loop_cmds/contact_cmds’
  • Required keywords:
    • Nlayers — Amount of layers in the sample
    • pc_layers — Particle container which contains information about the layers
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • move_out (default value = 1) — extra z-direction movement to get photon out of the sample
    • n_bottom (default value = 1) — Refractive index below the sample
    • n_top (default value = 1) — Refractive index above the sample
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, pc_layers, Nlayers, [gate, predicate, n_top, n_bottom, move_out]
LayerBoundaryInteractionCommand(name, parent, **kwargs)

MoveSubStepsCommand

class mpacts.commands.misc.lighttransport.MoveSubStepsCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Displaces x to xt for the next step and updates the ‘substep’ counter for subdivided MC steps.
Default location: ‘loop_cmds/post_contact_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, [gate, predicate]
MoveSubStepsCommand(name, parent, **kwargs)

RecycleCommand

class mpacts.commands.misc.lighttransport.RecycleCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command that recycles particles flagged as non-alive using the array ‘alive’. The command accepts one or two generator instances that produce the initial data for the newly created photon packets. This command will also ensure that particles will be actually killed if the number of already recycled particles exceeds a user-given value. Ideally this command is executed as the very first thing the loop_cmds.
Default location: ‘loop_cmds/pre_body_force_cmds’
  • Required keywords:
    • generator1 — First generator for recycling ‘death’ particles.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • Nmax (default value = -1) — Maximum number of particles to revive. If < 0, there is no maximum.
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • generator2 (default value = None) — Second generator for recycling ‘death’ particles.
    • p_gen1 (default value = 1) — Probability of using generator 1. If ‘1’, a second generator does not need to be provided. The probability of using the second generator will be 1-p_gen1
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
  • Read only properties:
    • N — Total number of recycled particles. (display to monitor amount of simulated photons)
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, generator1, [gate, predicate, generator2, p_gen1, Nmax]
RecycleCommand(name, parent, **kwargs)

RouletteCommand

class mpacts.commands.misc.lighttransport.RouletteCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command to activate a ‘Roulette’ which will either kill a particle or increase its weight with the inverse probability, so as low-weight photon packets can be removed properly from the simulation.
Default location: ‘loop_cmds/post_integration_cmds’
  • Required keywords:
    • p — Probability of removing the particle in the roulette.
    • packet_size_crit — Critical packet size (weight) below which the roulette will be activated
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, p, packet_size_crit, [gate, predicate]
RouletteCommand(name, parent, **kwargs)

ScatterCommand

class mpacts.commands.misc.lighttransport.ScatterCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command to compute scattering based on parameter ‘g’.
Default location: ‘loop_cmds/body_force_cmds’
  • Required keywords:
    • g — Scattering strength(?) ‘g’.
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, g, [gate, predicate]
ScatterCommand(name, parent, **kwargs)

ScatterLayerCommand

class mpacts.commands.misc.lighttransport.ScatterLayerCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command to compute scattering in separate layers based on layer-array ‘g’.
Default location: ‘loop_cmds/post_contact_cmds’
  • Required keywords:
    • pc_layers — Paricle container of the different layer properties
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, pc_layers, [gate, predicate]
ScatterLayerCommand(name, parent, **kwargs)

ScatterSphereCommand

class mpacts.commands.misc.lighttransport.ScatterSphereCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command to compute scattering inside spheres based on precomputed phase function.
Default location: ‘loop_cmds/contact_cmds’
  • Required keywords:
    • pc_spheresOP — Particle container which contains information about the optical properties of the spheres
    • pc_spheres — Particle container which contains information about the geometry of the spheres
    • pc — Particle container on which the command is applied
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, pc_spheres, pc_spheresOP, [gate, predicate]
ScatterSphereCommand(name, parent, **kwargs)

StoreUnscatteredTransmittanceCommand

class mpacts.commands.misc.lighttransport.StoreUnscatteredTransmittanceCommand

Bases: mpacts.core.command.Command, mpacts.core.baseobject.BaseObject

Command that stores in a property the amount of unscattered transmittance (i.e. all photon packets that left the bottom without changing direction)
Default location: ‘loop_cmds/post_contact_cmds’
  • Required keywords:
    • pc — Particle container on which the command is applied
    • tolerance — The photon needs to be this extra distance beyond the tissue to be regarded as transmittance
    • z_bottom — Coordinate of the bottom of the tissue
  • Optional keywords:
    • gate (default value = ET::ChildProperty const*) — Can decide to (temporarily) not execute the command in a CommandList. (Default is ExecuteAlways)
    • predicate (default value = None) — Predicate that will decide whether this command is executed for a specific particle, when absent the command is executed for every particle.
    • unscattered_transmittance (default value = 0) — Variable that stores the unscattered transmittance
object __init__(tuple args, dict kwds) :
args: name, parent kwds: pc, tolerance, z_bottom, [gate, predicate, unscattered_transmittance]
StoreUnscatteredTransmittanceCommand(name, parent, **kwargs)