pysted.exp_data_gen

Functions

degrees_to_radians(angle_deg)

rotate_nds(nd_coords, rot_angle[, frame_shape])

rotates the nanodomain coords :param nd_coords: list or np.array of the nanodomain coords in the unrotated frame :param rot_angle: rotation angle in degrees :param frame_shape: shape of the image in which the NDs reside.

Classes

Beads(n_molecs, n_beads[, ...])

Nanodomain(img_shape[, valid_positions])

Nanodomain class

Synapse(n_molecs[, datamap_pixelsize_nm, ...])

Synapse class Implemented with the intent of using a datamap_pixelsize of 20nm, to generate synapses with width of 500nm and height of 200nm inside a 64px by 64px datamap (1080nm x 1080nm). The synapse will have nanodomains along its upper edge :param n_molecs: The number of molecules that will be placed in every pixel of the synapse :param datamap_pixelsize_nm: The pixelsize (in nm) of the datamap :param width_nm: Interval for the desired width (in nm) of the synapse. The width will be sampled from this interval :param height_nm: Interval for the desired height (in nm) of the synapse. The height will be sampled from this interval :param img_shape: The shape of the image (tuple) :param dendrite_thickness: Interval for the desired thickness of the dendrite (in pixels) to which the synapse is connected. The height will be sampled from this interval. Basically, this just determines how much of the dendrite we see in the ROI, drawn as a line on the bottom of the image. :param mode: The mode used for the random synapse generation. 'mushroom' will produce a mushroom-like synapse (i.e., an ellipse connected to the dendrite by a recangular-ish neck). 'bump' will produce a bump-like synapse (i.e., a have ellipse protruding from the dendrite). 'rand' will randomly select one of these 2 modes. :param seed: Sets the seed for the randomness.

class pysted.exp_data_gen.Nanodomain(img_shape, valid_positions=None)

Nanodomain class

Parameters:
  • img_shape – The shape of the image in which the nanodomains will be placed

  • valid_positions – A list of the valid positions from which to randomly sample a nanodomain position.

add_flash_curve(events_curves_path, seed=None)

Adds a list of molecule values for a certain number of frames

class pysted.exp_data_gen.Synapse(n_molecs, datamap_pixelsize_nm=20, width_nm=(400, 800), height_nm=(300, 600), img_shape=(64, 64), dendrite_thickness=(1, 10), mode='rand', seed=None)

Synapse class Implemented with the intent of using a datamap_pixelsize of 20nm, to generate synapses with width of 500nm and height of 200nm inside a 64px by 64px datamap (1080nm x 1080nm). The synapse will have nanodomains along its upper edge :param n_molecs: The number of molecules that will be placed in every pixel of the synapse :param datamap_pixelsize_nm: The pixelsize (in nm) of the datamap :param width_nm: Interval for the desired width (in nm) of the synapse. The width will be sampled from this interval :param height_nm: Interval for the desired height (in nm) of the synapse. The height will be sampled from this

interval

Parameters:
  • img_shape – The shape of the image (tuple)

  • dendrite_thickness – Interval for the desired thickness of the dendrite (in pixels) to which the synapse is connected. The height will be sampled from this interval. Basically, this just determines how much of the dendrite we see in the ROI, drawn as a line on the bottom of the image.

  • mode – The mode used for the random synapse generation. ‘mushroom’ will produce a mushroom-like synapse (i.e., an ellipse connected to the dendrite by a recangular-ish neck). ‘bump’ will produce a bump-like synapse (i.e., a have ellipse protruding from the dendrite). ‘rand’ will randomly select one of these 2 modes.

  • seed – Sets the seed for the randomness

add_nanodomains(n_nanodmains, min_dist_nm=200, n_molecs_in_domain=5, seed=None, valid_thickness=0)

Adds nanodomains on the periphery of the synapse. :param n_nanodmains: The number of nanodomains that will be attempted to be added. If n_nanodomains is too

high and the min_dist_nm is too high, it may not be able to place all the nanodomains, in which case a warning will be raised to tell the user not all nanodomains have been placed

Parameters:
  • min_dist_nm – The minimum distance (in nm) separating the nanodomains.

  • n_molecs_in_domain – The number of molecules to be added at the nanodomain positions

  • seed – Sets the seed for the random placement of nanodomains

  • valid_thickness – The thickness of the valid region for the nanodomains. This value is 0 by default, meaning the nanodomains will only be placed on the upper perimeter of the synapse

fatten_nanodomains()

Fattens the nanodomains by 1 pixel on each side (if the side is within the synapse)

filter_valid_nanodomain_pos(thickness=0)

Returns a list of the valid nanodomain positions. The valid positions are on the upper half of the perimeter of the synapse :param thickness: The thickness of the valid region for the nanodomains. This value is 0 by default, meaning the

nanodomains will only be placed on the upper perimeter of the synapse

Returns:

list of the valid positions for the nanodomains.

flash_nanodomains(current_time, time_quantum_us, delay=0, fwhm_step_usec_correspondance=(10, 1500000))

Verifies if the nanodomains need to be updated for the flash, updates them if it is the case

pysted.exp_data_gen.rotate_nds(nd_coords, rot_angle, frame_shape=(64, 64))

rotates the nanodomain coords :param nd_coords: list or np.array of the nanodomain coords in the unrotated frame :param rot_angle: rotation angle in degrees :param frame_shape: shape of the image in which the NDs reside. Should be (64, 64) in most cases