organoid_tracker.position_analysis.intensity_calculator module

Contains a lot of functions related to measuring intensity, averaged intensity and intensity derivatives.

class organoid_tracker.position_analysis.intensity_calculator.IntensityOverTime(times_h: List[float], intensities: List[float])

Bases: object

Represents an intensity over time. The object holds the raw values, and statistics are calculated dynamically.

get_production(degradation_rate_h: float) float
Calculates the production using a simple production-degradation model

f

∅ ⇄ G

b

property mean: float
property mean_stderr: float
multiply(factor: float)

Multiplies all intensities with a factor.

property slope: float
property slope_stderr: float
organoid_tracker.position_analysis.intensity_calculator.get_intensity_keys(experiment: Experiment) List[str]

Gets the keys of all stored intensities.

Any key (for example “intensity”) that is numeric and also has a “_volume” counterpart (like “intensity_volume”) is seen as being an intensity.

organoid_tracker.position_analysis.intensity_calculator.get_normalized_intensity(experiment: Experiment, position: Position, *, intensity_key: str = 'intensity', per_pixel: bool = False) Optional[float]

Gets the normalized intensity of the position. Takes into account the background and the intensity multiplier (for normalization), which might be specific to the time point or Z layer. Either returns the intensity sum or the intensity per pixel, depending on the per_pixel parameter (default false).

organoid_tracker.position_analysis.intensity_calculator.get_normalized_intensity_over_time(experiment: Experiment, around_position: Position, time_window_h: float, *, allow_incomplete: bool = False, intensity_key: str = 'intensity', per_pixel: bool = False) Optional[IntensityOverTime]

Gets the slope and mean intensity over time given time span. Returns None if not enough data is available, which is the case if the track is too short or if some intensities are missing.

organoid_tracker.position_analysis.intensity_calculator.get_raw_intensity(position_data: PositionData, position: Position, *, intensity_key: str = 'intensity') Optional[float]

Gets the raw intensity of the position.

organoid_tracker.position_analysis.intensity_calculator.perform_intensity_normalization(experiment: Experiment, *, background_correction: bool = True, z_correction: bool = False, time_correction: bool = False, intensity_key: str = 'intensity')

Gets the average intensity of all positions in the experiment. Returns None if there are no intensity recorded.

organoid_tracker.position_analysis.intensity_calculator.remove_intensities(experiment: Experiment, *, intensity_key: str = 'intensity')

Deletes the intensities with the given key.

organoid_tracker.position_analysis.intensity_calculator.remove_intensity_normalization(experiment: Experiment, *, intensity_key: str = 'intensity')

Removes the normalization set by perform_intensity_normalization.

organoid_tracker.position_analysis.intensity_calculator.set_raw_intensities(experiment: Experiment, raw_intensities: Dict[Position, float], volumes: Dict[Position, int], *, intensity_key: str = 'intensity')

Registers the given intensities for the given positions. Both dicts must have the same keys.

Will overwrite any previous intensities saved under the given key.

Will also add this intensity to the intensity_keys of the experiment.

Also removes any previously set intensity normalization for that key.