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>
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 |
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.
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 36 of file sampled_multispot.h.
00066 { 00067 return i; 00068 } 00069 00070 inline double intensity(const pair<double, Vector<4> >& i) 00071 { 00072 return i.first; 00073 } 00074 00075 00076 //Add and remove a spot over the entire region 00077 template<class T> 00078 void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample) 00079 { 00080 for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++) 00081 if(spot_sample[frame] == 0) //Spot is on, so remove it 00082 for(unsigned int p=0; p < spot_intensities.size(); p++) 00083 current_sample_intensities[frame][p] -= intensity(spot_intensities[p]); 00084 } 00085 00086 template<class T> 00087 void add_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample) 00088 { 00089 for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++) 00090 if(spot_sample[frame] == 0) //Spot is on, so add it 00091 for(unsigned int p=0; p < spot_intensities.size(); p++) 00092 current_sample_intensities[frame][p] += intensity(spot_intensities[p]); 00093 } 00094 00095 00096 //Add and remove a spot only over a mask. 00097 template<class T> 00098 void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample, const vector<int>& mask) 00099 { 00100 for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++) 00101 if(spot_sample[frame] == 0) //Spot is on, so remove it 00102 for(unsigned int p=0; p < mask.size(); p++) 00103 current_sample_intensities[frame][mask[p]] -= intensity(spot_intensities[mask[p]]); 00104 } 00105 00106 template<class T> 00107 void add_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample, const vector<int>& mask) 00108 { 00109 for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++) 00110 if(spot_sample[frame] == 0) //Spot is on, so add it 00111 for(unsigned int p=0; p < mask.size(); p++) 00112 current_sample_intensities[frame][mask[p]] += intensity(spot_intensities[mask[p]]); 00113 } 00114 00115 00116 //Add and remove a drifty spot only over a mask. 00117 template<class T> 00118 void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<vector<T> > & spot_intensities, const vector<State>& spot_sample, const vector<int>& mask) 00119 { 00120 const int steps = spot_intensities.size(); 00121 const int frames = current_sample_intensities.size(); 00122 00123 for(int frame=0; frame < frames; frame++) 00124 { 00125 int s = frame * steps / frames; 00126 00127 if(spot_sample[frame] == 0) //Spot is on, so remove it 00128 for(unsigned int p=0; p < mask.size(); p++) 00129 current_sample_intensities[frame][mask[p]] -= intensity(spot_intensities[s][mask[p]]);
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 36 of file sampled_multispot.h.
00066 { 00067 return i; 00068 } 00069 00070 inline double intensity(const pair<double, Vector<4> >& i) 00071 { 00072 return i.first; 00073 } 00074 00075 00076 //Add and remove a spot over the entire region 00077 template<class T> 00078 void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample) 00079 { 00080 for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++) 00081 if(spot_sample[frame] == 0) //Spot is on, so remove it 00082 for(unsigned int p=0; p < spot_intensities.size(); p++) 00083 current_sample_intensities[frame][p] -= intensity(spot_intensities[p]); 00084 } 00085 00086 template<class T> 00087 void add_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample) 00088 { 00089 for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++) 00090 if(spot_sample[frame] == 0) //Spot is on, so add it 00091 for(unsigned int p=0; p < spot_intensities.size(); p++) 00092 current_sample_intensities[frame][p] += intensity(spot_intensities[p]); 00093 } 00094 00095 00096 //Add and remove a spot only over a mask. 00097 template<class T> 00098 void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample, const vector<int>& mask) 00099 { 00100 for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++) 00101 if(spot_sample[frame] == 0) //Spot is on, so remove it 00102 for(unsigned int p=0; p < mask.size(); p++) 00103 current_sample_intensities[frame][mask[p]] -= intensity(spot_intensities[mask[p]]); 00104 } 00105 00106 template<class T> 00107 void add_spot(vector<vector<double> >& current_sample_intensities, const vector<T>& spot_intensities, const vector<State>& spot_sample, const vector<int>& mask) 00108 { 00109 for(unsigned int frame=0; frame < current_sample_intensities.size(); frame++) 00110 if(spot_sample[frame] == 0) //Spot is on, so add it 00111 for(unsigned int p=0; p < mask.size(); p++) 00112 current_sample_intensities[frame][mask[p]] += intensity(spot_intensities[mask[p]]); 00113 } 00114 00115 00116 //Add and remove a drifty spot only over a mask. 00117 template<class T> 00118 void remove_spot(vector<vector<double> >& current_sample_intensities, const vector<vector<T> > & spot_intensities, const vector<State>& spot_sample, const vector<int>& mask) 00119 { 00120 const int steps = spot_intensities.size(); 00121 const int frames = current_sample_intensities.size(); 00122 00123 for(int frame=0; frame < frames; frame++) 00124 { 00125 int s = frame * steps / frames; 00126 00127 if(spot_sample[frame] == 0) //Spot is on, so remove it 00128 for(unsigned int p=0; p < mask.size(); p++) 00129 current_sample_intensities[frame][mask[p]] -= intensity(spot_intensities[s][mask[p]]);
double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | double | d | ) | [inline] |
Definition at line 9 of file sampled_multispot.h.
Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | double | ) | [inline] |
Definition at line 10 of file sampled_multispot.h.
Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | double | ) | [inline] |
Definition at line 11 of file sampled_multispot.h.
double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | const pair< double, Vector< 4 > > & | d | ) | [inline] |
Definition at line 13 of file sampled_multispot.h.
Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | const pair< double, Vector< 4 > > & | d | ) | [inline] |
Definition at line 14 of file sampled_multispot.h.
Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | const pair< double, Vector< 4 > > & | ) | [inline] |
Definition at line 15 of file sampled_multispot.h.
double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | [inline] |
Definition at line 17 of file sampled_multispot.h.
Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | [inline] |
Definition at line 18 of file sampled_multispot.h.
Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | [inline] |
Definition at line 19 of file sampled_multispot.h.
bool SampledMultispot::SpotWithBackgroundMasked::type_has_hess | ( | const C & | ) | [inline] |
Definition at line 21 of file sampled_multispot.h.
bool SampledMultispot::SpotWithBackgroundMasked::type_has_hess | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | ) | [inline] |
Definition at line 22 of file sampled_multispot.h.
bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const C & | ) | [inline] |
Definition at line 24 of file sampled_multispot.h.
bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const pair< double, Vector< 4 > > & | ) | [inline] |
Definition at line 25 of file sampled_multispot.h.
bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | ) | [inline] |
Definition at line 26 of file sampled_multispot.h.
double SampledMultispot::SpotWithBackgroundMasked::log | ( | int | state, | |
int | obs | |||
) | const [inline] |
Definition at line 131 of file sampled_multispot.h.
00135 { 00136 const int steps = spot_intensities.size(); 00137 const int frames = current_sample_intensities.size(); 00138 00139 for(int frame=0; frame < frames; frame++) 00140 {
Vector<4> SampledMultispot::SpotWithBackgroundMasked::diff_log | ( | int | state, | |
int | obs | |||
) | const [inline] |
Definition at line 142 of file sampled_multispot.h.
Matrix<4> SampledMultispot::SpotWithBackgroundMasked::hess_log | ( | int | state, | |
int | obs | |||
) | const [inline] |
Definition at line 153 of file sampled_multispot.h.
00153 { 00154 vector<double> intensities(pixels.size()); 00155 00156 for(unsigned int i=0; i < pixels.size(); i++) 00157 intensities[i] = spot_shape(vec(pixels[i]), params); 00158 00159 return intensities; 00160 } 00161 00162 //Compute the spot intensity derivatives for a given spot at each pixel
double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | double | d | ) | [inline] |
Definition at line 9 of file sampled_multispot.h.
Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | double | ) | [inline] |
Definition at line 10 of file sampled_multispot.h.
Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | double | ) | [inline] |
Definition at line 11 of file sampled_multispot.h.
double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | const pair< double, Vector< 4 > > & | d | ) | [inline] |
Definition at line 13 of file sampled_multispot.h.
Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | const pair< double, Vector< 4 > > & | d | ) | [inline] |
Definition at line 14 of file sampled_multispot.h.
Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | const pair< double, Vector< 4 > > & | ) | [inline] |
Definition at line 15 of file sampled_multispot.h.
double SampledMultispot::SpotWithBackgroundMasked::get_val | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | [inline] |
Definition at line 17 of file sampled_multispot.h.
Vector<4> SampledMultispot::SpotWithBackgroundMasked::get_diff | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | [inline] |
Definition at line 18 of file sampled_multispot.h.
Matrix<4> SampledMultispot::SpotWithBackgroundMasked::get_hess | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | d | ) | [inline] |
Definition at line 19 of file sampled_multispot.h.
bool SampledMultispot::SpotWithBackgroundMasked::type_has_hess | ( | const C & | ) | [inline] |
Definition at line 21 of file sampled_multispot.h.
bool SampledMultispot::SpotWithBackgroundMasked::type_has_hess | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | ) | [inline] |
Definition at line 22 of file sampled_multispot.h.
bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const C & | ) | [inline] |
Definition at line 24 of file sampled_multispot.h.
bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const pair< double, Vector< 4 > > & | ) | [inline] |
Definition at line 25 of file sampled_multispot.h.
bool SampledMultispot::SpotWithBackgroundMasked::type_has_diff | ( | const tuple< double, Vector< 4 >, Matrix< 4 > > & | ) | [inline] |
Definition at line 26 of file sampled_multispot.h.
double SampledMultispot::SpotWithBackgroundMasked::log | ( | int | state, | |
int | obs | |||
) | const [inline] |
Definition at line 131 of file sampled_multispot.h.
00135 { 00136 const int steps = spot_intensities.size(); 00137 const int frames = current_sample_intensities.size(); 00138 00139 for(int frame=0; frame < frames; frame++) 00140 {
Vector<4> SampledMultispot::SpotWithBackgroundMasked::diff_log | ( | int | state, | |
int | obs | |||
) | const [inline] |
Definition at line 142 of file sampled_multispot.h.
Matrix<4> SampledMultispot::SpotWithBackgroundMasked::hess_log | ( | int | state, | |
int | obs | |||
) | const [inline] |
Definition at line 153 of file sampled_multispot.h.
References spot_shape().
00153 { 00154 vector<double> intensities(pixels.size()); 00155 00156 for(unsigned int i=0; i < pixels.size(); i++) 00157 intensities[i] = spot_shape(vec(pixels[i]), params); 00158 00159 return intensities; 00160 } 00161 00162 //Compute the spot intensity derivatives for a given spot at each pixel
static const int SampledMultispot::SpotWithBackgroundMasked::NumParameters = 4 [static] |
Definition at line 3 of file sampled_multispot.h.
vector< pair< double, double > > SampledMultispot::SpotWithBackgroundMasked::log_prob |
Definition at line 5 of file sampled_multispot.h.
vector< Vector< 4 > > SampledMultispot::SpotWithBackgroundMasked::diff_log_prob |
Definition at line 6 of file sampled_multispot.h.
vector< Matrix< 4 > > SampledMultispot::SpotWithBackgroundMasked::hess_log_prob |
Definition at line 7 of file sampled_multispot.h.