Inheritance diagram for Defectix:
Public Member Functions | |
Defectix (const DefectixOptions::Options &options) | |
Standard constructor. | |
virtual | ~Defectix () |
Standard destructor. | |
virtual const errorCodes | exec ()=0 |
Main function. | |
errorCodes | readImageExtension (int pos, bool createMask=false) |
read an extension from a MEF file | |
errorCodes | readAllImageExtensions (bool createMask=false) |
read an entire MEF | |
void | unreadImageExtension (int pos) |
unload and free an extension | |
void | unreadAllImageExtensions () |
unload and free all extensions | |
errorCodes | readMaskExtension (int pos) |
read an extension from a MEF file | |
errorCodes | readAllMasks () |
read an entire MEF | |
void | unreadMaskExtension (int pos) |
unload and free an mask extension | |
void | unreadAllMasks () |
unload and free all mask extensions | |
Protected Member Functions | |
void | getVectorfromBloc (gsl_vector *dest, const gsl_matrix *const src, unsigned row, unsigned col) |
Convert a bloc into a vector. | |
void | substractBackground (gsl_matrix *m, s_ext_info *info) |
Substract the computed background value. | |
const errorCodes | writeAllMasks () |
write all mask extensions into a MEF file | |
void | printMessage (std::string msg) const |
Print a message on the standard output. | |
void | overwriteMessage () const |
Overwrite the previous message written on the standard output. | |
Protected Attributes | |
FitsManager | _imageMgr |
FITS and MEF manager for the image. | |
FitsManager | _maskMgr |
FITS and MEF manager for the mask. | |
int | _factor |
rebin factor | |
int | _blocSize |
Size of the blocks to create. | |
int | _zoomStep |
Unused for now. | |
bool | _substractBg |
Ask for background substraction. | |
bool | _reduceDyn |
Ask for dynamic reduction. | |
std::map< int, gsl_matrix * > | _images |
List of loaded extensions. | |
std::map< int, t_ext_info > | _imagesInfo |
List of informations about loaded extensions. | |
std::map< int, gsl_matrix * > | _masks |
List of loaded masks. | |
DefectPCA * | _PCA |
Class dedicated to the PCA computation. | |
Private Member Functions | |
double | computeBackground (const gsl_vector *const pixels, const unsigned int factor, double stdev) |
compute the background value of an image histogram | |
void | reduceDyn (gsl_matrix *m, s_ext_info *info) |
Apply a dynamic reduction of an image. | |
void | rebin (void **src, long bitpix, const long axes[2]) |
Rebin an image. | |
void | computeInfo (gsl_matrix *m, gsl_vector *pixels, s_ext_info *info) |
Compute informations about an image. | |
template<typename T> void | rebin (T **src, T *dest, const long axes[2]) |
Rebin an image. | |
template<typename T> errorCodes | commonRead (gsl_matrix *m, T **src, FitsManager &mgr) |
Read a MEF extension into a matrix. | |
errorCodes | commonRead (int pos, gsl_matrix *m, FitsManager &mgr) |
Read a MEF into a matrix. | |
void | commonPrint (int pos, const char *const type) const |
Print standard message when a extension or a mask is read. |
The class is the top class
|
Standard constructor. The constructor initializes a random seed with current time, creates an ErrorManager, two FitsManager for images and masks and sets private members with 'options' values.
|
|
Standard destructor. The destructor destroys Defectix::_PCA if it exists. |
|
Print standard message when a extension or a mask is read.
|
|
Read a MEF into a matrix. The function reads an extension of a given MEF file and stores it into a matrix. The function call the templated commonRead()
|
|
Read a MEF extension into a matrix. The function reads a given extension of a given MEF file and stores it into a matrix.
|
|
compute the background value of an image histogram The function computes the value of the background of an image histogram. It is a recursive function. For each new iteration, the histogram is reduced to compute a more precise value of the background.
|
|
Compute informations about an image. The function computes the histogram of an image and several compute informations as maximum and minimum pixel values.
|
|
Main function. The function executes the main code of the class for every subclasses. Implemented in DefectComputer, DefectSimulator, and DefectTrainer. |
|
Convert a bloc into a vector. The functions gets a matrix {Defectix::_blocSize, Defectix::_blocSize} pixels and sets a vector {Defectix::_blocSize x Defectix::_blocSize, 1}
|
|
Print a message on the standard output.
|
|
read an entire MEF The function reads and loads a MEF into the class. The function can also create a corresponding mask. It is the case for simulating and computing.
|
|
read an entire MEF The function reads and loads a MEF into the class. The MEF is loaded as a mask. The function is not compatible with readAllImageExtensions() called with createMask = true; |
|
read an extension from a MEF file The function reads and loads a MEF extension into the class. The function can also create a corresponding extension for the mask. It is the case for simulating and computing.
|
|
read an extension from a MEF file The function reads and loads a MEF extension into the class. The extension is loaded as a mask extension. The function is not compatible with readImageExtension() called with createMask = true;
|
|
Rebin an image. The function effectively rebins an image. The rebin factor is Defectix::_rebinFactor.
|
|
Rebin an image. The function rebins a image whose type correspond to the given bitpix. The function calls the private and templated function Defectix::rebin()
|
|
Apply a dynamic reduction of an image. The function reduces the dynamic range of an image applying yhe formula: y(x) = ln ( 1 + x / sigma) / |x|, where sigma is the standard deviation of the global background. Image informations are also updated.
|
|
Substract the computed background value. The function substracts the background value to each pixel of an image. The value of the background must have been computed using computeBackground()
|
|
unload and free all extensions The function unreads all previously loaded extensions and frees the memory used in the class. |
|
unload and free all mask extensions The function unreads all previously loaded mask extensions and frees the memory used in the class. |
|
unload and free an extension The function unreads a previously loaded extension and frees the memory used in the class.
|
|
unload and free an mask extension The function unreads a previously loaded mask extension and frees the memory used in the class.
|
|
write all mask extensions into a MEF file The function writes mask extensions into a MEF file. The function is used when masks are created by readAllExtensions() with createMask = true, that is during simulations or computing. |
|
Size of the blocks to create. _blocSize defines the size of the blocks used for PCA, training and computing. Blocks contains _blocSize x _blocSize pixels. |
|
rebin factor _factor defines the rebin factor used during image loading. If 1, no rebin is computed. |
|
FITS and MEF manager for the image. See FitsManager |
|
List of loaded extensions. Extensions loaded with ReadImageExtension() are stored in this map. The key correspond to the extension position in the MEF. |
|
List of informations about loaded extensions. Informations of extensions loaded with ReadImageExtension() are stored in this map. The key correspond to the extension position in the MEF. |
|
FITS and MEF manager for the mask. See FitsManager |
|
List of loaded masks. Extensions loaded with ReadMaskExtension() are stored in this map. The key correspond to the extension position in the MEF. |
|
Class dedicated to the PCA computation. Subclasses can allocates this attribute to compute a PCA on loaded images. |
|
Ask for dynamic reduction. If _reduceDyn is true, a dynamic reduction will be computed on the loaded images. |
|
Ask for background substraction. If _substrackBg is true, a background substraction will be computed on the loaded images. |