ThreeB 1.1

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Static Public Attributes
SampledMultispot::SpotWithBackgroundMasked Struct Reference

This class compute the log-diff-hess probability of a spot, given an image patch and background due to existing spots. More...

`#include <sampled_multispot.h>`

List of all members.

## Public Member Functions
double | get_val (double d)
Vector< 4 > | get_diff (double)
Matrix< 4 > | get_hess (double)
double | get_val (const pair< double, Vector< 4 > > &d)
Vector< 4 > | get_diff (const pair< double, Vector< 4 > > &d)
Matrix< 4 > | get_hess (const pair< double, Vector< 4 > > &)
double | get_val (const tuple< double, Vector< 4 >, Matrix< 4 > > &d)
Vector< 4 > | get_diff (const tuple< double, Vector< 4 >, Matrix< 4 > > &d)
Matrix< 4 > | get_hess (const tuple< double, Vector< 4 >, Matrix< 4 > > &d)
template<class C >
bool | type_has_hess (const C &)
bool | type_has_hess (const tuple< double, Vector< 4 >, Matrix< 4 > > &)
template<class C >
bool | type_has_diff (const C &)
bool | type_has_diff (const pair< double, Vector< 4 > > &)
bool | type_has_diff (const tuple< double, Vector< 4 >, Matrix< 4 > > &)
template<class Input >
| SpotWithBackgroundMasked (const vector< vector< double > > &sample_intensities, const SWBG_SPOT_INTENSITIES &spot_intensities, const vector< vector< double > > &pixel_intensities, const double variance, const vector< int > &mask)
double | log (int state, int obs) const
Vector< 4 > | diff_log (int state, int obs) const
Matrix< 4 > | hess_log (int state, int obs) const
double | get_val (double d)
Vector< 4 > | get_diff (double)
Matrix< 4 > | get_hess (double)
double | get_val (const pair< double, Vector< 4 > > &d)
Vector< 4 > | get_diff (const pair< double, Vector< 4 > > &d)
Matrix< 4 > | get_hess (const pair< double, Vector< 4 > > &)
double | get_val (const tuple< double, Vector< 4 >, Matrix< 4 > > &d)
Vector< 4 > | get_diff (const tuple< double, Vector< 4 >, Matrix< 4 > > &d)
Matrix< 4 > | get_hess (const tuple< double, Vector< 4 >, Matrix< 4 > > &d)
template<class C >
bool | type_has_hess (const C &)
bool | type_has_hess (const tuple< double, Vector< 4 >, Matrix< 4 > > &)
template<class C >
bool | type_has_diff (const C &)
bool | type_has_diff (const pair< double, Vector< 4 > > &)
bool | type_has_diff (const tuple< double, Vector< 4 >, Matrix< 4 > > &)
template<class Input >
| SpotWithBackgroundMasked (const vector< vector< double > > &sample_intensities, const SWBG_SPOT_INTENSITIES &spot_intensities, const vector< vector< double > > &pixel_intensities, const double variance, const vector< int > &mask)
double | log (int state, int obs) const
Vector< 4 > | diff_log (int state, int obs) const
Matrix< 4 > | hess_log (int state, int obs) const
## Public Attributes
vector< pair< double, double > > | log_prob
vector< Vector< 4 > > | diff_log_prob
vector< Matrix< 4 > > | hess_log_prob
## Static Public Attributes
static const int | NumParameters = 4

## Detailed Description

This class compute the log-diff-hess probability of a spot, given an image patch and background due to existing spots.

Definition at line 24 of file sampled_multispot.h.

## Constructor & Destructor Documentation

template<class Input >

SampledMultispot::SpotWithBackgroundMasked::SpotWithBackgroundMasked | ( | const vector< vector< double > > & | sample_intensities,
|  | const SWBG_SPOT_INTENSITIES & | spot_intensities,
|  | const vector< vector< double > > & | pixel_intensities,
|  | const double | variance,
|  | const vector< int > & | mask
| ) |  | `[inline]`

Definition at line 59 of file sampled_multispot.h.

    {
        return i;
    }

    inline double intensity(const pair<double, Vector<4> >& i)
    {
        return i.first;
    }

    //Add and remove a spot over the entire region
    template<class T>
    void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample)
    {
        for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++)
            if(spot_sample[frame] == 0) //Spot is on, so remove it
                for(unsigned int p=0; p < spot_intensities.size(); p++)
                    current_sample_intensities[frame][p] -= intensity(spot_intensities[p]);
    }

    template<class T>
    void add_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample)
    {
        for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++)
            if(spot_sample[frame] == 0) //Spot is on, so add it
                for(unsigned int p=0; p < spot_intensities.size(); p++)
                    current_sample_intensities[frame][p] += intensity(spot_intensities[p]);
    }

    //Add and remove a spot only over a mask.
    template<class T>
    void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample, const vector<int>& mask)
    {
        for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++)
            if(spot_sample[frame] == 0) //Spot is on, so remove it
                for(unsigned int p=0; p < mask.size(); p++)
                    current_sample_intensities[frame][mask[p]] -= intensity(spot_intensities[mask[p]]);
    }

    template<class T>
    void add_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample, const vector<int>& mask)
    {
        for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++)
            if(spot_sample[frame] == 0) //Spot is on, so add it
                for(unsigned int p=0; p < mask.size(); p++)
                    current_sample_intensities[frame][mask[p]] += intensity(spot_intensities[mask[p]]);
    }

    //Add and remove a drifty spot only over a mask.
    template<class T>
    void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<vector<T> > & spot_intensities, const vector<State>& spot_sample, const vector<int>& mask)
    {
        const int steps = spot_intensities.size();
        const int frames = current_sample_intensities.size();

        for(int frame=0; frame < frames; frame++)
        {
            int s = frame * steps / frames;

            if(spot_sample[frame] == 0) //Spot is on, so remove it
                for(unsigned int p=0; p < mask.size(); p++)
                    current_sample_intensities[frame][mask[p]] -= intensity(spot_intensities[s][mask[p]]);
        }
    }

    template<class T>
    void add_spot(vector<vector<double> >& current_sample_intensities, const vector<vector<T> >& spot_intensities, const vector<State>& spot_sample, const vector<int>& mask)
    {
        const int steps = spot_intensities.size();
        const int frames = current_sample_intensities.size();

        for(int frame=0; frame < frames; frame++)
        {
            int s = frame * steps / frames;

            if(spot_sample[frame] == 0) //Spot is on, so add it
                for(unsigned int p=0; p < mask.size(); p++)
                    current_sample_intensities[frame][mask[p]] += intensity(spot_intensities[s][mask[p]]);
        }
    }

    //Compute the spot intensity for a given spot at each pixel
    inline vector<double> compute_spot_intensity(const vector<ImageRef>& pixels, const Vector<4>& params)

template<class Input >

SampledMultispot::SpotWithBackgroundMasked::SpotWithBackgroundMasked | ( | const vector< vector< double > > & | sample_intensities,
|  | const SWBG_SPOT_INTENSITIES & | spot_intensities,
|  | const vector< vector< double > > & | pixel_intensities,
|  | const double | variance,
|  | const vector< int > & | mask
| ) |  | `[inline]`

Definition at line 59 of file sampled_multispot.h.

    {
        return i;
    }

    inline double intensity(const pair<double, Vector<4> >& i)
    {
        return i.first;
    }

    //Add and remove a spot over the entire region
    template<class T>
    void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample)
    {
        for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++)
            if(spot_sample[frame] == 0) //Spot is on, so remove it
                for(unsigned int p=0; p < spot_intensities.size(); p++)
                    current_sample_intensities[frame][p] -= intensity(spot_intensities[p]);
    }

    template<class T>
    void add_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample)
    {
        for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++)
            if(spot_sample[frame] == 0) //Spot is on, so add it
                for(unsigned int p=0; p < spot_intensities.size(); p++)
                    current_sample_intensities[frame][p] += intensity(spot_intensities[p]);
    }

    //Add and remove a spot only over a mask.
    template<class T>
    void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample, const vector<int>& mask)
    {
        for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++)
            if(spot_sample[frame] == 0) //Spot is on, so remove it
                for(unsigned int p=0; p < mask.size(); p++)
                    current_sample_intensities[frame][mask[p]] -= intensity(spot_intensities[mask[p]]);
    }

    template<class T>
    void add_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample, const vector<int>& mask)
    {
        for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++)
            if(spot_sample[frame] == 0) //Spot is on, so add it
                for(unsigned int p=0; p < mask.size(); p++)
                    current_sample_intensities[frame][mask[p]] += intensity(spot_intensities[mask[p]]);
    }

    //Add and remove a drifty spot only over a mask.
    template<class T>
    void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<vector<T> > & spot_intensities, const vector<State>& spot_sample, const vector<int>& mask)
    {
        const int steps = spot_intensities.size();
        const int frames = current_sample_intensities.size();

        for(int frame=0; frame < frames; frame++)
        {
            int s = frame * steps / frames;

            if(spot_sample[frame] == 0) //Spot is on, so remove it
                for(unsigned int p=0; p < mask.size(); p++)
                    current_sample_intensities[frame][mask[p]] -= intensity(spot_intensities[s][mask[p]]);
        }
    }

    template<class T>
    void add_spot(vector<vector<double> >& current_sample_intensities, const vector<vector<T> >& spot_intensities, const vector<State>& spot_sample, const vector<int>& mask)
    {
        const int steps = spot_intensities.size();
        const int frames = current_sample_intensities.size();

        for(int frame=0; frame < frames; frame++)
        {
            int s = frame * steps / frames;

            if(spot_sample[frame] == 0) //Spot is on, so add it
                for(unsigned int p=0; p < mask.size(); p++)
                    current_sample_intensities[frame][mask[p]] += intensity(spot_intensities[s][mask[p]]);
        }
    }

    //Compute the spot intensity for a given spot at each pixel
    inline vector<double> compute_spot_intensity(const vector<ImageRef>& pixels, const Vector<4>& params)

## Member Function Documentation

double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | double | d | ) | `[inline]`

Definition at line 32 of file sampled_multispot.h.

    {

Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | double |  | ) | `[inline]`

Definition at line 33 of file sampled_multispot.h.

    {

Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | double |  | ) | `[inline]`

Definition at line 34 of file sampled_multispot.h.

double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | const pair< double, Vector< 4 > > & | d | ) | `[inline]`

Definition at line 36 of file sampled_multispot.h.

Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | const pair< double, Vector< 4 > > & | d | ) | `[inline]`

Definition at line 37 of file sampled_multispot.h.

Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | const pair< double, Vector< 4 > > & |  | ) | `[inline]`

Definition at line 38 of file sampled_multispot.h.

    {

double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | `[inline]`

Definition at line 40 of file sampled_multispot.h.

    {

Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | `[inline]`

Definition at line 41 of file sampled_multispot.h.

    {

Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | `[inline]`

Definition at line 42 of file sampled_multispot.h.

    {

template<class C >

bool SampledMultispot::SpotWithBackgroundMasked::type_has_hess | ( | const C & |  | ) | `[inline]`

Definition at line 44 of file sampled_multispot.h.

    {

bool SampledMultispot::SpotWithBackgroundMasked::type_has_hess | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & |  | ) | `[inline]`

Definition at line 45 of file sampled_multispot.h.

    {

template<class C >

bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const C & |  | ) | `[inline]`

Definition at line 47 of file sampled_multispot.h.

    {

bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const pair< double, Vector< 4 > > & |  | ) | `[inline]`

Definition at line 48 of file sampled_multispot.h.

    {

bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & |  | ) | `[inline]`

Definition at line 49 of file sampled_multispot.h.

    {

double SampledMultispot::SpotWithBackgroundMasked::log | ( | int | state,
|  | int | obs
| ) |  | const`[inline]`

Definition at line 154 of file sampled_multispot.h.

    {

Vector<4> SampledMultispot::SpotWithBackgroundMasked::diff_log | ( | int | state,
|  | int | obs
| ) |  | const`[inline]`

Definition at line 165 of file sampled_multispot.h.

    {
        vector<tuple<double, Vector<4>, Matrix<4> > > hessian(pixels.size());

Matrix<4> SampledMultispot::SpotWithBackgroundMasked::hess_log | ( | int | state,
|  | int | obs
| ) |  | const`[inline]`

Definition at line 176 of file sampled_multispot.h.

    {

double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | double | d | ) | `[inline]`

Definition at line 32 of file sampled_multispot.h.

    {

Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | double |  | ) | `[inline]`

Definition at line 33 of file sampled_multispot.h.

    {

Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | double |  | ) | `[inline]`

Definition at line 34 of file sampled_multispot.h.

double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | const pair< double, Vector< 4 > > & | d | ) | `[inline]`

Definition at line 36 of file sampled_multispot.h.

Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | const pair< double, Vector< 4 > > & | d | ) | `[inline]`

Definition at line 37 of file sampled_multispot.h.

Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | const pair< double, Vector< 4 > > & |  | ) | `[inline]`

Definition at line 38 of file sampled_multispot.h.

    {

double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | `[inline]`

Definition at line 40 of file sampled_multispot.h.

    {

Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | `[inline]`

Definition at line 41 of file sampled_multispot.h.

    {

Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | `[inline]`

Definition at line 42 of file sampled_multispot.h.

    {

template<class C >

bool SampledMultispot::SpotWithBackgroundMasked::type_has_hess | ( | const C & |  | ) | `[inline]`

Definition at line 44 of file sampled_multispot.h.

    {

bool SampledMultispot::SpotWithBackgroundMasked::type_has_hess | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & |  | ) | `[inline]`

Definition at line 45 of file sampled_multispot.h.

    {

template<class C >

bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const C & |  | ) | `[inline]`

Definition at line 47 of file sampled_multispot.h.

    {

bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const pair< double, Vector< 4 > > & |  | ) | `[inline]`

Definition at line 48 of file sampled_multispot.h.

    {

bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & |  | ) | `[inline]`

Definition at line 49 of file sampled_multispot.h.

    {

double SampledMultispot::SpotWithBackgroundMasked::log | ( | int | state,
|  | int | obs
| ) |  | const`[inline]`

Definition at line 154 of file sampled_multispot.h.

    {

Vector<4> SampledMultispot::SpotWithBackgroundMasked::diff_log | ( | int | state,
|  | int | obs
| ) |  | const`[inline]`

Definition at line 165 of file sampled_multispot.h.

    {
        vector<tuple<double, Vector<4>, Matrix<4> > > hessian(pixels.size());

Matrix<4> SampledMultispot::SpotWithBackgroundMasked::hess_log | ( | int | state,
|  | int | obs
| ) |  | const`[inline]`

Definition at line 176 of file sampled_multispot.h.

    {

## Member Data Documentation

static const int SampledMultispot::SpotWithBackgroundMasked::NumParameters = 4`[static]`

Definition at line 26 of file sampled_multispot.h.

vector< pair< double, double > > SampledMultispot::SpotWithBackgroundMasked::log_prob

Definition at line 28 of file sampled_multispot.h.

vector< Vector< 4 > > SampledMultispot::SpotWithBackgroundMasked::diff_log_prob

Definition at line 29 of file sampled_multispot.h.

vector< Matrix< 4 > > SampledMultispot::SpotWithBackgroundMasked::hess_log_prob

Definition at line 30 of file sampled_multispot.h.

The documentation for this struct was generated from the following file: