8#ifndef IMPBFF_DECAYCURVE_H
9#define IMPBFF_DECAYCURVE_H
10#include <IMP/bff/bff_config.h>
19#include <IMP/bff/internal/MovingAverage.h>
20#include <IMP/bff/internal/json.h>
21#include <IMP/bff/DecayRoutines.h>
49 double current_shift = 0.0;
50 double acquisition_time = std::numeric_limits<double>::max();
51 std::vector<double> dx = {1.0};
52 std::vector<double> x = std::vector<double>();
53 std::vector<double> _y;
54 std::vector<double> y = std::vector<double>();
55 std::vector<double> ey = std::vector<double>();
79 double *input,
int n_input,
120 void resize(
size_t n,
double v=0.0,
double dx=1.0);
140 void set_x(
const std::vector<double>& v);
147 void set_x(
double* input,
int n_input);
166 void set_y(
double* input,
int n_input);
225 std::vector<double> x = std::vector<double>(),
226 std::vector<double> y = std::vector<double>(),
227 std::vector<double> ey = std::vector<double>(),
228 double acquisition_time = std::numeric_limits<double>::max(),
239 double sum(
int start=0,
int stop=-1);
NoiseModelTypes
Definition DecayCurve.h:25
@ NOISE_POISSON
Definition DecayCurve.h:27
@ NOISE_NA
Definition DecayCurve.h:26
Definition DecayConvolution.h:31
Class for fluorescence decay curves.
Definition DecayCurve.h:38
DecayCurve & operator+=(double v)
Adds a value to the decay curve.
std::vector< double > & get_y()
Returns the y values of the decay curve.
double sum(int start=0, int stop=-1)
Calculates the sum of y values within a given range.
void set_shift(double v)
Sets the time shift of the decay curve.
DecayCurve(std::vector< double > x=std::vector< double >(), std::vector< double > y=std::vector< double >(), std::vector< double > ey=std::vector< double >(), double acquisition_time=std::numeric_limits< double >::max(), int noise_model=NOISE_POISSON, int size=-1)
void set_acquisition_time(double v)
Sets the acquisition time of the decay curve.
void set_y(double *input, int n_input)
Sets the y values of the decay curve.
double get_acquisition_time() const
Returns the acquisition time of the decay curve.
DecayCurve & operator/=(double v)
Divides the decay curve by a value.
DecayCurve & operator*(const DecayCurve &other) const
Overloads the '*' operator to multiply two DecayCurve objects.
DecayCurve & operator/(double v) const
Overloads the division operator to divide the decay curve by a constant value.
DecayCurve & operator=(const DecayCurve &other)
Assignment operator.
void set_y(std::vector< double > &v)
Sets the y values of the decay curve.
std::vector< double > & get_x()
Get the x-values of the curve.
DecayCurve & operator+(double v) const
Overloads the addition operator to add a constant value to the decay curve.
static std::vector< double > shift_array(double *input, int n_input, double shift)
Shift an array by a given value.
double get_average_dx()
Get the average x-value difference.
DecayCurve & operator*=(double v)
Multiplies the decay curve by a value.
void set_ey(std::vector< double > &v)
Sets the error values of the decay curve.
void set_ey(double *input, int n_input)
Sets the error values of the decay curve.
DecayCurve & operator<<(double v)
Shifts the curve by a float value.
std::vector< double > & get_ey()
Returns the error values of the decay curve.
DecayCurve & operator-(double v) const
Overloads the subtraction operator to subtract a constant value from the decay curve.
DecayCurve & operator-(const DecayCurve &other) const
Overloads the '-' operator to subtract two DecayCurve objects.
bool empty()
Check if the curve is empty.
void apply_simple_moving_average(int start, int stop, int n_window=5, bool normalize=false)
Applies a simple moving average (SMA) filter to the data.
void set_x(const std::vector< double > &v)
DecayCurve & operator/(const DecayCurve &other) const
Overloads the '/' operator to divide two DecayCurve objects.
std::string get_json() const
Returns the JSON representation of the decay curve.
double get_shift()
Returns the time shift of the decay curve.
DecayCurve & operator*(double v) const
Overloads the multiplication operator to multiply the decay curve by a constant value.
DecayCurve & operator+(const DecayCurve &other) const
Overloads the '+' operator to add two DecayCurve objects.
std::vector< double > get_dx()
Get the x-value differences.
DecayCurve & operator-=(double v)
Subtracts a value from the decay curve.
void set_x(double *input, int n_input)
Sets the x values of the decay curve.
int read_json(std::string json_string)
Reads the decay curve from a JSON string.
size_t size() const
Get the size of the curve.
void resize(size_t n, double v=0.0, double dx=1.0)
Resize the curve.
A decay modifier to apply linearization to a DecayCurve.
Definition DecayLinearization.h:38
The DecayPattern class represents a decay pattern with a constant offset and a background pattern.
Definition DecayPattern.h:26
A decorator that adds pile-up effects to a DecayCurve object.
Definition DecayPileup.h:33
A class for scaling a DecayCurve by a constant factor and subtracting a constant background value.
Definition DecayScale.h:34
Class for scoring model fluorescence decay.
Definition DecayScore.h:34