Alternaria
fit cylinders and ellipsoids to fungus
|
Model of the point spread function. More...
#include <psf_model.h>
Public Member Functions | |
PSF_model (float alpha, float beta, float gamma, const PSF_padding *padding, const PSF_model_density *density, const Imaging_model *imaging) throw (jwscxx::base::Arg_error) | |
Constructs a new PSF_model. | |
PSF_model (const PSF_model &model) | |
Constructus a PSF_model by copying another. | |
PSF_model (const char *fname, const PSF_padding *padding, const PSF_model_density *density, const Imaging_model *imaging) throw (jwscxx::base::IO_error, jwscxx::base::Arg_error) | |
Constructs a PSF_model by reading values from a file. | |
virtual | ~PSF_model () |
Deletes this PSF_model. | |
PSF_model & | operator= (const PSF_model &psf) |
Copies a PSF into this PSF. | |
PSF_model * | clone () |
Clones this PSF_model. | |
float | get_alpha () const |
Returns the alpha of this PSF_model. | |
float | get_beta () const |
Returns the beta of this PSF_model. | |
float | get_gamma () const |
Returns the gamma of this PSF_model. | |
double | get_log_prob () const |
Returns the log probability of this PSF_model. | |
const PSF_model_density * | get_density () const |
Returns the density used by this model. | |
void | set (float alpha, float beta, float gamma, const Imaging_model *imaging) throw (jwscxx::base::Arg_error) |
Sets the alpha, beta, and gamma of this PSF_model. | |
void | set_alpha (float alpha, const Imaging_model *imaging) throw (jwscxx::base::Arg_error) |
Sets the alpha of this PSF_model. | |
void | set_beta (float beta, const Imaging_model *imaging) throw (jwscxx::base::Arg_error) |
Sets the beta of this PSF_model. | |
void | set_gamma (float gamma, const Imaging_model *imaging) throw (jwscxx::base::Arg_error) |
Sets the gamma of this PSF_model. | |
void | print (std::ostream &out=std::cout) const |
Prints this PSF_model to an output stream. | |
void | print (const char *fname) const throw (jwscxx::base::IO_error) |
Prints this PSF_model to a file. | |
void | update_h (const Imaging_model *imaging) |
Update this PSF_model::h. | |
Protected Member Functions | |
void | update_log_prob () |
Updates PSF_model::log_prob. | |
void | check_alpha () const throw (jwscxx::base::Arg_error) |
Checks the alpha of this PSF_model against its density range. | |
void | check_beta () const throw (jwscxx::base::Arg_error) |
Checks the beta of this PSF_model against its density range. | |
void | check_gamma () const throw (jwscxx::base::Arg_error) |
Checks the gamma of this PSF_model against its density range. | |
Protected Attributes | |
float | alpha |
Base in a geometric distribution used to weight each Gaussian in the model. | |
float | beta |
Scales the distance of each Gaussian from the x,y-plane for additive variance. | |
float | gamma |
Base std dev for each Gaussian. | |
double | log_prob |
Log probability of this PSF_model. | |
const PSF_model_density * | density |
Parameters for density functions over this PSF_model. |
Model of the point spread function.
The point spread function h(x,y,z) is defined as a sequence of weighted 2D Gaussians, each parallel to the imaging plane (x,y) and centered on the optical (z) axis.
Formally, the PSF h(x,y,z) is given by
scale = pow(alpha, abs(z); norm = sqrt(2*M_PI*(beta*abs(z) + sigma*sigma)); gauss = (x*x + y*y) / (2*(beta*abs(z) + sigma*sigma)); h(x,y,z) = (scale / norm) * exp(-gauss);
Notice that h(x,y,z) is symmetric about the x,y-plane and z-axis.
Definition at line 263 of file psf_model.h.
PSF_model::PSF_model | ( | float | alpha, |
float | beta, | ||
float | gamma, | ||
const PSF_padding * | padding, | ||
const PSF_model_density * | density, | ||
const Imaging_model * | imaging | ||
) | throw (jwscxx::base::Arg_error) |
Constructs a new PSF_model.
alpha | PSF_model::alpha. |
beta | PSF_model::beta. |
gamma | PSF_model::gamma. |
padding | PSF_padding to use. |
density | PSF_model_density parameters for probabilities. |
imaging | Imaging_model to use for updating the PSF_model::h. |
jwscxx::base::Arg_error | PSF_model values are not in the density parameter ranges. |
Definition at line 438 of file psf_model.cpp.
PSF_model::PSF_model | ( | const PSF_model & | model | ) |
Constructus a PSF_model by copying another.
model | Model to create this PSF_model from. |
Definition at line 464 of file psf_model.cpp.
PSF_model::PSF_model | ( | const char * | fname, |
const PSF_padding * | padding, | ||
const PSF_model_density * | density, | ||
const Imaging_model * | imaging | ||
) | throw (jwscxx::base::IO_error, jwscxx::base::Arg_error) |
Constructs a PSF_model by reading values from a file.
fname | Name of the file to read the PSF_model from. |
padding | PSF_padding to use. |
density | PSF_model_density parameters for probabilities. |
imaging | Imaging_model to use for updating the PSF_model::h. |
jwscxx::base::IO_error | Could not open fname or read from it. |
jwscxx::base::Arg_error | Improper file format or member value is not in the specified density parameter range. |
Definition at line 491 of file psf_model.cpp.
virtual PSF_model::~PSF_model | ( | ) | [inline, virtual] |
Deletes this PSF_model.
Definition at line 296 of file psf_model.h.
PSF_model * PSF_model::clone | ( | ) |
Clones this PSF_model.
Definition at line 588 of file psf_model.cpp.
float PSF_model::get_alpha | ( | ) | const [inline] |
Returns the alpha of this PSF_model.
Definition at line 308 of file psf_model.h.
float PSF_model::get_beta | ( | ) | const [inline] |
Returns the beta of this PSF_model.
Definition at line 312 of file psf_model.h.
float PSF_model::get_gamma | ( | ) | const [inline] |
Returns the gamma of this PSF_model.
Definition at line 316 of file psf_model.h.
double PSF_model::get_log_prob | ( | ) | const [inline] |
Returns the log probability of this PSF_model.
Definition at line 320 of file psf_model.h.
const PSF_model_density* PSF_model::get_density | ( | ) | const [inline] |
Returns the density used by this model.
Definition at line 324 of file psf_model.h.
void PSF_model::set | ( | float | alpha, |
float | beta, | ||
float | gamma, | ||
const Imaging_model * | imaging | ||
) | throw (jwscxx::base::Arg_error) |
Sets the alpha, beta, and gamma of this PSF_model.
alpha | New PSF_model::alpha. |
beta | New PSF_model::beta. |
gamma | New PSF_model::gamma. |
imaging | Imaging_model to use. |
jwscxx::base::Arg_error | The change would result in a PSF_model parameter that is not consistent with the parameter density functions. |
Definition at line 766 of file psf_model.cpp.
void PSF_model::set_alpha | ( | float | alpha, |
const Imaging_model * | imaging | ||
) | throw (jwscxx::base::Arg_error) |
Sets the alpha of this PSF_model.
alpha | New PSF_model::alpha. |
imaging | Imaging_model to use. |
jwscxx::base::Arg_error | The change would result in a PSF_model parameter that is not consistent with the parameter density functions. |
Definition at line 807 of file psf_model.cpp.
void PSF_model::set_beta | ( | float | beta, |
const Imaging_model * | imaging | ||
) | throw (jwscxx::base::Arg_error) |
Sets the beta of this PSF_model.
beta | New PSF_model::beta. |
imaging | Imaging_model to use. |
jwscxx::base::Arg_error | The change would result in a PSF_model parameter that is not consistent with the parameter density functions. |
Definition at line 836 of file psf_model.cpp.
void PSF_model::set_gamma | ( | float | gamma, |
const Imaging_model * | imaging | ||
) | throw (jwscxx::base::Arg_error) |
Sets the gamma of this PSF_model.
gamma | New PSF_model::gamma. |
imaging | Imaging_model to use. |
jwscxx::base::Arg_error | The change would result in a PSF_model parameter that is not consistent with the parameter density functions. |
Definition at line 865 of file psf_model.cpp.
void PSF_model::print | ( | std::ostream & | out = std::cout | ) | const [virtual] |
void PSF_model::print | ( | const char * | fname | ) | const throw (jwscxx::base::IO_error) |
Prints this PSF_model to a file.
The format is as follows
fname | Name of the file to print to. |
jwscxx::base::IO_error | Could not open fname to write to. |
Definition at line 900 of file psf_model.cpp.
void PSF_model::update_h | ( | const Imaging_model * | imaging | ) | [virtual] |
Update this PSF_model::h.
Since h(x,y,z) is symmetric about the x,y-plane and z-axis, the computation is done for only 1/8 of the psf and the other values are copied.
imaging | Imaging_model to use. |
Implements PSF.
Definition at line 622 of file psf_model.cpp.
void PSF_model::update_log_prob | ( | ) | [protected] |
Updates PSF_model::log_prob.
Updated from the Imaging_model members' densities.
Definition at line 946 of file psf_model.cpp.
void PSF_model::check_alpha | ( | ) | const throw (jwscxx::base::Arg_error) [protected] |
Checks the alpha of this PSF_model against its density range.
jwscxx::base::Arg_error | PSF_model::alpha is not in its density range. |
Definition at line 995 of file psf_model.cpp.
void PSF_model::check_beta | ( | ) | const throw (jwscxx::base::Arg_error) [protected] |
Checks the beta of this PSF_model against its density range.
jwscxx::base::Arg_error | PSF_model::beta is not in its density range. |
Definition at line 1013 of file psf_model.cpp.
void PSF_model::check_gamma | ( | ) | const throw (jwscxx::base::Arg_error) [protected] |
Checks the gamma of this PSF_model against its density range.
jwscxx::base::Arg_error | PSF_model::gamma is not in its density range. |
Definition at line 1031 of file psf_model.cpp.
float PSF_model::alpha [protected] |
Base in a geometric distribution used to weight each Gaussian in the model.
Must be in the range (0,1).
Definition at line 395 of file psf_model.h.
float PSF_model::beta [protected] |
Scales the distance of each Gaussian from the x,y-plane for additive variance.
Must be >= 0.
Definition at line 403 of file psf_model.h.
float PSF_model::gamma [protected] |
double PSF_model::log_prob [protected] |
Log probability of this PSF_model.
Definition at line 413 of file psf_model.h.
const PSF_model_density* PSF_model::density [protected] |
Parameters for density functions over this PSF_model.
Definition at line 416 of file psf_model.h.