3.1.1.7.2.11. opengate.source.VoxelizedSourcePDFSampler

3.1.1.7.2.11.1. Module Contents

3.1.1.7.2.11.1.1. Classes

VoxelizedSourcePDFSampler

This is an alternative to GateSPSVoxelsPosDistribution (c++)

class opengate.source.VoxelizedSourcePDFSampler.VoxelizedSourcePDFSampler(itk_image, version=1)[source]

This is an alternative to GateSPSVoxelsPosDistribution (c++) It is needed because the cond voxel source is used on python side.

There are two versions, version 2 is much slower (do not use)

init_cdf()[source]
searchsorted2d(a, b)[source]
sample_indices_slower(n, rs=np.random)[source]

This version seems slower than the other version with np random choice

samples_g4(n)[source]
sample_indices(n, rs=np.random)[source]
sample_indices_phys(n, rs=np.random)[source]