nanopyx.core.generate.noise_add_gaussians

def render_random_gaussians( width: int, height: int, nFrames: int, particles_per_slice: int, amplitude: float = 1000.0, sigma_x: float = 1.5, sigma_y: float = 1.5, particles_per_slice_randomness: float = 0.25, amplitude_randomness: float = 0.25, sigma_x_randomness: float = 0.1, sigma_y_randomness: float = 0.1):

Generate a stack of images with random particles

Parameters
  • width: the width of the image
  • height: the height of the image
  • nFrames: the number of frames in the stack
  • particles_per_slice: the number of particles per frame
  • amplitude: the amplitude of the particles
  • sigma_x: the sigma of the particles in the x direction
  • sigma_y: the sigma of the particles in the y direction
  • particles_per_slice_randomness: the randomness of the number of particles per frame
  • amplitude_randomness: the randomness of the amplitude of the particles
  • sigma_x_randomness: the randomness of the sigma of the particles in the x direction
  • sigma_y_randomness: the randomness of the sigma of the particles in the y direction
Returns

a stack of images with random particles

def render_gaussians(image, x, y, amplitude, sigma_x, sigma_y):

Render a set of gaussian particles on an image using the error function (erf) to calculate the integral of the gaussian

Parameters
  • image: the image to render the particles on
  • xp: the x position of the center of the gaussian
  • yp: the y position of the center of the gaussian
  • amplitude: the amplitude of the gaussian
  • sigma_x: the sigma of the gaussian in the x direction
  • sigma_y: the sigma of the gaussian in the y direction
Returns

the image with the particles rendered on it

Original implementation: https://github.com/HenriquesLab/NanoJ-Core/blob/80020c9cf5ecac70019daa5731d0c296cb306ac4/Core/src/nanoj/core/java/image/rendering/SubPixelGaussianRendering.java#L12

def render_erf_gaussian(image, xp, yp, amplitude, sigma_x, sigma_y):

Render a gaussian particle on an image using the error function (erf) to calculate the integral of the gaussian

Parameters
  • image: the image to render the particles on
  • xp: the x position of the center of the gaussian
  • yp: the y position of the center of the gaussian
  • amplitude: the intensity of each particle
  • sigma_x: the sigma of the gaussian in the x direction
  • sigma_y: the sigma of the gaussian in the y direction