Alternaria
fit cylinders and ellipsoids to fungus
PSF_model Class Reference

Model of the point spread function. More...

#include <psf_model.h>

Inheritance diagram for PSF_model:
Collaboration diagram for PSF_model:

List of all members.

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_modeloperator= (const PSF_model &psf)
 Copies a PSF into this PSF.
PSF_modelclone ()
 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_densityget_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_densitydensity
 Parameters for density functions over this PSF_model.

Detailed Description

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.


Constructor & Destructor Documentation

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.

Parameters:
alphaPSF_model::alpha.
betaPSF_model::beta.
gammaPSF_model::gamma.
paddingPSF_padding to use.
densityPSF_model_density parameters for probabilities.
imagingImaging_model to use for updating the PSF_model::h.
Exceptions:
jwscxx::base::Arg_errorPSF_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.

Parameters:
modelModel 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.

Parameters:
fnameName of the file to read the PSF_model from.
paddingPSF_padding to use.
densityPSF_model_density parameters for probabilities.
imagingImaging_model to use for updating the PSF_model::h.
Exceptions:
jwscxx::base::IO_errorCould not open fname or read from it.
jwscxx::base::Arg_errorImproper 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.


Member Function Documentation

PSF_model & PSF_model::operator= ( const PSF_model psf)

Copies a PSF into this PSF.

Parameters:
psfPSF_model to copy.
Returns:
A reference to this PSF_model with psf copied into it.

Definition at line 599 of file psf_model.cpp.

PSF_model * PSF_model::clone ( )

Clones this PSF_model.

Returns:
A pointer to a cloned 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.

Parameters:
alphaNew PSF_model::alpha.
betaNew PSF_model::beta.
gammaNew PSF_model::gamma.
imagingImaging_model to use.
Exceptions:
jwscxx::base::Arg_errorThe 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.

Parameters:
alphaNew PSF_model::alpha.
imagingImaging_model to use.
Exceptions:
jwscxx::base::Arg_errorThe 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.

Parameters:
betaNew PSF_model::beta.
imagingImaging_model to use.
Exceptions:
jwscxx::base::Arg_errorThe 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.

Parameters:
gammaNew PSF_model::gamma.
imagingImaging_model to use.
Exceptions:
jwscxx::base::Arg_errorThe 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]

Prints this PSF_model to an output stream.

The format is as follows

        Alpha: alpha
         Beta: beta
        Gamma: gamma
     Log Prob: log prob
Parameters:
outOutput stream to print to.

Implements Printable.

Definition at line 936 of file psf_model.cpp.

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

        Alpha: alpha
         Beta: beta
        Gamma: gamma
     Log Prob: log prob
Parameters:
fnameName of the file to print to.
Exceptions:
jwscxx::base::IO_errorCould 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.

Parameters:
imagingImaging_model to use.
Note:
The PSF_model::h is shifted for use in FFT convolution functions. Use unshift_matblock_f() to undo this.

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.

Exceptions:
jwscxx::base::Arg_errorPSF_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.

Exceptions:
jwscxx::base::Arg_errorPSF_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.

Exceptions:
jwscxx::base::Arg_errorPSF_model::gamma is not in its density range.

Definition at line 1031 of file psf_model.cpp.


Member Data Documentation

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]

Base std dev for each Gaussian.

Must be > 0.

Definition at line 410 of file psf_model.h.

double PSF_model::log_prob [protected]

Log probability of this PSF_model.

Definition at line 413 of file psf_model.h.

Parameters for density functions over this PSF_model.

Definition at line 416 of file psf_model.h.


The documentation for this class was generated from the following files: